[PATCH v2.5 04/10] qemu: New cap flag for scsi-generic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adding two caps to support scsi-generic:

  QEMU_CAPS_SCSI_GENERIC
  QEMU_CAPS_SCSI_GENERIC_BOOTINDEX

Signed-off-by: Han Cheng <hanc.fnst@xxxxxxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c             |   14 ++++++++++++--
 src/qemu/qemu_capabilities.h             |    2 ++
 tests/qemuhelpdata/qemu-1.0-device       |   10 ++++++++++
 tests/qemuhelpdata/qemu-1.1.0-device     |   10 ++++++++++
 tests/qemuhelpdata/qemu-1.2.0-device     |    5 +++++
 tests/qemuhelpdata/qemu-kvm-1.2.0-device |    5 +++++
 tests/qemuhelptest.c                     |   19 ++++++++++++++-----
 7 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 50712b0..aeff2c9 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -216,6 +216,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
 
               "ipv6-migration", /* 135 */
               "machine-opt",
+              "scsi-generic",
+              "scsi-generic.bootindex",
     );
 
 struct _virQEMUCaps {
@@ -1331,13 +1333,14 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
     { "VGA", QEMU_CAPS_DEVICE_VGA },
     { "cirrus-vga", QEMU_CAPS_DEVICE_CIRRUS_VGA },
     { "vmware-svga", QEMU_CAPS_DEVICE_VMWARE_SVGA },
-    { "usb-serial", QEMU_CAPS_DEVICE_USB_SERIAL},
-    { "usb-net", QEMU_CAPS_DEVICE_USB_NET},
+    { "usb-serial", QEMU_CAPS_DEVICE_USB_SERIAL },
+    { "usb-net", QEMU_CAPS_DEVICE_USB_NET },
     { "virtio-rng-pci", QEMU_CAPS_DEVICE_VIRTIO_RNG },
     { "virtio-rng-s390", QEMU_CAPS_DEVICE_VIRTIO_RNG },
     { "virtio-rng-ccw", QEMU_CAPS_DEVICE_VIRTIO_RNG },
     { "rng-random", QEMU_CAPS_OBJECT_RNG_RANDOM },
     { "rng-egd", QEMU_CAPS_OBJECT_RNG_EGD },
+    { "scsi-generic", QEMU_CAPS_SCSI_GENERIC },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = {
@@ -1383,6 +1386,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbHost[] = {
     { "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX },
 };
 
+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsScsiHost[] = {
+    { "bootindex", QEMU_CAPS_SCSI_GENERIC_BOOTINDEX },
+};
+
 struct virQEMUCapsObjectTypeProps {
     const char *type;
     struct virQEMUCapsStringFlags *props;
@@ -1416,6 +1423,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbRedir) },
     { "usb-host", virQEMUCapsObjectPropsUsbHost,
       ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbHost) },
+    { "scsi-generic", virQEMUCapsObjectPropsScsiHost,
+      ARRAY_CARDINALITY(virQEMUCapsObjectPropsScsiHost) },
 };
 
 
@@ -1613,6 +1622,7 @@ virQEMUCapsExtractDeviceStr(const char *qemu,
                          "-device", "usb-redir,?",
                          "-device", "ide-drive,?",
                          "-device", "usb-host,?",
+                         "-device", "scsi-generic,?",
                          NULL);
     /* qemu -help goes to stdout, but qemu -device ? goes to stderr.  */
     virCommandSetErrorBuffer(cmd, &output);
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index b2dc588..f1f1b5d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -176,6 +176,8 @@ enum virQEMUCapsFlags {
     QEMU_CAPS_SCSI_MEGASAS       = 134, /* -device megasas */
     QEMU_CAPS_IPV6_MIGRATION     = 135, /* -incoming [::] */
     QEMU_CAPS_MACHINE_OPT        = 136, /* -machine xxxx*/
+    QEMU_CAPS_SCSI_GENERIC       = 137, /* -device scsi-generic */
+    QEMU_CAPS_SCSI_GENERIC_BOOTINDEX = 138, /* scsi-generic.bootindex */
 
     QEMU_CAPS_LAST,                   /* this must always be the last item */
 };
diff --git a/tests/qemuhelpdata/qemu-1.0-device b/tests/qemuhelpdata/qemu-1.0-device
index 0bdfbbd..d557f0e 100644
--- a/tests/qemuhelpdata/qemu-1.0-device
+++ b/tests/qemuhelpdata/qemu-1.0-device
@@ -136,3 +136,13 @@ virtio-net-pci.romfile=string
 virtio-net-pci.rombar=uint32
 virtio-net-pci.multifunction=on/off
 virtio-net-pci.command_serr_enable=on/off
+scsi-generic.drive=drive
+scsi-generic.logical_block_size=uint16
+scsi-generic.physical_block_size=uint16
+scsi-generic.min_io_size=uint16
+scsi-generic.opt_io_size=uint32
+scsi-generic.bootindex=int32
+scsi-generic.discard_granularity=uint32
+scsi-generic.channel=uint32
+scsi-generic.scsi-id=uint32
+scsi-generic.lun=uint32
diff --git a/tests/qemuhelpdata/qemu-1.1.0-device b/tests/qemuhelpdata/qemu-1.1.0-device
index abbf850..7313a34 100644
--- a/tests/qemuhelpdata/qemu-1.1.0-device
+++ b/tests/qemuhelpdata/qemu-1.1.0-device
@@ -158,3 +158,13 @@ scsi-disk.dpofua=on/off
 scsi-disk.channel=uint32
 scsi-disk.scsi-id=uint32
 scsi-disk.lun=uint32
