[Spice-devel] [PATCH 2/2] server/smartcard: don't register the channel if no hardware emulated

Christophe Fergeau cfergeau at redhat.com
Thu Jun 23 03:03:57 PDT 2011


On Thu, Jun 23, 2011 at 11:16:48AM +0200, Alon Levy wrote:
> ---
>  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;
> +    }

This wouldn't work if usb-ccid qemu devices could be hotplugged during qemu's
lifetime, but according to an IRC discussion, this is currently not
possible in QEMU. So ack from me.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110623/c4209a41/attachment.pgp>


More information about the Spice-devel mailing list