diff options
author | Alon Levy <alevy@redhat.com> | 2011-06-23 11:14:42 +0200 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2011-06-23 13:18:39 +0200 |
commit | c9ef064d5371e6cd1746915810746137835f1a15 (patch) | |
tree | 5a28ed7c80bfad47be8835d836c7e5ccb2d7db1f | |
parent | f1df038e4b65c93d9660f574edc3035db2aaa7df (diff) |
server/smartcard: don't register the channel if no hardware emulated
-rw-r--r-- | server/smartcard.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/smartcard.c b/server/smartcard.c index f948e5b..7830c9a 100644 --- a/server/smartcard.c +++ b/server/smartcard.c @@ -538,6 +538,10 @@ void smartcard_channel_init(void) { Channel *channel; + /* don't register the channel if no hardware registered */ + if (g_smartcard_readers.num == 0) { + return; + } channel = spice_new0(Channel, 1); channel->type = SPICE_CHANNEL_SMARTCARD; channel->link = smartcard_link; @@ -545,4 +549,3 @@ void smartcard_channel_init(void) channel->migrate = smartcard_migrate; reds_register_channel(channel); } - |