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.
This commit is contained in:
John Ferlan 2015-06-09 16:49:00 -04:00
parent 1feaccf000
commit 4fce9e8479
2 changed files with 10 additions and 0 deletions

View File

@ -2511,6 +2511,9 @@
<dd>If present, this specify serial number of virtual hard drive.
For example, it may look
like <code>&lt;serial&gt;WD-WMAP9A966149&lt;/serial&gt;</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>

View File

@ -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);
}