summaryrefslogtreecommitdiffstats
path: root/server/smartcard.c
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-06-23 11:14:42 +0200
committerAlon Levy <alevy@redhat.com>2011-06-23 13:18:39 +0200
commit456ff9f8d5d27ac763e89e67a100661084695dc5 (patch)
tree0f27fd680511c288fb3f2a39a3be55d7b6c0b317 /server/smartcard.c
parentde82fdb9dc0696526319cb89cf4305e8f3385771 (diff)
downloadspice-456ff9f8d5d27ac763e89e67a100661084695dc5.tar.gz
spice-456ff9f8d5d27ac763e89e67a100661084695dc5.tar.xz
spice-456ff9f8d5d27ac763e89e67a100661084695dc5.zip
server/smartcard: don't register the channel if no hardware emulated
Diffstat (limited to 'server/smartcard.c')
-rw-r--r--server/smartcard.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/smartcard.c b/server/smartcard.c
index f948e5b2..7830c9a1 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);
}
-