Check the disk scsi address only when the disk is scsi type.
Signed-off-by: Xu Yandong <xuyandong2(a)huawei.com>
---
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 62ce7270ca..ff2173da5e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8326,7 +8326,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;
--
2.18.1