diff --git a/67832d30-addhardware-Fix-backtrace-when-controller-index-is-None.patch b/67832d30-addhardware-Fix-backtrace-when-controller-index-is-None.patch new file mode 100644 index 00000000..d21f5982 --- /dev/null +++ b/67832d30-addhardware-Fix-backtrace-when-controller-index-is-None.patch @@ -0,0 +1,26 @@ +Subject: addhardware: Fix backtrace when controller.index is None +From: Cole Robinson crobinso@redhat.com Tue Dec 13 13:49:35 2022 -0500 +Date: Tue Dec 13 13:49:35 2022 -0500: +Git: 67832d3097cd6451833c30452d6991896e05933c + +When creating a new VM, in the customize wizard we can't depend on +index= value being set (virtinst doesn't do it for example). + +For example, this causes a backtrace when adding two virtio-scsi +controllers via the Customize wizard, or adding an extra +virtio-scsi controller to an aarch64 CDROM install. + +Reported-by: Charles Arnold +Signed-off-by: Cole Robinson + +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -1560,7 +1560,7 @@ class vmmAddHardware(vmmGObjectUI): + controller_num = [x for x in controllers if + (x.type == controller_type)] + if len(controller_num) > 0: +- index_new = max([x.index for x in controller_num]) + 1 ++ index_new = max(int(x.index or 0) for x in controller_num) + 1 + dev.index = index_new + + dev.type = controller_type diff --git a/virt-manager.changes b/virt-manager.changes index cfc050f4..5c06916e 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Fri Jan 20 11:20:21 MST 2023 - carnold@suse.com + +- bsc#1207070 - libvirt fails to start the guest once the new + shared disk is added, with the error, "cannot get 'write' + permission without 'resize' image size is not a multiple of + request alignment" + virtman-fix-shared-disk-request-alignment-error.patch + +------------------------------------------------------------------- +Thu Jan 5 10:45:46 MST 2023 - carnold@suse.com + +- Replace downstream patch with upstream version (bsc#1203252) + 67832d30-addhardware-Fix-backtrace-when-controller-index-is-None.patch + Drop virtman-fix-uninitialized-controller-index.patch + ------------------------------------------------------------------- Mon Nov 28 12:28:44 MST 2022 - carnold@suse.com diff --git a/virt-manager.spec b/virt-manager.spec index 7f1820f5..504c283f 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -51,6 +51,7 @@ Patch7: c22a876e-tests-Add-a-compat-check-for-linux2020-in-amd-sev-test- Patch8: fbdf0516-cli-cpu-Add-maxphysaddr.mode-bits-options.patch Patch9: b0d05167-cloner-Sync-uuid-and-sysinfo-system-uuid.patch Patch10: 999ccb85-virt-install-unattended-and-cloud-init-conflict.patch +Patch11: 67832d30-addhardware-Fix-backtrace-when-controller-index-is-None.patch # SUSE Only Patch70: virtman-desktop.patch Patch71: virtman-kvm.patch @@ -84,7 +85,6 @@ Patch157: virtman-fix-restore-vm-menu-selection.patch Patch158: virtman-disallow-adding-floppy-disk.patch Patch159: virtman-register-delete-event-for-details-dialog.patch Patch160: virtman-revert-use-of-AyatanaAppIndicator3.patch -Patch161: virtman-fix-uninitialized-controller-index.patch Patch170: virtinst-xen-drive-type.patch Patch171: virtinst-xenbus-disk-index-fix.patch Patch172: virtinst-refresh_before_fetch_pool.patch @@ -100,6 +100,7 @@ Patch181: virtinst-add-slem-detection-support.patch Patch182: virtinst-add-sle-hpc-support.patch Patch183: virtinst-add-oracle-linux-support.patch Patch184: virtinst-windows-server-detection.patch +Patch185: virtman-fix-shared-disk-request-alignment-error.patch BuildArch: noarch diff --git a/virtman-fix-shared-disk-request-alignment-error.patch b/virtman-fix-shared-disk-request-alignment-error.patch new file mode 100644 index 00000000..0b53c51c --- /dev/null +++ b/virtman-fix-shared-disk-request-alignment-error.patch @@ -0,0 +1,45 @@ +References: bsc#1207070 + +When creating a raw disk that is marked as 'shared', libvirt +will round the allocation amount higher to a 4k boundary. +This results in the qemu error shown below passed back to libvirt. +Note that only raw disks can be marked shared (not qcow2) +but the rounding should not harm qcow2 disks. + +libvirt.libvirtError: internal error: qemu unexpectedly closed the monitor: 2023-01-19T21:40:28.507063Z qemu-system-x86_64: +-device {"driver":"virtio-blk-pci","bus":"pci.8","addr":"0x0","share-rw":true,"drive":"libvirt-1-format","id":"virtio-disk1","write-cache":"on"}: +Cannot get 'write' permission without 'resize': Image size is not a multiple of request alignment + + +Index: virt-manager-4.1.0/virtManager/createvol.py +=================================================================== +--- virt-manager-4.1.0.orig/virtManager/createvol.py ++++ virt-manager-4.1.0/virtManager/createvol.py +@@ -246,7 +246,13 @@ class vmmCreateVolume(vmmGObjectUI): + vol = self._make_stub_vol() + vol.name = volname + vol.capacity = (cap * 1024 * 1024 * 1024) ++ if vol.capacity: ++ # If a raw disk is marked 'shared', round up for libvirt ++ vol.capacity -= vol.capacity % -4096 + vol.allocation = (alloc * 1024 * 1024 * 1024) ++ if vol.allocation: ++ vol.allocation -= vol.allocation % -4096 ++ + if backing: + vol.backing_store = backing + if fmt: +Index: virt-manager-4.1.0/virtinst/devices/disk.py +=================================================================== +--- virt-manager-4.1.0.orig/virtinst/devices/disk.py ++++ virt-manager-4.1.0/virtinst/devices/disk.py +@@ -361,6 +361,9 @@ class DeviceDisk(Device): + volname, poolobj.name()) + + cap = (size * 1024 * 1024 * 1024) ++ if cap: ++ # If a raw disk is marked 'shared', round up for libvirt ++ cap -= cap % -4096 + if sparse: + alloc = 0 + else: diff --git a/virtman-fix-uninitialized-controller-index.patch b/virtman-fix-uninitialized-controller-index.patch deleted file mode 100644 index ddb0292d..00000000 --- a/virtman-fix-uninitialized-controller-index.patch +++ /dev/null @@ -1,13 +0,0 @@ -References: bsc#1203252 - ---- virt-manager-4.1.0/virtManager/addhardware.py.orig 2022-11-15 07:49:08.318413181 -0700 -+++ virt-manager-4.1.0/virtManager/addhardware.py 2022-11-15 07:49:48.126414130 -0700 -@@ -1570,6 +1570,8 @@ class vmmAddHardware(vmmGObjectUI): - if len(controller_num) > 0: - index_new = max([x.index for x in controller_num]) + 1 - dev.index = index_new -+ else: -+ dev.index = 0 - - dev.type = controller_type -