[libvirt] [PATCH v2 31/32] qemu: Use the 'device_id' property of SCSI disks to avoid regressing

Ján Tomko jtomko at redhat.com
Thu Feb 7 17:15:06 UTC 2019


On Mon, Feb 04, 2019 at 04:47:04PM +0100, Peter Krempa wrote:
>QEMU accidentally exposed the id of -drive (or same value as disk
>serial, if provided) in one of the identifiers visible from the guest.
>
>To avoid regression in case when -blockdev will be used we need to
>always specify it ourselves.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_command.c                       | 22 +++++++++++++++++++
> .../controller-virtio-scsi.x86_64-latest.args | 20 ++++++++---------
> .../disk-cache.x86_64-latest.args             |  4 ++--
> .../disk-scsi-device-auto.x86_64-latest.args  |  3 ++-
> .../disk-scsi.x86_64-latest.args              | 16 ++++++++------
> .../disk-shared.x86_64-latest.args            |  5 +++--
> ...threads-virtio-scsi-pci.x86_64-latest.args |  4 ++--
> 7 files changed, 50 insertions(+), 24 deletions(-)
>
>@@ -2021,6 +2037,12 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
>                               disk->info.addr.drive.target,
>                               disk->info.addr.drive.unit);
>         }
>+
>+        if (scsiVPDDeviceId) {
>+            virBufferAddLit(&opt, ",device_id=");
>+            virBufferEscape(&opt, '\\', " ", "%s", scsiVPDDeviceId);

commas should be escaped, not spaces

>+        }
>+
>         break;
>
>     case VIR_DOMAIN_DISK_BUS_SATA:

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190207/ab2e3100/attachment-0001.sig>


More information about the libvir-list mailing list