Hello community, here is the log from the commit of package libvirt for openSUSE:Factory checked in at 2019-04-21 09:03:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libvirt (Old) and /work/SRC/openSUSE:Factory/.libvirt.new.5536 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libvirt" Sun Apr 21 09:03:36 2019 rev:279 rq:696100 version:5.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libvirt/libvirt.changes 2019-04-15 13:59:10.748702573 +0200 +++ /work/SRC/openSUSE:Factory/.libvirt.new.5536/libvirt.changes 2019-04-21 09:03:53.330587002 +0200 @@ -1,0 +2,10 @@ +Fri Apr 19 17:06:42 UTC 2019 - James Fehlig <[email protected]> + +- 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 + +------------------------------------------------------------------- New: ---- 22dc3e94-revert-f1d65853.patch 89237d53-conf-expose-virDomainSCSIDriveAddressIsUsed.patch ddc72f99-qemu-check-dup-drive-address.patch ee2c5ef3-test-scsi-disk.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libvirt.spec ++++++ --- /var/tmp/diff_new_pack.dbBeTP/_old 2019-04-21 09:03:55.606589661 +0200 +++ /var/tmp/diff_new_pack.dbBeTP/_new 2019-04-21 09:03:55.610589666 +0200 @@ -342,6 +342,10 @@ Patch2: 2a07c990-api-CVE-2019-3886.patch Patch3: ae076bb4-remote-CVE-2019-3886.patch Patch4: f66f70ac-snapshot-fix-use-after-free.patch +Patch5: 89237d53-conf-expose-virDomainSCSIDriveAddressIsUsed.patch +Patch6: ee2c5ef3-test-scsi-disk.patch +Patch7: ddc72f99-qemu-check-dup-drive-address.patch +Patch8: 22dc3e94-revert-f1d65853.patch # Patches pending upstream review Patch100: libxl-dom-reset.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch @@ -880,6 +884,10 @@ %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 %patch100 -p1 %patch101 -p1 %patch150 -p1 ++++++ 0001-Extract-stats-functions-from-the-qemu-driver.patch ++++++ --- /var/tmp/diff_new_pack.dbBeTP/_old 2019-04-21 09:03:55.658589721 +0200 +++ /var/tmp/diff_new_pack.dbBeTP/_new 2019-04-21 09:03:55.658589721 +0200 @@ -235,7 +235,7 @@ =================================================================== --- libvirt-5.2.0.orig/src/libvirt_private.syms +++ libvirt-5.2.0/src/libvirt_private.syms -@@ -671,6 +671,9 @@ virDomainConfNWFilterInstantiate; +@@ -672,6 +672,9 @@ virDomainConfNWFilterInstantiate; virDomainConfNWFilterTeardown; virDomainConfVMNWFilterTeardown; @@ -245,7 +245,7 @@ # conf/interface_conf.h virInterfaceDefFormat; -@@ -1583,6 +1586,7 @@ virCgroupGetMemoryUsage; +@@ -1584,6 +1587,7 @@ virCgroupGetMemoryUsage; virCgroupGetMemSwapHardLimit; virCgroupGetMemSwapUsage; virCgroupGetPercpuStats; ++++++ 22dc3e94-revert-f1d65853.patch ++++++ commit 22dc3e94c24b4d9a6c28beda91b9b283eb9b0251 Author: Michal Privoznik <[email protected]> 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 <[email protected]> Tested-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Jim Fehlig <[email protected]> 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 && ++++++ 89237d53-conf-expose-virDomainSCSIDriveAddressIsUsed.patch ++++++ commit 89237d534f0fe950d06a2081089154160c6c2224 Author: Michal Privoznik <[email protected]> Date: Thu Apr 11 15:44:14 2019 +0200 conf: Expose virDomainSCSIDriveAddressIsUsed This function checks if given drive address is already present in passed domain definition. Expose the function as it will be used shortly. Signed-off-by: Michal Privoznik <[email protected]> Tested-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Jim Fehlig <[email protected]> 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 @@ -4644,7 +4644,7 @@ virDomainDriveAddressIsUsedByHostdev(con * Return true if the SCSI drive address is already in use, false * otherwise. */ -static bool +bool virDomainSCSIDriveAddressIsUsed(const virDomainDef *def, const virDomainDeviceDriveAddress *addr) { Index: libvirt-5.2.0/src/conf/domain_conf.h =================================================================== --- libvirt-5.2.0.orig/src/conf/domain_conf.h +++ libvirt-5.2.0/src/conf/domain_conf.h @@ -2697,6 +2697,10 @@ virDomainXMLNamespacePtr virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) ATTRIBUTE_NONNULL(1); +bool +virDomainSCSIDriveAddressIsUsed(const virDomainDef *def, + const virDomainDeviceDriveAddress *addr); + int virDomainDefPostParse(virDomainDefPtr def, virCapsPtr caps, unsigned int parseFlags, Index: libvirt-5.2.0/src/libvirt_private.syms =================================================================== --- libvirt-5.2.0.orig/src/libvirt_private.syms +++ libvirt-5.2.0/src/libvirt_private.syms @@ -534,6 +534,7 @@ virDomainRunningReasonTypeToString; virDomainSaveConfig; virDomainSaveStatus; virDomainSaveXML; +virDomainSCSIDriveAddressIsUsed; virDomainSeclabelTypeFromString; virDomainSeclabelTypeToString; virDomainShmemDefEquals; ++++++ ddc72f99-qemu-check-dup-drive-address.patch ++++++ commit ddc72f99027b063feaf34e5fda89916b6b2c8943 Author: Michal Privoznik <[email protected]> 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 <[email protected]> Tested-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Jim Fehlig <[email protected]> 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. ++++++ ee2c5ef3-test-scsi-disk.patch ++++++ commit ee2c5ef39fd91345893904433c6f458685543af5 Author: Michal Privoznik <[email protected]> Date: Thu Apr 11 16:23:38 2019 +0200 qemuhotplugtest: Don't plug a SCSI disk at unit 7 Unit number 7 is kind of special. It's reserved for SCSI controller. The comment in virDomainSCSIDriveAddressIsUsed() summarizes that pretty nicely. Libvirt would never generate such address. Signed-off-by: Michal Privoznik <[email protected]> Tested-by: Daniel Henrique Barboza <[email protected]> Reviewed-by: Jim Fehlig <[email protected]> Index: libvirt-5.2.0/tests/qemuhotplugtest.c =================================================================== --- libvirt-5.2.0.orig/tests/qemuhotplugtest.c +++ libvirt-5.2.0/tests/qemuhotplugtest.c @@ -715,7 +715,7 @@ mymain(void) "device_del", QMP_OK, "human-monitor-command", HMP("")); DO_TEST_DETACH("base-with-scsi-controller-live", "disk-scsi-2", false, false, - "device_del", QMP_DEVICE_DELETED("scsi3-0-5-7") QMP_OK, + "device_del", QMP_DEVICE_DELETED("scsi3-0-5-6") QMP_OK, "human-monitor-command", HMP("")); DO_TEST_ATTACH("base-live", "qemu-agent", false, true, Index: libvirt-5.2.0/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml =================================================================== --- libvirt-5.2.0.orig/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml +++ libvirt-5.2.0/tests/qemuhotplugtestdevices/qemuhotplug-disk-scsi-2.xml @@ -2,7 +2,7 @@ <driver name='qemu' type='raw' cache='none'/> <source file='/dev/null'/> <target dev='sdf' bus='scsi'/> - <address type='drive' controller='3' bus='0' target='5' unit='7'/> + <address type='drive' controller='3' bus='0' target='5' unit='6'/> <readonly/> <shareable/> </disk> Index: libvirt-5.2.0/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml =================================================================== --- libvirt-5.2.0.orig/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml +++ libvirt-5.2.0/tests/qemuhotplugtestdomains/qemuhotplug-base-without-scsi-controller-live+disk-scsi-2.xml @@ -26,8 +26,8 @@ <target dev='sdf' bus='scsi'/> <readonly/> <shareable/> - <alias name='scsi3-0-5-7'/> - <address type='drive' controller='3' bus='0' target='5' unit='7'/> + <alias name='scsi3-0-5-6'/> + <address type='drive' controller='3' bus='0' target='5' unit='6'/> </disk> <controller type='usb' index='0'> <alias name='usb'/>
