提交 ddc72f99 编写于 作者: M Michal Privoznik

qemu_hotplug: Check for duplicate drive addresses

This tries to fix the same problem as f1d65853 but it's doing
so in a less invasive way.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: NJim Fehlig <jfehlig@suse.com>
上级 ee2c5ef3
......@@ -1183,6 +1183,12 @@ qemuDomainAttachSCSIDisk(virQEMUDriverPtr driver,
return -1;
}
if (virDomainSCSIDriveAddressIsUsed(vm->def, &disk->info.addr.drive)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain already contains a disk with that address"));
return -1;
}
/* Let's make sure the disk has a controller defined and loaded before
* trying to add it. The controller used by the disk must exist before a
* qemu command line string is generated.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册