From 0c9d9001970f99d26d09c998a177213d6ed85afe Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Mon, 28 Sep 2020 15:36:40 +0000 Subject: [PATCH] - Upstream bug fixes (bsc#1027942) ba08f84b-addstorage-Return-to-using-qcow2-sparse-by-default.patch a010c49b-cli-Fix-os-variant-help-introspection.patch 79ebcbcb-viewers-Fix-spice-audio.patch e5a51f63-details-Change-Close-accelerator-to-ctrl+shift+w.patch 9c13d2f8-Remove-use-of-problematic-terminology.patch - jsc#SLE-16582, Upgrade virt-manager >= 3.x OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=511 --- 79ebcbcb-viewers-Fix-spice-audio.patch | 50 ++++ ...emove-use-of-problematic-terminology.patch | 226 ++++++++++++++++++ ...li-Fix-os-variant-help-introspection.patch | 20 ++ ...urn-to-using-qcow2-sparse-by-default.patch | 86 +++++++ ...ge-Close-accelerator-to-ctrl+shift+w.patch | 104 ++++++++ virt-manager.changes | 12 +- virt-manager.spec | 10 + 7 files changed, 507 insertions(+), 1 deletion(-) create mode 100644 79ebcbcb-viewers-Fix-spice-audio.patch create mode 100644 9c13d2f8-Remove-use-of-problematic-terminology.patch create mode 100644 a010c49b-cli-Fix-os-variant-help-introspection.patch create mode 100644 ba08f84b-addstorage-Return-to-using-qcow2-sparse-by-default.patch create mode 100644 e5a51f63-details-Change-Close-accelerator-to-ctrl+shift+w.patch diff --git a/79ebcbcb-viewers-Fix-spice-audio.patch b/79ebcbcb-viewers-Fix-spice-audio.patch new file mode 100644 index 00000000..9cfd3846 --- /dev/null +++ b/79ebcbcb-viewers-Fix-spice-audio.patch @@ -0,0 +1,50 @@ +Subject: viewers: Fix spice audio +From: Cole Robinson crobinso@redhat.com Mon Sep 21 11:35:51 2020 -0400 +Date: Mon Sep 21 11:35:51 2020 -0400: +Git: 79ebcbcb71d77548443b7943d65bacb216c93769 + +Commit 1689ebb25 removed what I thought was an unused audio +handle in the spice viewer code, but apparently it does +something. Strangely some VMs work fine (linux, windows 7), +but my windows 10 VMs need this to actually get audio. +No clue what that's all about + +https://bugzilla.redhat.com/show_bug.cgi?id=1881080 + +Signed-off-by: Cole Robinson + +diff --git a/virtManager/details/viewers.py b/virtManager/details/viewers.py +index 46ff1431..da9f906d 100644 +--- a/virtManager/details/viewers.py ++++ b/virtManager/details/viewers.py +@@ -476,6 +476,7 @@ class SpiceViewer(Viewer): + Viewer.__init__(self, *args, **kwargs) + self._spice_session = None + self._display = None ++ self._audio = None + self._main_channel = None + self._display_channel = None + self._usbdev_manager = None +@@ -618,6 +619,14 @@ class SpiceViewer(Viewer): + self._init_widget() + self.emit("connected") + ++ elif (type(channel) in [SpiceClientGLib.PlaybackChannel, ++ SpiceClientGLib.RecordChannel] and ++ not self._audio): ++ # It's unclear why we need this audio handle, but it ++ # does matter: ++ # https://bugzilla.redhat.com/show_bug.cgi?id=1881080 ++ self._audio = SpiceClientGLib.Audio.get(self._spice_session, None) ++ + def _agent_connected_cb(self, src, val): + self.emit("agent-connected") # pragma: no cover + +@@ -631,6 +640,7 @@ class SpiceViewer(Viewer): + _SIGS.disconnect_obj_signals(self._spice_session) + self._spice_session.disconnect() + self._spice_session = None ++ self._audio = None + if self._display: + self._display.destroy() + self._display = None diff --git a/9c13d2f8-Remove-use-of-problematic-terminology.patch b/9c13d2f8-Remove-use-of-problematic-terminology.patch new file mode 100644 index 00000000..d2d21418 --- /dev/null +++ b/9c13d2f8-Remove-use-of-problematic-terminology.patch @@ -0,0 +1,226 @@ +Subject: Remove use of problematic terminology +From: Cole Robinson crobinso@redhat.com Wed Sep 23 14:33:17 2020 -0400 +Date: Wed Sep 23 14:33:17 2020 -0400: +Git: 9c13d2f8788414f1ab5b0300ce82b5d9ce277880 + +Following kernel recommendation here: +https://lkml.org/lkml/2020/7/4/229 + +Signed-off-by: Cole Robinson + +Index: virt-manager-3.0.0/man/virt-install.rst +=================================================================== +--- virt-manager-3.0.0.orig/man/virt-install.rst ++++ virt-manager-3.0.0/man/virt-install.rst +@@ -1247,7 +1247,7 @@ Connect the guest to the host network. E + Tell virt-install not to add any default network interface. + + If ``--network`` is omitted a single NIC will be created in the guest. If +-there is a bridge device in the host with a physical interface enslaved, ++there is a bridge device in the host with a physical interface attached, + that will be used for connectivity. Failing that, the virtual network + called ``default`` will be used. This option can be specified multiple + times to setup more than one NIC. +Index: virt-manager-3.0.0/tests/uitests/test_addhardware.py +=================================================================== +--- virt-manager-3.0.0.orig/tests/uitests/test_addhardware.py ++++ virt-manager-3.0.0/tests/uitests/test_addhardware.py +@@ -310,7 +310,7 @@ class AddHardware(lib.testcase.UITestCas + self.app.open(break_setfacl=True) + details = self.app.open_details_window("test-clone-simple") + +- # Say 'Yes' and it should fail, then blacklist the paths ++ # Say 'Yes' and it should fail, then denylist the paths + addhw = self._open_addhw_window(details) + tab = self._select_hw(addhw, "Storage", "storage-tab") + tab.find_fuzzy("Select or create", "radio").click() +Index: virt-manager-3.0.0/tests/uitests/test_connection.py +=================================================================== +--- virt-manager-3.0.0.orig/tests/uitests/test_connection.py ++++ virt-manager-3.0.0/tests/uitests/test_connection.py +@@ -15,7 +15,7 @@ class UITestConnection(lib.testcase.UITe + + def testConnectionBlacklist(self): + self.app.open( +- extra_opts=["--test-options=object-blacklist=test-many-devices"]) ++ extra_opts=["--test-options=object-denylist=test-many-devices"]) + manager = self.app.topwin + + def _delete_vm(vmname): +Index: virt-manager-3.0.0/virtManager/connection.py +=================================================================== +--- virt-manager-3.0.0.orig/virtManager/connection.py ++++ virt-manager-3.0.0/virtManager/connection.py +@@ -38,46 +38,46 @@ class _ObjectList(vmmGObject): + vmmGObject.__init__(self) + + self._objects = [] +- self._blacklist = {} ++ self._denylist = {} + self._lock = threading.Lock() + + def _cleanup(self): + self._objects = [] + +- def _blacklist_key(self, obj): ++ def _denylist_key(self, obj): + return str(obj.__class__) + obj.get_name() + +- def add_blacklist(self, obj): ++ def add_denylist(self, obj): + """ +- Add an object to the blacklist. Basically a list of objects we ++ Add an object to the denylist. Basically a list of objects we + choose not to poll, because they threw an error at init time + +- :param obj: vmmLibvirtObject to blacklist ++ :param obj: vmmLibvirtObject to denylist + :returns: number of added object to list + """ +- key = self._blacklist_key(obj) +- count = self._blacklist.get(key, 0) +- self._blacklist[key] = count + 1 +- return self._blacklist[key] ++ key = self._denylist_key(obj) ++ count = self._denylist.get(key, 0) ++ self._denylist[key] = count + 1 ++ return self._denylist[key] + +- def remove_blacklist(self, obj): ++ def remove_denylist(self, obj): + """ +- :param obj: vmmLibvirtObject to remove from blacklist +- :returns: True if object was blacklisted or False otherwise. ++ :param obj: vmmLibvirtObject to remove from denylist ++ :returns: True if object was denylisted or False otherwise. + """ +- key = self._blacklist_key(obj) +- return bool(self._blacklist.pop(key, 0)) ++ key = self._denylist_key(obj) ++ return bool(self._denylist.pop(key, 0)) + +- def in_blacklist(self, obj): ++ def in_denylist(self, obj): + """ +- If an object is in list only once don't consider it blacklisted, ++ If an object is in list only once don't consider it denylisted, + give it one more chance. + + :param obj: vmmLibvirtObject to check +- :returns: True if object is blacklisted ++ :returns: True if object is denylisted + """ +- key = self._blacklist_key(obj) +- return self._blacklist.get(key, 0) >= _ObjectList.BLACKLIST_COUNT ++ key = self._denylist_key(obj) ++ return self._denylist.get(key, 0) >= _ObjectList.BLACKLIST_COUNT + + def remove(self, obj): + """ +@@ -90,7 +90,7 @@ class _ObjectList(vmmGObject): + # Identity check is sufficient here, since we should never be + # asked to remove an object that wasn't at one point in the list. + if obj not in self._objects: +- return self.remove_blacklist(obj) ++ return self.remove_denylist(obj) + + self._objects.remove(obj) + return True +@@ -1060,11 +1060,11 @@ class vmmConnection(vmmGObject): + + if initialize_failed: + log.debug("Blacklisting %s=%s", class_name, obj.get_name()) +- count = self._objects.add_blacklist(obj) +- log.debug("Object added in blacklist, count=%d", count) ++ count = self._objects.add_denylist(obj) ++ log.debug("Object added in denylist, count=%d", count) + return + +- self._objects.remove_blacklist(obj) ++ self._objects.remove_denylist(obj) + if not self._objects.add(obj): + log.debug("New %s=%s requested, but it's already tracked.", + class_name, obj.get_name()) +@@ -1134,7 +1134,7 @@ class vmmConnection(vmmGObject): + + gone_objects.extend(gone) + preexisting_objects.extend([o for o in master if o not in new]) +- new = [n for n in new if not self._objects.in_blacklist(n)] ++ new = [n for n in new if not self._objects.in_denylist(n)] + return new + + new_vms = _process_objects("vms") +Index: virt-manager-3.0.0/virtManager/lib/testmock.py +=================================================================== +--- virt-manager-3.0.0.orig/virtManager/lib/testmock.py ++++ virt-manager-3.0.0/virtManager/lib/testmock.py +@@ -157,7 +157,7 @@ class CLITestOptionsClass: + Spice doesn't return values here when we are just testing + against seabios in uitests, this fakes it to hit more code paths + * fake-systray: Enable the fake systray window +- * object-blacklist=NAME: Make object initialize for that name ++ * object-denylist=NAME: Make object initialize for that name + fail to test some connection code paths + * conn-crash: Test connection abruptly closing like when + libvirtd is restarted. +@@ -205,7 +205,7 @@ class CLITestOptionsClass: + self.fake_vnc_username = _get("fake-vnc-username") + self.fake_console_resolution = _get("fake-console-resolution") + self.fake_systray = _get("fake-systray") +- self.object_blacklist = _get_value("object-blacklist") ++ self.object_denylist = _get_value("object-denylist") + self.conn_crash = _get("conn-crash") + self.fake_agent_event = _get_value("fake-agent-event") + self.fake_nodedev_event = _get_value("fake-nodedev-event") +Index: virt-manager-3.0.0/virtManager/object/domain.py +=================================================================== +--- virt-manager-3.0.0.orig/virtManager/object/domain.py ++++ virt-manager-3.0.0/virtManager/object/domain.py +@@ -393,7 +393,7 @@ class vmmDomain(vmmLibvirtObject): + self.get_uuid() == "00000000-0000-0000-0000-000000000000"): + # We don't want virt-manager to track Domain-0 since it + # doesn't work with our UI. Raising an error will ensures it +- # is blacklisted. ++ # is denylisted. + raise RuntimeError( # pragma: no cover + "Can't track Domain-0 as a vmmDomain") + +Index: virt-manager-3.0.0/virtManager/object/libvirtobject.py +=================================================================== +--- virt-manager-3.0.0.orig/virtManager/object/libvirtobject.py ++++ virt-manager-3.0.0/virtManager/object/libvirtobject.py +@@ -171,7 +171,7 @@ class vmmLibvirtObject(vmmGObject): + + initialize_failed = False + try: +- if self.config.CLITestOptions.object_blacklist == self._name: ++ if self.config.CLITestOptions.object_denylist == self._name: + raise RuntimeError("fake initialization error") + + self._init_libvirt_state() +Index: virt-manager-3.0.0/virtinst/devices/graphics.py +=================================================================== +--- virt-manager-3.0.0.orig/virtinst/devices/graphics.py ++++ virt-manager-3.0.0/virtinst/devices/graphics.py +@@ -151,7 +151,7 @@ class DeviceGraphics(Device): + def _spice_supported(self): + if not self.conn.is_qemu() and not self.conn.is_test(): + return False +- # Spice has issues on some host arches, like ppc, so whitelist it ++ # Spice has issues on some host arches, like ppc, so allow it + if self.conn.caps.host.cpu.arch not in ["i686", "x86_64"]: + return False + return True +Index: virt-manager-3.0.0/virtinst/devices/interface.py +=================================================================== +--- virt-manager-3.0.0.orig/virtinst/devices/interface.py ++++ virt-manager-3.0.0/virtinst/devices/interface.py +@@ -72,7 +72,7 @@ def _host_default_bridge(): + return dev # pragma: no cover + + # Old style, peth0 == phys dev, eth0 == netloop, xenbr0 == bridge, +- # vif0.0 == netloop enslaved, eth0 == default route ++ # vif0.0 == netloop attached, eth0 == default route + try: + defn = int(dev[-1]) + except Exception: # pragma: no cover diff --git a/a010c49b-cli-Fix-os-variant-help-introspection.patch b/a010c49b-cli-Fix-os-variant-help-introspection.patch new file mode 100644 index 00000000..78e8f673 --- /dev/null +++ b/a010c49b-cli-Fix-os-variant-help-introspection.patch @@ -0,0 +1,20 @@ +Subject: cli: Fix --os-variant=help introspection +From: Cole Robinson crobinso@redhat.com Sun Sep 20 16:00:33 2020 -0400 +Date: Sun Sep 20 16:00:46 2020 -0400: +Git: a010c49b8b3c0ecca5ec99d962b2b98f25694a37 + +Signed-off-by: Cole Robinson + +Index: virt-manager-3.0.0/virtinst/cli.py +=================================================================== +--- virt-manager-3.0.0.orig/virtinst/cli.py ++++ virt-manager-3.0.0/virtinst/cli.py +@@ -1830,7 +1830,7 @@ class OSVariantData(object): + + + class ParserOSVariant(VirtCLIParser): +- cli_arg_name = "os-variant" ++ cli_arg_name = "os_variant" + supports_clearxml = False + + @classmethod diff --git a/ba08f84b-addstorage-Return-to-using-qcow2-sparse-by-default.patch b/ba08f84b-addstorage-Return-to-using-qcow2-sparse-by-default.patch new file mode 100644 index 00000000..bdd3304e --- /dev/null +++ b/ba08f84b-addstorage-Return-to-using-qcow2-sparse-by-default.patch @@ -0,0 +1,86 @@ +Subject: addstorage: Return to using qcow2 sparse by default +From: Cole Robinson crobinso@redhat.com Sat Sep 19 18:06:45 2020 -0400 +Date: Sun Sep 20 10:11:36 2020 -0400: +Git: ba08f84b3408744e9aa9763d100e8aa217c1f5ff + +https://bugzilla.redhat.com/show_bug.cgi?id=1759454 + +See 15a6a7e2105440df528f75c4df4d2471df28bd1e + +The idea behind virt-manager's sparse vs nonsparse default, is that if +the user selected 'raw' for as the default image format, assume they +want to maximize performance, so fully allocate the disk. + +qcow2 didn't support anything except sparse, so the sparse=True vs +sparse=False made no difference. So we always set sparse=False + +Then qcow2 grows non-sparse support, and virt-manager is suddenly +defaulting to it, which is not the intention. + +Default to sparse when requested format isn't raw + +Signed-off-by: Cole Robinson + +Index: virt-manager-3.0.0/tests/uitests/test_addhardware.py +=================================================================== +--- virt-manager-3.0.0.orig/tests/uitests/test_addhardware.py ++++ virt-manager-3.0.0/tests/uitests/test_addhardware.py +@@ -152,11 +152,8 @@ class AddHardware(lib.testcase.UITestCas + tab.combo_select("Cache mode:", "none") + tab.combo_select("Discard mode:", "ignore") + tab.combo_select("Detect zeroes:", "unmap") +- # Size too big +- tab.find("GiB", "spin button").set_text("2000") +- self._finish(addhw, check=None) +- self.app.click_alert_button("not enough free space", "Close") +- tab.find("GiB", "spin button").set_text("1.5") ++ # High number but we are non-sparse by default so it won't complain ++ tab.find("GiB", "spin button").set_text("200000") + self._finish(addhw, check=details) + + # USB disk with removable setting +Index: virt-manager-3.0.0/tests/uitests/test_createvm.py +=================================================================== +--- virt-manager-3.0.0.orig/tests/uitests/test_createvm.py ++++ virt-manager-3.0.0/tests/uitests/test_createvm.py +@@ -201,12 +201,11 @@ class NewVM(lib.testcase.UITestCase): + self.forward(newvm) + self.forward(newvm) + +- # Trigger size validation failure ++ # qcow2 default shouldn't trigger size error + sizetext = newvm.find(None, "spin button", "GiB") + sizetext.set_text("10000000") +- self.forward(newvm, check=False) +- self.app.click_alert_button("Storage parameter error", "OK") +- sizetext.set_text("1") ++ _forward(newvm) ++ _back(newvm) + + # Use the storage browser to select a local file + storagetext = newvm.find("storage-entry") +Index: virt-manager-3.0.0/virtManager/device/addstorage.py +=================================================================== +--- virt-manager-3.0.0.orig/virtManager/device/addstorage.py ++++ virt-manager-3.0.0/virtManager/device/addstorage.py +@@ -251,14 +251,18 @@ class vmmAddStorage(vmmGObjectUI): + if disk.wants_storage_creation(): + pool = disk.get_parent_pool() + size = uiutil.spin_get_helper(self.widget("storage-size")) +- sparse = False ++ fmt = self.conn.get_default_storage_format() ++ ++ # If the user changed the default disk format to raw, assume ++ # they want to maximize performance, so fully allocate the ++ # disk image. Otherwise use sparse ++ sparse = fmt != 'raw' + + vol_install = virtinst.DeviceDisk.build_vol_install( + disk.conn, os.path.basename(disk.path), pool, + size, sparse) + disk.set_vol_install(vol_install) + +- fmt = self.conn.get_default_storage_format() + if disk.get_vol_install().supports_format(): + log.debug("Using default prefs format=%s for path=%s", + fmt, disk.path) diff --git a/e5a51f63-details-Change-Close-accelerator-to-ctrl+shift+w.patch b/e5a51f63-details-Change-Close-accelerator-to-ctrl+shift+w.patch new file mode 100644 index 00000000..a857a355 --- /dev/null +++ b/e5a51f63-details-Change-Close-accelerator-to-ctrl+shift+w.patch @@ -0,0 +1,104 @@ +Subject: details: Change Close accelerator to ctrl+shift+w +From: Cole Robinson crobinso@redhat.com Mon Sep 21 14:33:25 2020 -0400 +Date: Mon Sep 21 14:33:25 2020 -0400: +Git: e5a51f637411b4b2efc789fdef99eb4860ac3b9f + +Close accelerator changes ctrl+w -> ctrl+shift+w +Quit accelerator changes ctrl+q -> ctrl+shift+q + +After aafb874c8, if the mouse pointer isn't inside the console +window, it has keyboard focus but ctrl+w will be sent to the vmwindow +and not the VM. ctrl+w is a common shortcut for deleting a word so +this is pretty disruptive if you are typing inside the VM + +Use gnome-terminal-esque accelerators starting with ctrl+shift to +reduce the chance of collision. + +https://bugzilla.redhat.com/show_bug.cgi?id=1880295 + +Signed-off-by: Cole Robinson + +Index: virt-manager-3.0.0/tests/uitests/test_livetests.py +=================================================================== +--- virt-manager-3.0.0.orig/tests/uitests/test_livetests.py ++++ virt-manager-3.0.0/tests/uitests/test_livetests.py +@@ -146,7 +146,7 @@ class Console(lib.testcase.UITestCase): + # Check that modifiers don't work + win.click() + self.app.sleep(1) +- win.keyCombo("w") ++ win.keyCombo("w") + lib.utils.check(lambda: win.showing) + dom.destroy() + win.find("Guest is not running.") +@@ -315,13 +315,13 @@ class Console(lib.testcase.UITestCase): + + # Ensure ctrl+w doesn't close the window, modifiers are disabled + term.click() +- win.keyCombo("w") ++ win.keyCombo("w") + lib.utils.check(lambda: win.showing) +- # Shut it down, ensure w works again ++ # Shut it down, ensure accelerator works again + self._destroy(win) + win.click_title() + self.app.sleep(1) +- win.keyCombo("w") ++ win.keyCombo("w") + lib.utils.check(lambda: not win.showing) + + +Index: virt-manager-3.0.0/ui/vmwindow.ui +=================================================================== +--- virt-manager-3.0.0.orig/ui/vmwindow.ui ++++ virt-manager-3.0.0/ui/vmwindow.ui +@@ -3,6 +3,16 @@ + + + ++ ++ True ++ False ++ gtk-close ++ ++ ++ True ++ False ++ gtk-quit ++ + + False + Virtual Machine +@@ -48,24 +58,28 @@ + + + +- gtk-close ++ _Close + True + False + True +- True ++ image1 ++ False + accelgroup1 + ++ + + + + +- gtk-quit ++ _Quit + True + False + True +- True ++ image2 ++ False + accelgroup1 + ++ + + + diff --git a/virt-manager.changes b/virt-manager.changes index d2b44265..63b10b2c 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,7 +1,17 @@ +------------------------------------------------------------------- +Mon Sep 28 08:17:59 MDT 2020 - carnold@suse.com + +- Upstream bug fixes (bsc#1027942) + ba08f84b-addstorage-Return-to-using-qcow2-sparse-by-default.patch + a010c49b-cli-Fix-os-variant-help-introspection.patch + 79ebcbcb-viewers-Fix-spice-audio.patch + e5a51f63-details-Change-Close-accelerator-to-ctrl+shift+w.patch + 9c13d2f8-Remove-use-of-problematic-terminology.patch + ------------------------------------------------------------------- Wed Sep 16 05:24:21 MDT 2020 - carnold@suse.com -- Update to virt-manager 3.0.0 (fate#326786) +- jsc#SLE-16582, Upgrade virt-manager >= 3.x virt-manager-3.0.0.tar.bz2 * virt-install –cloud-init support (Athina Plaskasoviti, Cole Robinson) diff --git a/virt-manager.spec b/virt-manager.spec index 030239f8..0ef067f0 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -32,6 +32,11 @@ Source1: virt-install.rb Source2: virt-install.desktop Source3: virt-manager-supportconfig # Upstream Patches +Patch1: ba08f84b-addstorage-Return-to-using-qcow2-sparse-by-default.patch +Patch2: a010c49b-cli-Fix-os-variant-help-introspection.patch +Patch3: 79ebcbcb-viewers-Fix-spice-audio.patch +Patch4: e5a51f63-details-Change-Close-accelerator-to-ctrl+shift+w.patch +Patch5: 9c13d2f8-Remove-use-of-problematic-terminology.patch # SUSE Only Patch70: virtman-desktop.patch Patch71: virtman-kvm.patch @@ -154,6 +159,11 @@ machine). %prep %setup -q # Upstream Patches +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 # SUSE Only %patch70 -p1 %patch71 -p1