From: Michal Privoznik Date: Thu, 11 Apr 2019 13:40:51 +0000 (+0200) Subject: Revert "domain_conf: check device address before attach" X-Git-Tag: v5.3.0-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22dc3e94c24b4d9a6c28beda91b9b283eb9b0251;p=thirdparty%2Flibvirt.git 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 Tested-by: Daniel Henrique Barboza Reviewed-by: Jim Fehlig --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3f2adaa500..6331424635 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28814,15 +28814,6 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, 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 &&