- 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
41 lines
1.6 KiB
Diff
41 lines
1.6 KiB
Diff
commit 22dc3e94c24b4d9a6c28beda91b9b283eb9b0251
|
|
Author: Michal Privoznik <mprivozn@redhat.com>
|
|
Date: Thu Apr 11 15:40:51 2019 +0200
|
|
|
|
Revert "domain_conf: check device address before attach"
|
|
|
|
This reverts commit f1d6585300001c7b23b8796a0faa4411c3531996.
|
|
|
|
Turns out, this caused a regression. There is this (perhaps less
|
|
known) semantic of virDomainAttachDevice() where if the device
|
|
the API is trying to attach is a CDROM/floppy that is already in
|
|
the domain the attach request is handled as 'change the media in
|
|
the drive'.
|
|
|
|
We have a better fix anyways.
|
|
|
|
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/conf/domain_conf.c
|
|
===================================================================
|
|
--- libvirt-5.2.0.orig/src/conf/domain_conf.c
|
|
+++ libvirt-5.2.0/src/conf/domain_conf.c
|
|
@@ -28589,15 +28589,6 @@ virDomainDefCompatibleDevice(virDomainDe
|
|
if (oldDev)
|
|
data.oldInfo = virDomainDeviceGetInfo(oldDev);
|
|
|
|
- if (action == VIR_DOMAIN_DEVICE_ACTION_ATTACH &&
|
|
- data.newInfo &&
|
|
- data.newInfo->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
|
|
- virDomainDefHasDeviceAddress(def, data.newInfo)) {
|
|
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
|
- _("Domain already contains a device with the same address"));
|
|
- return -1;
|
|
- }
|
|
-
|
|
if (action == VIR_DOMAIN_DEVICE_ACTION_UPDATE &&
|
|
live &&
|
|
(data.newInfo && data.oldInfo &&
|