[libvirt] [PATCHv4 3/5] smartcard: check for qemu capability

Eric Blake eblake at redhat.com
Tue Feb 1 16:48:54 UTC 2011


Qemu smartcard support exists on branches (such as
http://cgit.freedesktop.org/~alon/qemu/commit/?h=usb_ccid.v15&id=024a37b)
but is not yet upstream.  Once an upstream version exists, then we
can add new -help and -device ? output files  to tests/qemuhelptest
to prove that the new flag works.

* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_USB_CCID): New
flag.
* src/qemu/qemu_capabilities.c (qemuCapsExtractDeviceStr)
(qemuCapsParseDeviceStr): Check for smartcard device support.

---
Notes:
    v2: new patch
    v3: rebase to latest tree
    v4: no change
 src/qemu/qemu_capabilities.c |    2 ++
 src/qemu/qemu_capabilities.h |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 37a97aa..8c1b95d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1084,6 +1084,8 @@ qemuCapsParseDeviceStr(const char *str, unsigned long long *flags)
     /* Which devices exist. */
     if (strstr(str, "name \"hda-duplex\""))
         *flags |= QEMUD_CMD_FLAG_HDA_DUPLEX;
+    if (strstr(str, "name \"usb-ccid\""))
+        *flags |= QEMUD_CMD_FLAG_USB_CCID;

     /* Features of given devices. */
     if (strstr(str, "pci-assign.configfd"))
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 59bb22a..caba667 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -86,6 +86,7 @@ enum qemuCapsFlags {
     QEMUD_CMD_FLAG_BOOTINDEX     = (1LL << 49), /* -device bootindex property */
     QEMUD_CMD_FLAG_HDA_DUPLEX    = (1LL << 50), /* -device hda-duplex */
     QEMUD_CMD_FLAG_DRIVE_AIO     = (1LL << 51), /* -drive aio= supported */
+    QEMUD_CMD_FLAG_USB_CCID      = (1LL << 52), /* -device usb-ccid */
 };

 virCapsPtr qemuCapsInit(virCapsPtr old_caps);
-- 
1.7.3.5




More information about the libvir-list mailing list