From 4fce9e84798be1441d8bc5b96f0ed68589e85222 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 9 Jun 2015 16:49:00 -0400 Subject: [PATCH] qemu: Do not support 'serial' scsi-block 'lun' devices https://bugzilla.redhat.com/show_bug.cgi?id=1021480 Seems the property has been deprecated for qemu, although seemingly ignored. This patch enforces from a libvirt perspective that a scsi-block 'lun' device should not provide the 'serial' property. --- docs/formatdomain.html.in | 3 +++ src/qemu/qemu_command.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b8af1d0133..3ccc71c559 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2511,6 +2511,9 @@
If present, this specify serial number of virtual hard drive. For example, it may look like <serial>WD-WMAP9A966149</serial>. + Not supported for scsi-block devices, that is those using + disk type 'block' using device 'lun' + on bus 'scsi'. Since 0.7.1
wwn
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 89f775de53..1351cba42e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3731,6 +3731,13 @@ qemuBuildDriveStr(virConnectPtr conn, virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_SERIAL)) { if (qemuSafeSerialParamValue(disk->serial) < 0) goto error; + if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && + disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("scsi-block 'lun' devices do not support the " + "serial property")); + goto error; + } virBufferAddLit(&opt, ",serial="); virBufferEscape(&opt, '\\', " ", "%s", disk->serial); } -- GitLab