aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOsier Yang <jyang@redhat.com>2012-09-18 10:12:11 +0800
committerOsier Yang <jyang@redhat.com>2012-09-18 14:42:39 +0800
commit331934b29674a95716800de6ac8a6f8075e70b8b (patch)
treeccb80ce8bb3996daf807dc82fac78f3dfb042394
parentconf: Parse and format disk <wwn> (diff)
downloadlibvirt-331934b29674a95716800de6ac8a6f8075e70b8b.tar.gz
libvirt-331934b29674a95716800de6ac8a6f8075e70b8b.tar.bz2
libvirt-331934b29674a95716800de6ac8a6f8075e70b8b.zip
qemu: Add caps to indentify if setting wwn is supported by qemu
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.
-rw-r--r--src/qemu/qemu_capabilities.c8
-rw-r--r--src/qemu/qemu_capabilities.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7742db50f..edfe1e765 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -177,6 +177,8 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"disable-s4", /* 105 */
"usb-redir.filter",
+ "ide-drive.wwn",
+ "scsi-disk.wwn",
);
struct _qemuCaps {
@@ -1466,6 +1468,7 @@ qemuCapsExtractDeviceStr(const char *qemu,
"-device", "scsi-disk,?",
"-device", "PIIX4_PM,?",
"-device", "usb-redir,?",
+ "-device", "ide-drive,?",
NULL);
/* qemu -help goes to stdout, but qemu -device ? goes to stderr. */
virCommandSetErrorBuffer(cmd, &output);
@@ -1558,12 +1561,17 @@ qemuCapsParseDeviceStr(const char *str, qemuCapsPtr caps)
qemuCapsSet(caps, QEMU_CAPS_VIRTIO_BLK_SCSI);
if (strstr(str, "scsi-disk.channel"))
qemuCapsSet(caps, QEMU_CAPS_SCSI_DISK_CHANNEL);
+ if (strstr(str, "scsi-disk.wwn"))
+ qemuCapsSet(caps, QEMU_CAPS_SCSI_DISK_WWN);
if (strstr(str, "scsi-block"))
qemuCapsSet(caps, QEMU_CAPS_SCSI_BLOCK);
if (strstr(str, "scsi-cd"))
qemuCapsSet(caps, QEMU_CAPS_SCSI_CD);
if (strstr(str, "ide-cd"))
qemuCapsSet(caps, QEMU_CAPS_IDE_CD);
+ if (strstr(str, "ide-drive.wwn"))
+ qemuCapsSet(caps, 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 c1519ed2e..fb1841a97 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -142,6 +142,8 @@ enum qemuCapsFlags {
QEMU_CAPS_DISABLE_S3 = 104, /* S3 BIOS Advertisement on/off */
QEMU_CAPS_DISABLE_S4 = 105, /* S4 BIOS Advertisement on/off */
QEMU_CAPS_USB_REDIR_FILTER = 106, /* usb-redir.filter */
+ QEMU_CAPS_IDE_DRIVE_WWN = 107, /* Is ide-drive.wwn available? */
+ QEMU_CAPS_SCSI_DISK_WWN = 108, /* Is scsi-disk.wwn available? */
QEMU_CAPS_LAST, /* this must always be the last item */
};