From d72ed16ba73279e3f5779bbf1ca48ead3e97d3f9 Mon Sep 17 00:00:00 2001 From: Xu Yandong Date: Thu, 19 Sep 2019 04:02:36 -0400 Subject: [PATCH] qemuCheckDiskConfigAgainstDomain: Validate disk's SCSI address iff disk is SCSI Check the disk SCSI address only when the disk actually is of SCSI type. Signed-off-by: Xu Yandong Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1e041a8bac..0753904472 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8314,7 +8314,8 @@ static int qemuCheckDiskConfigAgainstDomain(const virDomainDef *def, const virDomainDiskDef *disk) { - if (virDomainSCSIDriveAddressIsUsed(def, &disk->info.addr.drive)) { + if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI && + virDomainSCSIDriveAddressIsUsed(def, &disk->info.addr.drive)) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain already contains a disk with that address")); return -1;