25a1844db7
- qemu: fix CDROM media change when using virDomainAttachDevice 89237d53-conf-expose-virDomainSCSIDriveAddressIsUsed.patch, ee2c5ef3-test-scsi-disk.patch, ddc72f99-qemu-check-dup-drive-address.patch, 22dc3e94-revert-f1d65853.patch boo#1132127 OBS-URL: https://build.opensuse.org/request/show/696099 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=748
31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
commit ddc72f99027b063feaf34e5fda89916b6b2c8943
|
|
Author: Michal Privoznik <mprivozn@redhat.com>
|
|
Date: Thu Apr 11 15:45:27 2019 +0200
|
|
|
|
qemu_hotplug: Check for duplicate drive addresses
|
|
|
|
This tries to fix the same problem as f1d65853000 but it's doing
|
|
so in a less invasive way.
|
|
|
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
Tested-by: Daniel Henrique Barboza <danielhb413@gmail.com>
|
|
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
|
|
|
|
Index: libvirt-5.2.0/src/qemu/qemu_hotplug.c
|
|
===================================================================
|
|
--- libvirt-5.2.0.orig/src/qemu/qemu_hotplug.c
|
|
+++ libvirt-5.2.0/src/qemu/qemu_hotplug.c
|
|
@@ -1181,6 +1181,12 @@ qemuDomainAttachSCSIDisk(virQEMUDriverPt
|
|
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.
|