+scsi-generic.drive=drive
+scsi-generic.logical_block_size=blocksize
+scsi-generic.physical_block_size=blocksize
+scsi-generic.min_io_size=uint16
+scsi-generic.opt_io_size=uint32
+scsi-generic.bootindex=int32
+scsi-generic.discard_granularity=uint32
+scsi-generic.channel=uint32
+scsi-generic.scsi-id=uint32
+scsi-generic.lun=uint32
diff --git a/tests/qemuhelpdata/qemu-1.2.0-device b/tests/qemuhelpdata/qemu-1.2.0-device
index 5613e00..40845e4 100644
--- a/tests/qemuhelpdata/qemu-1.2.0-device
+++ b/tests/qemuhelpdata/qemu-1.2.0-device
@@ -208,3 +208,8 @@ usb-host.bootindex=int32
 usb-host.pipeline=on/off
 usb-host.port=string
 usb-host.full-path=on/off
+scsi-generic.drive=drive
+scsi-generic.bootindex=int32
+scsi-generic.channel=uint32
+scsi-generic.scsi-id=uint32
+scsi-generic.lun=uint32
diff --git a/tests/qemuhelpdata/qemu-kvm-1.2.0-device b/tests/qemuhelpdata/qemu-kvm-1.2.0-device
index 879a049..09e3ef7 100644
--- a/tests/qemuhelpdata/qemu-kvm-1.2.0-device
+++ b/tests/qemuhelpdata/qemu-kvm-1.2.0-device
@@ -220,3 +220,8 @@ usb-host.bootindex=int32
 usb-host.pipeline=on/off
 usb-host.port=string
 usb-host.full-path=on/off
+scsi-generic.drive=drive
+scsi-generic.bootindex=int32
+scsi-generic.channel=uint32
+scsi-generic.scsi-id=uint32
+scsi-generic.lun=uint32
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 43774f4..7cbdf05 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -506,7 +506,8 @@ mymain(void)
             QEMU_CAPS_DEVICE_CIRRUS_VGA,
             QEMU_CAPS_DEVICE_VMWARE_SVGA,
             QEMU_CAPS_DEVICE_USB_SERIAL,
-            QEMU_CAPS_DEVICE_USB_NET);
+            QEMU_CAPS_DEVICE_USB_NET,
+            QEMU_CAPS_SCSI_GENERIC);
     DO_TEST("qemu-kvm-0.12.1.2-rhel61", 12001, 1, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -724,7 +725,9 @@ mymain(void)
             QEMU_CAPS_DEVICE_CIRRUS_VGA,
             QEMU_CAPS_DEVICE_VMWARE_SVGA,
             QEMU_CAPS_DEVICE_USB_SERIAL,
-            QEMU_CAPS_DEVICE_USB_NET);
+            QEMU_CAPS_DEVICE_USB_NET,
+            QEMU_CAPS_SCSI_GENERIC,
+            QEMU_CAPS_SCSI_GENERIC_BOOTINDEX);
     DO_TEST("qemu-1.1.0", 1001000, 0, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -815,7 +818,9 @@ mymain(void)
             QEMU_CAPS_DEVICE_USB_SERIAL,
             QEMU_CAPS_DEVICE_USB_NET,
             QEMU_CAPS_DTB,
-            QEMU_CAPS_IPV6_MIGRATION);
+            QEMU_CAPS_IPV6_MIGRATION,
+            QEMU_CAPS_SCSI_GENERIC,
+            QEMU_CAPS_SCSI_GENERIC_BOOTINDEX);
     DO_TEST("qemu-1.2.0", 1002000, 0, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -918,7 +923,9 @@ mymain(void)
             QEMU_CAPS_DEVICE_USB_NET,
             QEMU_CAPS_DTB,
             QEMU_CAPS_SCSI_MEGASAS,
-            QEMU_CAPS_IPV6_MIGRATION);
+            QEMU_CAPS_IPV6_MIGRATION,
+            QEMU_CAPS_SCSI_GENERIC,
+            QEMU_CAPS_SCSI_GENERIC_BOOTINDEX);
     DO_TEST("qemu-kvm-1.2.0", 1002000, 1, 0,
             QEMU_CAPS_VNC_COLON,
             QEMU_CAPS_NO_REBOOT,
@@ -1026,7 +1033,9 @@ mymain(void)
             QEMU_CAPS_DEVICE_USB_NET,
             QEMU_CAPS_DTB,
             QEMU_CAPS_SCSI_MEGASAS,
-            QEMU_CAPS_IPV6_MIGRATION);
+            QEMU_CAPS_IPV6_MIGRATION,
+            QEMU_CAPS_SCSI_GENERIC,
+            QEMU_CAPS_SCSI_GENERIC_BOOTINDEX);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-- 
1.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]