From e6ab818c14847dae22df4f2db064d679ea14d3fe Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 28 2020 08:53:45 +0000 Subject: import virt-manager-2.2.1-3.el8 --- diff --git a/SOURCES/virt-manager-addhardware-Add-bochs-display-to-the-video-list.patch b/SOURCES/virt-manager-addhardware-Add-bochs-display-to-the-video-list.patch new file mode 100644 index 0000000..1047e9b --- /dev/null +++ b/SOURCES/virt-manager-addhardware-Add-bochs-display-to-the-video-list.patch @@ -0,0 +1,39 @@ +From 6903bfe50e46cab6cb3e7720511a364f89e9cba8 Mon Sep 17 00:00:00 2001 +Message-Id: <6903bfe50e46cab6cb3e7720511a364f89e9cba8@dist-git> +From: Pavel Hrdina +Date: Wed, 2 Oct 2019 10:45:28 +0200 +Subject: [PATCH] addhardware: Add "bochs" display to the video list +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Fabiano Fidêncio + +https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Fabiano Fidêncio +(cherry picked from commit d9736db9d983d01c03929de226365dbf56a791a3) + +https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Pavel Hrdina +--- + virtManager/addhardware.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py +index 842eada1..881f0e02 100644 +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -663,7 +663,7 @@ class vmmAddHardware(vmmGObjectUI): + if guest.conn.is_xen(): + return ["xen", "vga"] + if guest.conn.is_qemu() or guest.conn.is_test(): +- return ["vga", "qxl", "virtio"] ++ return ["vga", "bochs", "qxl", "virtio"] + return [] + + @staticmethod +-- +2.23.0 + diff --git a/SOURCES/virt-manager-devices-video-Simplify-model-hvm-check.patch b/SOURCES/virt-manager-devices-video-Simplify-model-hvm-check.patch new file mode 100644 index 0000000..ff8e390 --- /dev/null +++ b/SOURCES/virt-manager-devices-video-Simplify-model-hvm-check.patch @@ -0,0 +1,49 @@ +From 5ba6467d88383edcdb940949d98f6f212ad3739d Mon Sep 17 00:00:00 2001 +Message-Id: <5ba6467d88383edcdb940949d98f6f212ad3739d@dist-git> +From: Pavel Hrdina +Date: Thu, 3 Oct 2019 15:41:44 -0400 +Subject: [PATCH] devices: video: Simplify model hvm check + +From: Cole Robinson + +Signed-off-by: Cole Robinson +(cherry picked from commit 651e5b6d753930a2e7536efa4e6d20f57b038e80) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Pavel Hrdina +--- + virtinst/devices/video.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py +index 3d8ab939..3ebc561f 100644 +--- a/virtinst/devices/video.py ++++ b/virtinst/devices/video.py +@@ -27,6 +27,8 @@ class DeviceVideo(Device): + + @staticmethod + def default_model(guest): ++ if not guest.os.is_hvm(): ++ return None + if guest.os.is_pseries(): + return "vga" + if guest.os.is_arm_machvirt() or guest.os.is_riscv_virt(): +@@ -37,11 +39,9 @@ class DeviceVideo(Device): + if guest.has_gl(): + return "virtio" + return "qxl" +- if guest.os.is_hvm(): +- if guest.conn.is_qemu(): +- return "qxl" +- return "vga" +- return None ++ if guest.conn.is_qemu(): ++ return "qxl" ++ return "vga" + + def set_defaults(self, guest): + if not self.model: +-- +2.23.0 + diff --git a/SOURCES/virt-manager-domcapabilities-Add-supports_video_bochs.patch b/SOURCES/virt-manager-domcapabilities-Add-supports_video_bochs.patch new file mode 100644 index 0000000..7e2f1bd --- /dev/null +++ b/SOURCES/virt-manager-domcapabilities-Add-supports_video_bochs.patch @@ -0,0 +1,46 @@ +From ff8352b596afe056cefea56a2e4c296d8b804d52 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Thu, 3 Oct 2019 10:47:15 +0200 +Subject: [PATCH] domcapabilities: Add supports_video_bochs() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Fabiano Fidêncio + +Returns whether bochs display is supported, according to the domain +capabilities. + +Signed-off-by: Fabiano Fidêncio +(cherry picked from commit 2e20b128a1a1f064c5036d3d3d0cf5b09117b9da) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Pavel Hrdina +--- + virtinst/domcapabilities.py | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py +index 9cc27bc2..82fed84b 100644 +--- a/virtinst/domcapabilities.py ++++ b/virtinst/domcapabilities.py +@@ -325,6 +325,14 @@ class DomainCapabilities(XMLBuilder): + """ + return bool(self.features.sev.supported) + ++ def supports_video_bochs(self): ++ """ ++ Returns False if either libvirt or qemu do not have support to bochs ++ video type. ++ """ ++ models = self.devices.video.get_enum("modelType").get_values() ++ return bool("bochs" in models) ++ + XML_NAME = "domainCapabilities" + os = XMLChildProperty(_OS, is_single=True) + cpu = XMLChildProperty(_CPU, is_single=True) +-- +2.23.0 + diff --git a/SOURCES/virt-manager-domcapabilities-Get-video-devices.patch b/SOURCES/virt-manager-domcapabilities-Get-video-devices.patch new file mode 100644 index 0000000..97d7919 --- /dev/null +++ b/SOURCES/virt-manager-domcapabilities-Get-video-devices.patch @@ -0,0 +1,39 @@ +From 129bc32090c147fe7239d137c17b1bee2d817024 Mon Sep 17 00:00:00 2001 +Message-Id: <129bc32090c147fe7239d137c17b1bee2d817024@dist-git> +From: Pavel Hrdina +Date: Thu, 3 Oct 2019 10:44:52 +0200 +Subject: [PATCH] domcapabilities: Get video devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Fabiano Fidêncio + +domcapabilities already handles disk and hostdev. Let's add support for +getting video devices as well. + +Signed-off-by: Fabiano Fidêncio +(cherry picked from commit 1547e16d62736c861a0e4dadeb86ef372d2698bd) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Pavel Hrdina +--- + virtinst/domcapabilities.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py +index f11f18aa..9cc27bc2 100644 +--- a/virtinst/domcapabilities.py ++++ b/virtinst/domcapabilities.py +@@ -95,6 +95,7 @@ class _Devices(_CapsBlock): + XML_NAME = "devices" + hostdev = XMLChildProperty(_make_capsblock("hostdev"), is_single=True) + disk = XMLChildProperty(_make_capsblock("disk"), is_single=True) ++ video = XMLChildProperty(_make_capsblock("video"), is_single=True) + + + class _Features(_CapsBlock): +-- +2.23.0 + diff --git a/SOURCES/virt-manager-guest-Drop-set_capabilities_defaults-call-from-get_uefi_path.patch b/SOURCES/virt-manager-guest-Drop-set_capabilities_defaults-call-from-get_uefi_path.patch new file mode 100644 index 0000000..a6a06cc --- /dev/null +++ b/SOURCES/virt-manager-guest-Drop-set_capabilities_defaults-call-from-get_uefi_path.patch @@ -0,0 +1,36 @@ +From cc52485e148de49bfee0b1200b3c6d0bc633e607 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Thu, 3 Oct 2019 15:35:59 -0400 +Subject: [PATCH] guest: Drop set_capabilities_defaults call from get_uefi_path + +From: Cole Robinson + +Callers need to handle this themselves, and all callers do AFAICT + +Signed-off-by: Cole Robinson +(cherry picked from commit 534f2e03d077306af4309babd30d92ea3ec4e8c0) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Pavel Hrdina +--- + virtinst/guest.py | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/virtinst/guest.py b/virtinst/guest.py +index 41357644..7559d843 100644 +--- a/virtinst/guest.py ++++ b/virtinst/guest.py +@@ -541,8 +541,6 @@ class Guest(XMLBuilder): + """ + If UEFI firmware path is found, return it, otherwise raise an error + """ +- if not self.os.arch: +- self.set_capabilities_defaults() + domcaps = self.lookup_domcaps() + + if not domcaps.supports_uefi_xml(): +-- +2.23.0 + diff --git a/SOURCES/virt-manager-osdict-Always-return-the-most-generic-tree.patch b/SOURCES/virt-manager-osdict-Always-return-the-most-generic-tree.patch new file mode 100644 index 0000000..1df379a --- /dev/null +++ b/SOURCES/virt-manager-osdict-Always-return-the-most-generic-tree.patch @@ -0,0 +1,107 @@ +From b41f086d40bd0703f1776589dd4ea5579d0fd520 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Fri, 6 Sep 2019 18:06:08 +0200 +Subject: [PATCH] osdict: Always return the most generic tree +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Fabiano Fidêncio + +Some OSes, as Fedora, have variants (which we rely to be standardised on +osinfo-db side), which we can use to return the most generic tree +possible, in case no profile is specified, in order to avoid failing to +install a "Workstation" system because a "Server" variant tree was used. + +https://bugzilla.redhat.com/show_bug.cgi?id=1749865 + +Signed-off-by: Fabiano Fidêncio +(cherry picked from commit 0f1acc9f8f392eaf5edd30ce239728afd1f924cf) +Signed-off-by: Pavel Hrdina +--- + tests/osdict.py | 4 ++++ + virtinst/osdict.py | 39 ++++++++++++++++++++++++++++++++++----- + 2 files changed, 38 insertions(+), 5 deletions(-) + +diff --git a/tests/osdict.py b/tests/osdict.py +index eb0d4f86..9fb477bd 100644 +--- a/tests/osdict.py ++++ b/tests/osdict.py +@@ -52,11 +52,15 @@ class TestOSDB(unittest.TestCase): + + def test_tree_url(self): + f26 = OSDB.lookup_os("fedora26") ++ f29 = OSDB.lookup_os("fedora29") + winxp = OSDB.lookup_os("winxp") + + # Valid tree URL + assert "fedoraproject.org" in f26.get_location("x86_64") + ++ # Most generic tree URL ++ assert "Everything" in f29.get_location("x86_64") ++ + # Has tree URLs, but none for arch + try: + f26.get_location("ia64") +diff --git a/virtinst/osdict.py b/virtinst/osdict.py +index 64d8bdb8..a53e4249 100644 +--- a/virtinst/osdict.py ++++ b/virtinst/osdict.py +@@ -592,8 +592,36 @@ class _OsVariant(object): + + return "inst.repo" + ++ def _get_generic_location(self, treelist, arch, profile): ++ if not hasattr(Libosinfo.Tree, "get_os_variants"): ++ for tree in treelist: ++ if tree.get_architecture() == arch: ++ return tree.get_url() ++ return None ++ ++ fallback_tree = None ++ if not profile: ++ profile = "Everything" ++ ++ for tree in treelist: ++ if tree.get_architecture() != arch: ++ continue ++ ++ variant_list = tree.get_os_variants() ++ if variant_list.get_length() == 0: ++ return tree.get_url() ++ ++ fallback_tree = tree ++ for i in range(variant_list.get_length()): ++ variant = variant_list.get_nth(i) ++ if profile in variant.get_name(): ++ return tree.get_url() ++ ++ if fallback_tree: ++ return fallback_tree.get_url() ++ return None + +- def get_location(self, arch): ++ def get_location(self, arch, profile=None): + treelist = [] + if self._os: + treelist = list(_OsinfoIter(self._os.get_tree_list())) +@@ -605,10 +633,11 @@ class _OsVariant(object): + # Some distros have more than one URL for a specific architecture, + # which is the case for Fedora and different variants (Server, + # Workstation). Later on, we'll have to differentiate that and return +- # the right one. +- for tree in treelist: +- if tree.get_architecture() == arch: +- return tree.get_url() ++ # the right one. However, for now, let's just rely on returning the ++ # most generic tree possible. ++ location = self._get_generic_location(treelist, arch, profile) ++ if location: ++ return location + + raise RuntimeError( + _("OS '%s' does not have a URL location for the %s architecture") % +-- +2.23.0 + diff --git a/SOURCES/virt-manager-osdict-Choose-the-most-appropriate-tree-when-a-profile-is-set.patch b/SOURCES/virt-manager-osdict-Choose-the-most-appropriate-tree-when-a-profile-is-set.patch new file mode 100644 index 0000000..ff55a10 --- /dev/null +++ b/SOURCES/virt-manager-osdict-Choose-the-most-appropriate-tree-when-a-profile-is-set.patch @@ -0,0 +1,111 @@ +From ec270ec272eb6986b4967df63e74ee60656e1e12 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Pavel Hrdina +Date: Wed, 11 Sep 2019 18:19:09 +0200 +Subject: [PATCH] osdict: Choose the most appropriate tree when a profile is + set +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Fabiano Fidêncio + +As some OSes, as Fedora, have variants (which we rely to be standardised +on osinfo-db side), let's select the most appropriate variant according +to the selected profile of the unattended installation. + +Signed-off-by: Fabiano Fidêncio +(cherry picked from commit d6d97c658771f75d2a1fdfeeac02ee7bfb106b88) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1749865 + +Signed-off-by: Pavel Hrdina +--- + tests/osdict.py | 4 ++++ + virt-install | 14 +++++++++----- + virtinst/osdict.py | 6 +++++- + 3 files changed, 18 insertions(+), 6 deletions(-) + +diff --git a/tests/osdict.py b/tests/osdict.py +index 9fb477bd..9058b39e 100644 +--- a/tests/osdict.py ++++ b/tests/osdict.py +@@ -61,6 +61,10 @@ class TestOSDB(unittest.TestCase): + # Most generic tree URL + assert "Everything" in f29.get_location("x86_64") + ++ # Specific tree ++ assert "Server" in f29.get_location("x86_64", "jeos") ++ assert "Workstation" in f29.get_location("x86_64", "desktop") ++ + # Has tree URLs, but none for arch + try: + f26.get_location("ia64") +diff --git a/virt-install b/virt-install +index af6c75bf..009d03e1 100755 +--- a/virt-install ++++ b/virt-install +@@ -386,9 +386,9 @@ def show_warnings(options, guest, installer, osdata): + # Guest building helpers # + ########################## + +-def get_location_for_os(guest, osname): ++def get_location_for_os(guest, osname, profile=None): + osinfo = virtinst.OSDB.lookup_os(osname, raise_error=True) +- location = osinfo.get_location(guest.os.arch) ++ location = osinfo.get_location(guest.os.arch, profile) + print_stdout(_("Using {osname} --location {url}").format( + osname=osname, url=location)) + return location +@@ -399,6 +399,7 @@ def build_installer(options, guest, installdata): + location = None + location_kernel = None + location_initrd = None ++ unattended_data = None + extra_args = options.extra_args + + install_bootdev = installdata.bootdev +@@ -413,8 +414,12 @@ def build_installer(options, guest, installdata): + else: + extra_args = [installdata.kernel_args] + ++ if options.unattended: ++ unattended_data = cli.parse_unattended(options.unattended) ++ + if install_os: +- location = get_location_for_os(guest, install_os) ++ profile = unattended_data.profile if unattended_data else None ++ location = get_location_for_os(guest, install_os, profile) + elif options.location: + (location, + location_kernel, +@@ -443,8 +448,7 @@ def build_installer(options, guest, installdata): + install_kernel_args=install_kernel_args, + no_install=no_install) + +- if options.unattended: +- unattended_data = cli.parse_unattended(options.unattended) ++ if unattended_data: + installer.set_unattended_data(unattended_data) + if extra_args: + installer.set_extra_args(extra_args) +diff --git a/virtinst/osdict.py b/virtinst/osdict.py +index a53e4249..ad2a7f2d 100644 +--- a/virtinst/osdict.py ++++ b/virtinst/osdict.py +@@ -600,7 +600,11 @@ class _OsVariant(object): + return None + + fallback_tree = None +- if not profile: ++ if profile == "jeos": ++ profile = "Server" ++ elif profile == "desktop": ++ profile = "Workstation" ++ elif not profile: + profile = "Everything" + + for tree in treelist: +-- +2.23.0 + diff --git a/SOURCES/virt-manager-video-Prefer-bochs-when-it-s-supported.patch b/SOURCES/virt-manager-video-Prefer-bochs-when-it-s-supported.patch new file mode 100644 index 0000000..f648201 --- /dev/null +++ b/SOURCES/virt-manager-video-Prefer-bochs-when-it-s-supported.patch @@ -0,0 +1,44 @@ +From 0cc2b81575b0ce04edaa4a94db91f1cc37292ea6 Mon Sep 17 00:00:00 2001 +Message-Id: <0cc2b81575b0ce04edaa4a94db91f1cc37292ea6@dist-git> +From: Pavel Hrdina +Date: Thu, 3 Oct 2019 10:50:34 +0200 +Subject: [PATCH] video: Prefer "bochs" when it's supported. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Fabiano Fidêncio + +Preferring "bochs" display device is the way to go when dealing with a +Linux guest using UEFI and that's quite well described here: +https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/ + +https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Fabiano Fidêncio +(cherry picked from commit 8f4c53ea960459516794ba533060a176cc26f121) + +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1753644 + +Signed-off-by: Pavel Hrdina +--- + virtinst/devices/video.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py +index 3ebc561f..fcca91b6 100644 +--- a/virtinst/devices/video.py ++++ b/virtinst/devices/video.py +@@ -39,6 +39,9 @@ class DeviceVideo(Device): + if guest.has_gl(): + return "virtio" + return "qxl" ++ if (guest.is_uefi() and ++ guest.lookup_domcaps().supports_video_bochs()): ++ return "bochs" + if guest.conn.is_qemu(): + return "qxl" + return "vga" +-- +2.23.0 + diff --git a/SPECS/virt-manager.spec b/SPECS/virt-manager.spec index 4dea8cf..cd07326 100644 --- a/SPECS/virt-manager.spec +++ b/SPECS/virt-manager.spec @@ -18,7 +18,7 @@ Name: virt-manager Version: 2.2.1 -Release: 2%{?dist}%{?extra_release} +Release: 3%{?dist}%{?extra_release} %global verrel %{version}-%{release} Summary: Desktop tool for managing virtual machines via libvirt @@ -30,6 +30,14 @@ Source1: symlinks Patch1: virt-manager-guest-fix-warning-message-when-machine-type-is-changed-for-secure-boot.patch Patch2: virt-manager-man-virt-install-Fix-a-couple-of-launchSecurity-related-typos.patch +Patch3: virt-manager-guest-Drop-set_capabilities_defaults-call-from-get_uefi_path.patch +Patch4: virt-manager-devices-video-Simplify-model-hvm-check.patch +Patch5: virt-manager-domcapabilities-Get-video-devices.patch +Patch6: virt-manager-domcapabilities-Add-supports_video_bochs.patch +Patch7: virt-manager-video-Prefer-bochs-when-it-s-supported.patch +Patch8: virt-manager-addhardware-Add-bochs-display-to-the-video-list.patch +Patch9: virt-manager-osdict-Always-return-the-most-generic-tree.patch +Patch10: virt-manager-osdict-Choose-the-most-appropriate-tree-when-a-profile-is-set.patch Requires: virt-manager-common = %{verrel} @@ -217,6 +225,16 @@ done %changelog +* Mon Dec 2 2019 Pavel Hrdina - 2.2.1-3 +- guest: Drop set_capabilities_defaults call from get_uefi_path (rhbz#1753644) +- devices: video: Simplify model hvm check (rhbz#1753644) +- domcapabilities: Get video devices (rhbz#1753644) +- domcapabilities: Add supports_video_bochs() (rhbz#1753644) +- video: Prefer "bochs" when it's supported. (rhbz#1753644) +- addhardware: Add "bochs" display to the video list (rhbz#1753644) +- osdict: Always return the most generic tree (rhbz#1749865) +- osdict: Choose the most appropriate tree when a profile is set (rhbz#1749865) + * Fri Aug 16 2019 Pavel Hrdina - 2.2.1-2 - man: virt-install: Fix a couple of launchSecurity related typos (rhbz#1741846)