diff options
author | Guannan Ren <gren@redhat.com> | 2012-08-08 14:25:24 +0800 |
---|---|---|
committer | Guannan Ren <gren@redhat.com> | 2012-08-08 14:25:24 +0800 |
commit | 8694c716ae64a62f3452ed732ef3f74b929aabe8 (patch) | |
tree | 69d153b5bef0f96df53d006adcceed710efc9c83 | |
parent | util: include stderr in log message when an external command fails (diff) | |
download | libvirt-8694c716ae64a62f3452ed732ef3f74b929aabe8.tar.gz libvirt-8694c716ae64a62f3452ed732ef3f74b929aabe8.tar.bz2 libvirt-8694c716ae64a62f3452ed732ef3f74b929aabe8.zip |
qemu: add capabilities flags related to scsi controller
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_VIRTIO_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
-rw-r--r-- | src/qemu/qemu_capabilities.c | 7 | ||||
-rw-r--r-- | src/qemu/qemu_capabilities.h | 2 | ||||
-rw-r--r-- | tests/qemuhelptest.c | 10 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 82a287053..5472267a3 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_VIRTIO_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 c1b67a697..d60689015 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_VIRTIO_SCSI_PCI = 102, /* -device virtio-scsi-pci */ QEMU_CAPS_LAST, /* this must always be the last item */ }; diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 75c818ccd..2d15c9499 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -482,7 +482,8 @@ mymain(void) QEMU_CAPS_PCI_ROMBAR, QEMU_CAPS_NO_ACPI, QEMU_CAPS_VIRTIO_BLK_SG_IO, - QEMU_CAPS_CPU_HOST); + QEMU_CAPS_CPU_HOST, + QEMU_CAPS_SCSI_LSI); DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -677,7 +678,8 @@ mymain(void) QEMU_CAPS_FSDEV_WRITEOUT, QEMU_CAPS_SCSI_BLOCK, QEMU_CAPS_SCSI_CD, - QEMU_CAPS_IDE_CD); + QEMU_CAPS_IDE_CD, + QEMU_CAPS_SCSI_LSI); DO_TEST("qemu-1.1.0", 1001000, 0, 0, QEMU_CAPS_VNC_COLON, QEMU_CAPS_NO_REBOOT, @@ -755,7 +757,9 @@ mymain(void) QEMU_CAPS_NO_USER_CONFIG, QEMU_CAPS_HDA_MICRO, QEMU_CAPS_NEC_USB_XHCI, - QEMU_CAPS_NETDEV_BRIDGE); + QEMU_CAPS_NETDEV_BRIDGE, + QEMU_CAPS_SCSI_LSI, + QEMU_CAPS_VIRTIO_SCSI_PCI); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } |