diff --git a/2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch b/2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch new file mode 100644 index 00000000..3af93ed6 --- /dev/null +++ b/2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch @@ -0,0 +1,43 @@ +Subject: addhardware: Correctly calculate virtio-scsi controller index +From: Lin Ma lma@suse.com Mon Nov 6 20:52:07 2017 +0800 +Date: Wed Nov 22 16:50:33 2017 -0500: +Git: 2eb455c97f1afda33a4b1c87adb2721fac9d9b5f + +Because sata, usb and scsi use same device prefix: sd*, They will be +included into occupied list while we add virtio-scsi disks, This is +wrong and may cause adding additional virtio-scsi controller. + +How to reproduce: +1. fresh install a qemu guest. +2. add 6 virtual USB disks. +3. add disk A on scsi bus. + (then a virtio-scsi controller 0 will be added automatically) +4. add disk B on scsi bus. +5. observe. + +Expected: +disk A and disk B should be connected to virtio-scsi controller 0 because +controller 0 has enough available slots. + +Actual: +disk A was connected to virtio-scsi controller 0. +An additional virtio-scsi controller 1 was added and disk B was connected +to it because virt-manager thought the virtio-scsi controller 0 doesn't +have available slot. + +Signed-off-by: Lin Ma + +diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py +index 4a962e6..e563fe6 100644 +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -1456,7 +1456,8 @@ class vmmAddHardware(vmmGObjectUI): + # Save occupied places per controller + occupied = {} + for d in used_disks: +- if d.get_target_prefix() == disk.get_target_prefix(): ++ if (d.get_target_prefix() == disk.get_target_prefix() and ++ d.bus == "scsi"): + num = virtinst.VirtualDisk.target_to_num(d.target) + idx = num // 7 + if idx not in occupied: diff --git a/7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch b/7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch new file mode 100644 index 00000000..dce5ff8a --- /dev/null +++ b/7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch @@ -0,0 +1,43 @@ +Subject: addhardware: Fix virtio-scsi controller target calculation +From: Cole Robinson crobinso@redhat.com Wed Nov 22 14:58:12 2017 -0500 +Date: Wed Nov 22 16:50:33 2017 -0500: +Git: 7fc7e94f211676b9a958662cb93edf770f23273c + +More details here: https://www.redhat.com/archives/virt-tools-list/2017-November/msg00014.html + +Reported-by: Lin Ma + +diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py +index cd82cd3..4a962e6 100644 +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -20,7 +20,6 @@ + + import logging + import traceback +-import collections + + from gi.repository import Gtk + from gi.repository import Gdk +@@ -1455,13 +1454,18 @@ class vmmAddHardware(vmmGObjectUI): + if x.model == controller_model] + + # Save occupied places per controller +- occupied = collections.defaultdict(int) ++ occupied = {} + for d in used_disks: + if d.get_target_prefix() == disk.get_target_prefix(): + num = virtinst.VirtualDisk.target_to_num(d.target) +- occupied[num / 7] += 1 ++ idx = num // 7 ++ if idx not in occupied: ++ occupied[idx] = [] ++ if d.target not in occupied[idx]: ++ occupied[idx].append(d.target) ++ + for c in ctrls_scsi: +- if occupied[c.index] < 7: ++ if c.index not in occupied or len(occupied[c.index]) < 7: + controller = c + break + else: diff --git a/b9bc3b60-undefine-only-persistent-domain.patch b/b9bc3b60-undefine-only-persistent-domain.patch new file mode 100644 index 00000000..b097b68b --- /dev/null +++ b/b9bc3b60-undefine-only-persistent-domain.patch @@ -0,0 +1,47 @@ +Subject: delete: undefine only persistent domain +From: Pavel Hrdina phrdina@redhat.com Fri Nov 24 17:26:59 2017 +0100 +Date: Fri Nov 24 17:39:58 2017 +0100: +Git: b9bc3b605a96920d3e225d472d549864205e92ce + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1517119 + +Signed-off-by: Pavel Hrdina + +diff --git a/virtManager/delete.py b/virtManager/delete.py +index 98df413..0ebfdeb 100644 +--- a/virtManager/delete.py ++++ b/virtManager/delete.py +@@ -162,6 +162,7 @@ class vmmDeleteDialog(vmmGObjectUI): + def _async_delete(self, asyncjob, paths): + storage_errors = [] + details = "" ++ undefine = self.vm.is_persistent() + + try: + if self.vm.is_active(): +@@ -181,8 +182,9 @@ class vmmDeleteDialog(vmmGObjectUI): + "".join(traceback.format_exc()))) + meter.end(0) + +- logging.debug("Removing VM '%s'", self.vm.get_name()) +- self.vm.delete() ++ if undefine: ++ logging.debug("Removing VM '%s'", self.vm.get_name()) ++ self.vm.delete() + + except Exception as e: + error = (_("Error deleting virtual machine '%s': %s") % +diff --git a/virtManager/domain.py b/virtManager/domain.py +index a1f59e3..183a56c 100644 +--- a/virtManager/domain.py ++++ b/virtManager/domain.py +@@ -484,6 +484,9 @@ class vmmDomain(vmmLibvirtObject): + return bool(self.get_xmlobj().os.loader_ro is True and + self.get_xmlobj().os.loader_type == "pflash") + ++ def is_persistent(self): ++ return bool(self._backend.isPersistent()) ++ + ################## + # Support checks # + ################## diff --git a/f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch b/f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch new file mode 100644 index 00000000..fef84a46 --- /dev/null +++ b/f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch @@ -0,0 +1,20 @@ +Subject: virtinst: Fix _URLFetcher for reading files +From: Andrew Wong andrew.kw.w@gmail.com Wed Nov 8 01:23:28 2017 -0500 +Date: Wed Nov 22 17:26:31 2017 -0500: +Git: f836e47b7053ce8cd83c66728acfb9b0f821bcac + +_grabber() is used for both binary and text files. + +diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py +index 5dae424c..1288668a 100644 +--- a/virtinst/urlfetcher.py ++++ b/virtinst/urlfetcher.py +@@ -169,7 +169,7 @@ class _URLFetcher(object): + """ + Grab the passed filename from self.location and return it as a string + """ +- fileobj = io.StringIO() ++ fileobj = io.BytesIO() + self._grabURL(filename, fileobj) + return fileobj.getvalue() + diff --git a/virt-manager.changes b/virt-manager.changes index 725fb400..45b74161 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Tue Nov 28 08:24:39 MST 2017 - carnold@suse.com + +- Upstream bug fixes (bsc#1027942) + b9bc3b60-undefine-only-persistent-domain.patch + 7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch + 2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch + +------------------------------------------------------------------- +Fri Nov 24 09:48:19 MST 2017 - carnold@suse.com + +- bsc#1067263 - virt-install: ERROR unicode argument expected, got + 'str' + f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch +- Drop virtinst-fix-replace-StringIO-with-io.patch + ------------------------------------------------------------------- Wed Nov 8 13:59:11 MST 2017 - carnold@suse.com diff --git a/virt-manager.spec b/virt-manager.spec index ce7cb7af..ff69bdcf 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -69,6 +69,10 @@ Patch28: 374a3779-urlfetcher-write-test-file-as-binary-content.patch Patch29: f7c8cf9f-devicepanic-dont-return-empty-model-list.patch Patch30: 3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch Patch31: 73de8285-systray-remove-redundant-variable-assignment.patch +Patch32: b9bc3b60-undefine-only-persistent-domain.patch +Patch33: 7fc7e94f-fix-virtio-scsi-controller-target-calculation.patch +Patch34: 2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch +Patch35: f836e47b-virtinst-Fix-URLFetcher-for-reading-files.patch # SUSE Only Patch70: virtman-desktop.patch Patch71: virtman-kvm.patch @@ -111,7 +115,6 @@ Patch166: virtinst-check-date-format.patch Patch167: virtinst-no-usb-tablet-for-xenpv.patch Patch168: virtinst-add-sle15-detection-support.patch Patch169: virtinst-keep-install-iso-attached.patch -Patch170: virtinst-fix-replace-StringIO-with-io.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -226,6 +229,10 @@ machine). %patch29 -p1 %patch30 -p1 %patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 # SUSE Only %patch70 -p1 %patch71 -p1 @@ -268,7 +275,6 @@ machine). %patch167 -p1 %patch168 -p1 %patch169 -p1 -%patch170 -p1 %build %if %{qemu_user} diff --git a/virtinst-fix-replace-StringIO-with-io.patch b/virtinst-fix-replace-StringIO-with-io.patch deleted file mode 100644 index 7e2e2608..00000000 --- a/virtinst-fix-replace-StringIO-with-io.patch +++ /dev/null @@ -1,26 +0,0 @@ -Commit 75210ed37c0c5de569de73e04488808a2521a011 changed the file -object type such that the write method requires a unicode value -instead of a string. This is a follow-up patch to that commmit. - -Index: virt-manager-1.4.3/virtinst/urlfetcher.py -=================================================================== ---- virt-manager-1.4.3.orig/virtinst/urlfetcher.py -+++ virt-manager-1.4.3/virtinst/urlfetcher.py -@@ -105,6 +105,8 @@ class _URLFetcher(object): - buff = urlobj.read(self._block_size) - if not buff: - break -+ if isinstance(fileobj, io.StringIO) and type(buff) is str: -+ buff = unicode(buff) - fileobj.write(buff) - total += len(buff) - self.meter.update(total) -@@ -207,6 +209,8 @@ class _HTTPURLFetcher(_URLFetcher): - """ - total = 0 - for data in urlobj.iter_content(chunk_size=self._block_size): -+ if isinstance(fileobj, io.StringIO) and type(data) is str: -+ data = unicode(data) - fileobj.write(data) - total += len(data) - self.meter.update(total) diff --git a/virtman-dont-allow-grub.xen-to-be-deleted.patch b/virtman-dont-allow-grub.xen-to-be-deleted.patch index 9097fc72..ecf486be 100644 --- a/virtman-dont-allow-grub.xen-to-be-deleted.patch +++ b/virtman-dont-allow-grub.xen-to-be-deleted.patch @@ -1,11 +1,11 @@ Reference: bnc#885094 grub.xen is required to boot Xen PV VMs using BTRFS. It belongs to the grub2-x86_64-xen RPM and should never be deleted. -Index: virt-manager-1.4.2/virtManager/delete.py +Index: virt-manager-1.4.3/virtManager/delete.py =================================================================== ---- virt-manager-1.4.2.orig/virtManager/delete.py -+++ virt-manager-1.4.2/virtManager/delete.py -@@ -239,7 +239,7 @@ def populate_storage_list(storage_list, +--- virt-manager-1.4.3.orig/virtManager/delete.py ++++ virt-manager-1.4.3/virtManager/delete.py +@@ -241,7 +241,7 @@ def populate_storage_list(storage_list, diskdata.append(("dtb", vm.get_xmlobj().os.dtb, True, False, True)) for target, path, ro, shared, is_media in diskdata: