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.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
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 1781996..4eb907d 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2502,6 +2502,9 @@
<dd>If present, this specify serial number of virtual hard drive.
For example, it may look
like
<code><serial>WD-WMAP9A966149</serial></code>.
+ Not supported for scsi-block devices, that is those using
+ disk <code>type</code> 'block' using
<code>device</code> 'lun'
+ on <code>bus</code> 'scsi'.
<span class="since">Since 0.7.1</span>
</dd>
<dt><code>wwn</code></dt>
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0a6d92f..cbea0d5 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);
}
--
2.1.0