[PATCH 3/4 v3] qemu: Add caps to indentify if setting wwn is supported by qemu

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

 



This assumes ide-drive.wwn, ide-hd.wwn, ide-cd.wwn were supported
at the same time, similar for scsi-disk.wwn, scsi-hd.wwn, and
scsi-cd.wwn. So only two new caps (QEMU_CAPS_IDE_DRIVE_WWN,
and QEMU_CAPS_SCSI_DISK_WWN) are introduced.
---
 src/qemu/qemu_capabilities.c |    8 ++++++++
 src/qemu/qemu_capabilities.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index ed85b6f..949e99c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -176,6 +176,8 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
               "disable-s3",
 
               "disable-s4", /* 105 */
+              "ide-drive.wwn",
+              "scsi-disk.wwn",
     );
 
 struct qemu_feature_flags {
@@ -1407,6 +1409,7 @@ qemuCapsExtractDeviceStr(const char *qemu,
                          "-device", "virtio-net-pci,?",
                          "-device", "scsi-disk,?",
                          "-device", "PIIX4_PM,?",
+                         "-device", "ide-drive,?",
                          NULL);
     /* qemu -help goes to stdout, but qemu -device ? goes to stderr.  */
     virCommandSetErrorBuffer(cmd, &output);
@@ -1497,12 +1500,17 @@ qemuCapsParseDeviceStr(const char *str, virBitmapPtr flags)
         qemuCapsSet(flags, QEMU_CAPS_VIRTIO_BLK_SCSI);
     if (strstr(str, "scsi-disk.channel"))
         qemuCapsSet(flags, QEMU_CAPS_SCSI_DISK_CHANNEL);
+    if (strstr(str, "scsi-disk.wwn"))
+        qemuCapsSet(flags, QEMU_CAPS_SCSI_DISK_WWN);
     if (strstr(str, "scsi-block"))
         qemuCapsSet(flags, QEMU_CAPS_SCSI_BLOCK);
     if (strstr(str, "scsi-cd"))
         qemuCapsSet(flags, QEMU_CAPS_SCSI_CD);
     if (strstr(str, "ide-cd"))
         qemuCapsSet(flags, QEMU_CAPS_IDE_CD);
+    if (strstr(str, "ide-drive.wwn"))
+        qemuCapsSet(flags, QEMU_CAPS_IDE_DRIVE_WWN);
+
     /*
      * the iolimit detection is not really straight forward:
      * in qemu this is a capability of the block layer, if
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 49d64e5..954e51d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -141,6 +141,8 @@ enum qemuCapsFlags {
     QEMU_CAPS_BLOCKIO            = 103, /* -device ...logical_block_size & co */
     QEMU_CAPS_DISABLE_S3         = 104, /* S3 BIOS Advertisement on/off */
     QEMU_CAPS_DISABLE_S4         = 105, /* S4 BIOS Advertisement on/off */
+    QEMU_CAPS_IDE_DRIVE_WWN      = 106, /* Is ide-drive.wwn available? */
+    QEMU_CAPS_SCSI_DISK_WWN      = 107, /* Is scsi-disk.wwn available? */
 
     QEMU_CAPS_LAST,                   /* this must always be the last item */
 };
-- 
1.7.7.3

--
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]