[libvirt] [PATCH 1/3] qemu: add capabilities flags related to scsi controller

Guannan Ren gren at redhat.com
Tue Aug 7 17:21:09 UTC 2012


  QEMU_CAPS_SCSI_LSI
    set the flag when "lsi53c895a", bus PCI, alias "lsi" in
    the output of "qemu -device ?"
    -device lsi in qemu command line

  QEMU_CAPS_VIRIO_SCSI_PCI
    set the flag when "name "virtio-scsi-pci", bus PCI" in
    the output of qemu devices query.
    -device virtio-scsi-pci in qemu command line
---
 src/qemu/qemu_capabilities.c |    7 +++++++
 src/qemu/qemu_capabilities.h |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 82a2870..ac90162 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -170,6 +170,8 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
               "balloon-event",
 
               "bridge", /* 100 */
+              "lsi",
+              "virtio-scsi-pci",
 
     );
 
@@ -1455,6 +1457,11 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
         strstr(str, "name \"virtio-serial-s390\""))
         qemuCapsSet(flags, QEMU_CAPS_VIRTIO_S390);
 
+    if (strstr(str, "name \"lsi53c895a\""))
+        qemuCapsSet(flags, QEMU_CAPS_SCSI_LSI);
+    if (strstr(str, "name \"virtio-scsi-pci\""))
+        qemuCapsSet(flags, QEMU_CAPS_VIRIO_SCSI_PCI);
+
     /* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */
     if (!qemuCapsGet(flags, QEMU_CAPS_CHARDEV_SPICEVMC) &&
         strstr(str, "name \"spicevmc\""))
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index c1b67a6..05e942e 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -136,6 +136,8 @@ enum qemuCapsFlags {
     QEMU_CAPS_VIRTIO_S390        = 98, /* -device virtio-*-s390 */
     QEMU_CAPS_BALLOON_EVENT      = 99, /* Async event for balloon changes */
     QEMU_CAPS_NETDEV_BRIDGE      = 100, /* bridge helper support */
+    QEMU_CAPS_SCSI_LSI           = 101, /* -device lsi */
+    QEMU_CAPS_VIRIO_SCSI_PCI     = 102, /* -device virtio-scsi-pci */
 
     QEMU_CAPS_LAST,                   /* this must always be the last item */
 };
-- 
1.7.7.6




More information about the libvir-list mailing list