From 846839bb594a9b2a1ab7e9a103af010563dfbcc9 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 15 2022 06:45:24 +0000 Subject: import virt-manager-4.0.0-1.el9 --- diff --git a/.gitignore b/.gitignore index 1498368..904a817 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/virt-manager-3.2.0.tar.gz +SOURCES/virt-manager-4.0.0.tar.gz diff --git a/.virt-manager.metadata b/.virt-manager.metadata index b8cf7e1..1d2b29c 100644 --- a/.virt-manager.metadata +++ b/.virt-manager.metadata @@ -1 +1 @@ -f620494a41f898422581846ccf38b0e4540ea54e SOURCES/virt-manager-3.2.0.tar.gz +853b1a65b346ac7be7c68d83697b4107bb780683 SOURCES/virt-manager-4.0.0.tar.gz diff --git a/SOURCES/0001-virtinst-Fix-TOCTOU-in-domain-enumeration.patch b/SOURCES/0001-virtinst-Fix-TOCTOU-in-domain-enumeration.patch deleted file mode 100644 index f747754..0000000 --- a/SOURCES/0001-virtinst-Fix-TOCTOU-in-domain-enumeration.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 4d0e323227f18e58283c45be4d240b506faacb22 Mon Sep 17 00:00:00 2001 -Message-Id: <4d0e323227f18e58283c45be4d240b506faacb22.1610390294.git.crobinso@redhat.com> -From: Martin Pitt -Date: Tue, 24 Nov 2020 14:24:06 +0100 -Subject: [PATCH virt-manager] virtinst: Fix TOCTOU in domain enumeration - -Similar to commit 49a01b5482, _fetch_all_domains_raw() has a race -condition where a domain may disappear (from parallel libvirt -operations) in between enumerating and inspecting the objects. - -Ignore these missing domains instead of crashing. - -https://bugzilla.redhat.com/show_bug.cgi?id=1901081 -Signed-off-by: Cole Robinson ---- - virtinst/connection.py | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/virtinst/connection.py b/virtinst/connection.py -index fec273b7..06bc60ad 100644 ---- a/virtinst/connection.py -+++ b/virtinst/connection.py -@@ -182,8 +182,16 @@ class VirtinstConnection(object): - def _fetch_all_domains_raw(self): - dummy1, dummy2, ret = pollhelpers.fetch_vms( - self, {}, lambda obj, ignore: obj) -- return [Guest(weakref.proxy(self), parsexml=obj.XMLDesc(0)) -- for obj in ret] -+ domains = [] -+ for obj in ret: -+ # TOCTOU race: a domain may go away in between enumeration and inspection -+ try: -+ xml = obj.XMLDesc(0) -+ except libvirt.libvirtError as e: # pragma: no cover -+ log.debug("Fetching domain XML failed: %s", e) -+ continue -+ domains.append(Guest(weakref.proxy(self), parsexml=xml)) -+ return domains - - def _build_pool_raw(self, poolobj): - return StoragePool(weakref.proxy(self), --- -2.29.2 - diff --git a/SOURCES/symlinks b/SOURCES/symlinks new file mode 100644 index 0000000..6eb4415 --- /dev/null +++ b/SOURCES/symlinks @@ -0,0 +1,5 @@ +data/hicolor icons +tests/testdriver.xml data/testdriver/testdriver.xml +tests/data/urldetect/debian/buster/main/installer-arm64 installer-amd64/ +tests/data/urldetect/debian/buster/main/installer-ppc64el installer-amd64/ +tests/data/urldetect/debian/buster/main/installer-s390x installer-amd64/ diff --git a/SOURCES/virt-manager-Handle-new-nodedev-name-for-mediated-devices.patch b/SOURCES/virt-manager-Handle-new-nodedev-name-for-mediated-devices.patch deleted file mode 100644 index f7a2a5a..0000000 --- a/SOURCES/virt-manager-Handle-new-nodedev-name-for-mediated-devices.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 9cb766bec0296720e98101807726dd9a488486c4 Mon Sep 17 00:00:00 2001 -From: Jonathon Jongsma -Date: Tue, 26 Oct 2021 14:18:40 -0500 -Subject: [PATCH] Handle new nodedev name for mediated devices - -libvirt recently changed the nodedev names for mediated devices due to -the fact that mdevctl supports defining multiple mediated devices with -the same UUID as long as only one is active at a time. This means that -the nodedev name changed from the format 'mdev_$UUID' to the format -'mdev_$UUID_$PARENT'. - -Unfortunately, virt-install was parsing the nodedev name to extract the -UUID of a mediated device. This fails with the new name format. -Fortunately, in libvirt 7.3.0, a field was added to the xml -schema for mdev devices, so we can simply use this instead, and fall -back to the name parsing if it doesn't exist. - -Signed-off-by: Jonathon Jongsma -(cherry picked from commit 0c146b250384ddddcefd2cc0d76b9e808377ebe5) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2023650 - -Signed-off-by: Jonathon Jongsma ---- - tests/data/testdriver/testdriver.xml | 14 ++++++++++++++ - tests/test_nodedev.py | 14 ++++++++++++++ - virtinst/nodedev.py | 7 +++++++ - 3 files changed, 35 insertions(+) - -diff --git a/tests/data/testdriver/testdriver.xml b/tests/data/testdriver/testdriver.xml -index 5875732a..e4880936 100644 ---- a/tests/data/testdriver/testdriver.xml -+++ b/tests/data/testdriver/testdriver.xml -@@ -3725,4 +3725,18 @@ ba - - - -+ -+ mdev_35ceae7f_eea5_4f28_b7f3_7b12a3e62d3c_0000_06_00_0 -+ /sys/devices/pci0000:00/0000:00:02.0/35ceae7f-eea5-4f28-b7f3-7b12a3e62d3c -+ pci_0000_06_00_0 -+ -+ vfio_mdev -+ -+ -+ -+ -+ 35ceae7f-eea5-4f28-b7f3-7b12a3e62d3c -+ -+ -+ - -diff --git a/tests/test_nodedev.py b/tests/test_nodedev.py -index 79678bc8..41435262 100644 ---- a/tests/test_nodedev.py -+++ b/tests/test_nodedev.py -@@ -8,6 +8,7 @@ - import os.path - - import pytest -+import libvirt - - from virtinst import Guest - from virtinst import NodeDevice -@@ -154,6 +155,19 @@ def testPCIMdev(): - assert dev.parent == "pci_0000_06_00_0" - assert dev.device_type == "mdev" - assert dev.type_id == "nvidia-11" -+ assert dev.get_mdev_uuid() == "4b20d080-1b54-4048-85b3-a6a62d165c01" -+ -+# libvirt <7.3.0 doesn't support in the mdev node device xml -+@pytest.mark.skipif(libvirt.getVersion() < 7003000, reason="libvirt version doesn't support new mdev format") -+def testPCIMdevNewFormat(): -+ conn = utils.URIs.open_testdriver_cached() -+ devname = "mdev_35ceae7f_eea5_4f28_b7f3_7b12a3e62d3c_0000_06_00_0" -+ dev = _nodeDevFromName(conn, devname) -+ assert dev.name == devname -+ assert dev.parent == "pci_0000_06_00_0" -+ assert dev.device_type == "mdev" -+ assert dev.type_id == "nvidia-11" -+ assert dev.get_mdev_uuid() == "35ceae7f-eea5-4f28-b7f3-7b12a3e62d3c" - - - # NodeDevice 2 Device XML tests -diff --git a/virtinst/nodedev.py b/virtinst/nodedev.py -index f54a311c..248723b9 100644 ---- a/virtinst/nodedev.py -+++ b/virtinst/nodedev.py -@@ -94,6 +94,12 @@ class NodeDevice(XMLBuilder): - device_type = XMLProperty("./capability/@type") - - def get_mdev_uuid(self): -+ # libvirt 7.3.0 added a element to the nodedev xml for mdev -+ # types. For older versions, we unfortunately have to parse the nodedev -+ # name, which uses the format "mdev_$UUID_WITH_UNDERSCORES" -+ if self.uuid is not None: -+ return self.uuid -+ - return self.name[5:].replace('_', '-') - - def compare_to_hostdev(self, hostdev): -@@ -191,6 +197,7 @@ class NodeDevice(XMLBuilder): - - # type='mdev' options - type_id = XMLProperty("./capability/type/@id") -+ uuid = XMLProperty("./capability/uuid") - - - def _AddressStringToHostdev(conn, addrstr): --- -2.31.1 - diff --git a/SOURCES/virt-manager-cli-add-ioapic.driver-to-features.patch b/SOURCES/virt-manager-cli-add-ioapic.driver-to-features.patch deleted file mode 100644 index 5c0124e..0000000 --- a/SOURCES/virt-manager-cli-add-ioapic.driver-to-features.patch +++ /dev/null @@ -1,112 +0,0 @@ -From a024c96367ce5f1f8e24e19e9d0735de308d870b Mon Sep 17 00:00:00 2001 -From: Jonathon Jongsma -Date: Tue, 11 Jan 2022 11:21:39 -0600 -Subject: [PATCH] cli: add 'ioapic.driver' to --features - -Add the ability to set the ioapic driver using the --features argument: - - $ virt-install --features ioapic.driver=qemu ... - -This results in the following xml: - - - ... - - - -This is required in order to install a guest with >255 cpus. Such a -configuration requires an iommu with extended interrupt mode enabled, -which in turn requires IOMMU interrupt remapping to be enabled, which in -turn requires a split I/O APIC. - -Signed-off-by: Jonathon Jongsma -(cherry picked from commit 9766beea0432faad7cded9e0285d05851659020e) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2039127 - -Signed-off-by: Jonathon Jongsma ---- - tests/data/cli/compare/virt-install-singleton-config-3.xml | 1 + - tests/data/xmlparse/change-guest-out.xml | 1 + - tests/test_cli.py | 2 +- - tests/test_xmlparse.py | 1 + - virtinst/cli.py | 1 + - virtinst/domain/features.py | 1 + - 6 files changed, 6 insertions(+), 1 deletion(-) - -diff --git a/tests/data/cli/compare/virt-install-singleton-config-3.xml b/tests/data/cli/compare/virt-install-singleton-config-3.xml -index d2e7a363..a36c7bf2 100644 ---- a/tests/data/cli/compare/virt-install-singleton-config-3.xml -+++ b/tests/data/cli/compare/virt-install-singleton-config-3.xml -@@ -73,6 +73,7 @@ - - - -+ - - - -diff --git a/tests/data/xmlparse/change-guest-out.xml b/tests/data/xmlparse/change-guest-out.xml -index 17af0826..3faf8783 100644 ---- a/tests/data/xmlparse/change-guest-out.xml -+++ b/tests/data/xmlparse/change-guest-out.xml -@@ -32,6 +32,7 @@ - - - -+ - - - -diff --git a/tests/test_cli.py b/tests/test_cli.py -index aba1fe3c..2034d21c 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -558,7 +558,7 @@ c.add_compare(""" - --vcpus vcpu.current=3,maxvcpus=4,vcpu.placement=auto - --memory hotplugmemorymax=2048,hotplugmemoryslots=2 - --disk none ----features apic.eoi=off,hap=on,hyperv.synic.state=on,hyperv.reset.state=off,hyperv.spinlocks.state=on,hyperv.spinlocks.retries=5678,pae=on,pmu.state=on,pvspinlock.state=off,smm.state=off,viridian=on,vmcoreinfo.state=on,vmport.state=off,kvm.hidden.state=on,hyperv.vapic.state=off,hyperv.relaxed.state=off,gic.version=host,kvm.hint-dedicated.state=on -+--features apic.eoi=off,hap=on,hyperv.synic.state=on,hyperv.reset.state=off,hyperv.spinlocks.state=on,hyperv.spinlocks.retries=5678,pae=on,pmu.state=on,pvspinlock.state=off,smm.state=off,viridian=on,vmcoreinfo.state=on,vmport.state=off,kvm.hidden.state=on,hyperv.vapic.state=off,hyperv.relaxed.state=off,gic.version=host,kvm.hint-dedicated.state=on,ioapic.driver=qemu - --clock rtc_present=no,pit_present=yes,pit_tickpolicy=catchup,tsc_present=no,platform_present=no,hypervclock_present=no,platform_tickpolicy=foo,hpet_tickpolicy=bar,tsc_tickpolicy=wibble,kvmclock_tickpolicy=wobble,hypervclock_tickpolicy=woo - --boot bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,smbios.mode=host,bootmenu.enable=yes,loader_ro=yes,loader.type=rom,loader=/tmp/foo - --memorybacking access.mode=shared,source.type=anonymous,hugepages=on -diff --git a/tests/test_xmlparse.py b/tests/test_xmlparse.py -index 6d1aaddb..ac2fb38d 100644 ---- a/tests/test_xmlparse.py -+++ b/tests/test_xmlparse.py -@@ -160,6 +160,7 @@ def testAlterGuest(): - check("kvm_hidden", None, True) - check("pvspinlock", None, True) - check("gic_version", None, False) -+ check("ioapic_driver", None, "qemu") - - check = _make_checker(guest.cpu) - check("match", "exact", "strict") -diff --git a/virtinst/cli.py b/virtinst/cli.py -index e1a988f9..dbd4a545 100644 ---- a/virtinst/cli.py -+++ b/virtinst/cli.py -@@ -2777,6 +2777,7 @@ class ParserFeatures(VirtCLIParser): - - cls.add_arg("smm.state", "smm", is_onoff=True) - cls.add_arg("vmcoreinfo.state", "vmcoreinfo", is_onoff=True) -+ cls.add_arg("ioapic.driver", "ioapic_driver") - - - ################### -diff --git a/virtinst/domain/features.py b/virtinst/domain/features.py -index 246839f2..7d32edc0 100644 ---- a/virtinst/domain/features.py -+++ b/virtinst/domain/features.py -@@ -41,6 +41,7 @@ class DomainFeatures(XMLBuilder): - - smm = XMLProperty("./smm/@state", is_onoff=True) - vmcoreinfo = XMLProperty("./vmcoreinfo/@state", is_onoff=True) -+ ioapic_driver = XMLProperty("./ioapic/@driver") - - - ################## --- -2.34.1 - diff --git a/SOURCES/virt-manager-cli-filesystem-add-binary.sandbox.mode-and-source.socket.patch b/SOURCES/virt-manager-cli-filesystem-add-binary.sandbox.mode-and-source.socket.patch deleted file mode 100644 index 8f4f917..0000000 --- a/SOURCES/virt-manager-cli-filesystem-add-binary.sandbox.mode-and-source.socket.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 5c16353a007fd7f18eb44a7413d0c146b7de1a4c Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Fri, 30 Jul 2021 13:15:29 -0400 -Subject: [PATCH] cli: --filesystem: add binary.sandbox.mode and source.socket - -Signed-off-by: Cole Robinson -(cherry picked from commit 520b3a3b35359ddd07f3a818d6cc3e6740079eff) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2045932 - -Signed-off-by: Jonathon Jongsma ---- - tests/data/cli/compare/virt-install-many-devices.xml | 5 ++++- - tests/test_cli.py | 2 +- - virtinst/cli.py | 2 ++ - virtinst/devices/filesystem.py | 2 ++ - 4 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml -index 3bd756b3..417d8db0 100644 ---- a/tests/data/cli/compare/virt-install-many-devices.xml -+++ b/tests/data/cli/compare/virt-install-many-devices.xml -@@ -293,11 +293,14 @@ - - 1234 - 500 -- -+ -+ /tmp/foo.sock -+ - - - - -+ - - - -diff --git a/tests/test_cli.py b/tests/test_cli.py -index 2034d21c..862d19dd 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -686,7 +686,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser - --filesystem type-mount,source.dir=/,target=/ - --filesystem type=template,source.name=foo,target=/ - --filesystem type=file,source.file=foo.img,target=/ ----filesystem type=volume,model=virtio,multidevs=remap,readonly=on,space_hard_limit=1234,space_soft_limit=500,source.pool=pool1,source.volume=vol,driver.name=virtiofs,driver.queue=3,binary.path=/foo/virtiofsd,binary.xattr=off,binary.cache.mode=always,binary.lock.posix=off,binary.lock.flock=on,target.dir=/foo -+--filesystem type=volume,model=virtio,multidevs=remap,readonly=on,space_hard_limit=1234,space_soft_limit=500,source.pool=pool1,source.volume=vol,driver.name=virtiofs,driver.queue=3,binary.path=/foo/virtiofsd,binary.xattr=off,binary.cache.mode=always,binary.lock.posix=off,binary.lock.flock=on,target.dir=/foo,binary.sandbox.mode=chroot,source.socket=/tmp/foo.sock - --filesystem type=block,source.dev=/dev/foo,target.dir=/ - --filesystem type=ram,source.usage=1024,source.units=MiB,target=/ - -diff --git a/virtinst/cli.py b/virtinst/cli.py -index dbd4a545..13782fc8 100644 ---- a/virtinst/cli.py -+++ b/virtinst/cli.py -@@ -4225,6 +4225,7 @@ class ParserFilesystem(VirtCLIParser): - cls.add_arg("source.volume", "source_volume") - cls.add_arg("source.units", "source_units") - cls.add_arg("source.usage", "source_usage") -+ cls.add_arg("source.socket", "source_socket") - - cls.add_arg("target.dir", "target_dir") - -@@ -4233,6 +4234,7 @@ class ParserFilesystem(VirtCLIParser): - cls.add_arg("binary.cache.mode", "binary_cache_mode") - cls.add_arg("binary.lock.posix", "binary_lock_posix", is_onoff=True) - cls.add_arg("binary.lock.flock", "binary_lock_flock", is_onoff=True) -+ cls.add_arg("binary.sandbox.mode", "binary_sandbox_mode") - - cls.add_arg("driver.format", "driver_format") - cls.add_arg("driver.name", "driver_name") -diff --git a/virtinst/devices/filesystem.py b/virtinst/devices/filesystem.py -index 574844b6..02402bac 100644 ---- a/virtinst/devices/filesystem.py -+++ b/virtinst/devices/filesystem.py -@@ -49,12 +49,14 @@ class DeviceFilesystem(Device): - source_units = XMLProperty("./source/@units") - source_pool = XMLProperty("./source/@pool") - source_volume = XMLProperty("./source/@volume") -+ source_socket = XMLProperty("./source/socket") - - binary_path = XMLProperty("./binary/@path") - binary_xattr = XMLProperty("./binary/@xattr", is_onoff=True) - binary_cache_mode = XMLProperty("./binary/cache/@mode") - binary_lock_posix = XMLProperty("./binary/lock/@posix", is_onoff=True) - binary_lock_flock = XMLProperty("./binary/lock/@flock", is_onoff=True) -+ binary_sandbox_mode = XMLProperty("./binary/sandbox/@mode") - - def _type_to_source_prop(self): - if self.type == DeviceFilesystem.TYPE_TEMPLATE: --- -2.34.1 - diff --git a/SOURCES/virt-manager-cli-introduce-resource-fibrechannel.appid-option.patch b/SOURCES/virt-manager-cli-introduce-resource-fibrechannel.appid-option.patch deleted file mode 100644 index cc6a3fd..0000000 --- a/SOURCES/virt-manager-cli-introduce-resource-fibrechannel.appid-option.patch +++ /dev/null @@ -1,71 +0,0 @@ -From ddedf5e1b34568adbbfed6a052bf96b7d1eda6f1 Mon Sep 17 00:00:00 2001 -From: Pavel Hrdina -Date: Tue, 14 Sep 2021 17:08:35 +0200 -Subject: [PATCH] cli: introduce --resource fibrechannel.appid option - -Signed-off-by: Pavel Hrdina -(cherry picked from commit 0953e1aea1fd16cd1825c03f3b032c7f12f3322f) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2011328 - -Signed-off-by: Jonathon Jongsma ---- - tests/data/cli/compare/virt-install-singleton-config-1.xml | 1 + - tests/test_cli.py | 2 +- - virtinst/cli.py | 1 + - virtinst/domain/resource.py | 3 ++- - 4 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/tests/data/cli/compare/virt-install-singleton-config-1.xml b/tests/data/cli/compare/virt-install-singleton-config-1.xml -index 518a0099..b50d806e 100644 ---- a/tests/data/cli/compare/virt-install-singleton-config-1.xml -+++ b/tests/data/cli/compare/virt-install-singleton-config-1.xml -@@ -19,6 +19,7 @@ - - - /virtualmachines/production -+ - - - hvm -diff --git a/tests/test_cli.py b/tests/test_cli.py -index 4b714e3e..aba1fe3c 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -480,7 +480,7 @@ c.add_compare(""" - --memorybacking hugepages=on - --features apic=off - --clock offset=localtime ----resource /virtualmachines/production -+--resource /virtualmachines/production,fibrechannel.appid=myapplication - --events on_crash=restart - --metadata genid_enable=yes - --sysinfo host -diff --git a/virtinst/cli.py b/virtinst/cli.py -index 8e5b13cd..e1a988f9 100644 ---- a/virtinst/cli.py -+++ b/virtinst/cli.py -@@ -1999,6 +1999,7 @@ class ParserResource(VirtCLIParser): - def _init_class(cls, **kwargs): - VirtCLIParser._init_class(**kwargs) - cls.add_arg("partition", "partition") -+ cls.add_arg("fibrechannel.appid", "fibrechannel_appid", can_comma=True) - - - ###################### -diff --git a/virtinst/domain/resource.py b/virtinst/domain/resource.py -index d0962db9..8ad3df54 100644 ---- a/virtinst/domain/resource.py -+++ b/virtinst/domain/resource.py -@@ -14,6 +14,7 @@ class DomainResource(XMLBuilder): - """ - - XML_NAME = "resource" -- _XML_PROP_ORDER = ["partition"] -+ _XML_PROP_ORDER = ["partition", "fibrechannel_appid"] - - partition = XMLProperty("./partition") -+ fibrechannel_appid = XMLProperty("./fibrechannel/@appid") --- -2.31.1 - diff --git a/SOURCES/virt-manager-hostdev-use-method-get_mdev_uuid.patch b/SOURCES/virt-manager-hostdev-use-method-get_mdev_uuid.patch deleted file mode 100644 index aeb5880..0000000 --- a/SOURCES/virt-manager-hostdev-use-method-get_mdev_uuid.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 1bba2d4e7de4a921921f2ae5d0d09589a180b70b Mon Sep 17 00:00:00 2001 -From: Shalini Chellathurai Saroja -Date: Mon, 31 May 2021 21:54:27 +0200 -Subject: [PATCH] hostdev: use method get_mdev_uuid() - -Use method get_mdev_uuid() to retrieve the UUID of MDEV node device -object. - -Reviewed-by: Cole Robinson -Signed-off-by: Shalini Chellathurai Saroja - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1995131 - -(cherry picked from commit f87e96d3d40891f1403601abc389c24800ba1069) -Signed-off-by: Jonathon Jongsma ---- - virtinst/devices/hostdev.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/virtinst/devices/hostdev.py b/virtinst/devices/hostdev.py -index e8d0fae2..b3717430 100644 ---- a/virtinst/devices/hostdev.py -+++ b/virtinst/devices/hostdev.py -@@ -78,7 +78,7 @@ class DeviceHostdev(Device): - _("Don't know how to generate nodedev for mdev type id '%s'") % - nodedev.type_id) - -- self.uuid = nodedev.name[5:].replace('_', '-') -+ self.uuid = nodedev.get_mdev_uuid() - - else: - raise ValueError(_("Unknown node device type %s") % nodedev) --- -2.31.1 - diff --git a/SOURCES/virt-manager-installer-Prefer-xorrisofs-over-genisoimage-mkisofs.patch b/SOURCES/virt-manager-installer-Prefer-xorrisofs-over-genisoimage-mkisofs.patch deleted file mode 100644 index 2fbe60b..0000000 --- a/SOURCES/virt-manager-installer-Prefer-xorrisofs-over-genisoimage-mkisofs.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 89766dae2418fb8fd9d54b7ce1d93a11d5faecdd Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Wed, 7 Apr 2021 09:37:53 -0400 -Subject: [PATCH] installer: Prefer xorrisofs over genisoimage/mkisofs - -Apparently it's the most likely version to exist in distros these -days. Particularly the other options may not be shipped in stock -RHEL9 - -Signed-off-by: Cole Robinson -(cherry picked from commit 3785abc6f0cb07c02ecc55760547a6f425513915) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973236 - -Signed-off-by: Jonathon Jongsma ---- - virtinst/install/installerinject.py | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/virtinst/install/installerinject.py b/virtinst/install/installerinject.py -index 29150c8e..97742f6a 100644 ---- a/virtinst/install/installerinject.py -+++ b/virtinst/install/installerinject.py -@@ -45,10 +45,12 @@ def _run_initrd_commands(initrd, tempdir): - - - def _run_iso_commands(iso, tempdir, cloudinit=False): -- # Some distros do not link mkisofs to genisoimage (or vice-versa). As a -- # result of this, we have to actually check for both programs and use the -- # most appropriate one. -- programs = ["genisoimage", "mkisofs"] -+ # These three programs all behave similarly for our needs, and -+ # different distros only have some available. xorriso is apparently -+ # the actively maintained variant that should be available everywhere -+ # and without any license issues. Some more info here: -+ # https://wiki.debian.org/genisoimage -+ programs = ["xorrisofs", "genisoimage", "mkisofs"] - for program in programs: - if shutil.which(program): - break --- -2.31.1 - diff --git a/SOURCES/virt-manager-man-fix-default-value-for-filesystem-accessmode-option.patch b/SOURCES/virt-manager-man-fix-default-value-for-filesystem-accessmode-option.patch deleted file mode 100644 index 3e3ce5f..0000000 --- a/SOURCES/virt-manager-man-fix-default-value-for-filesystem-accessmode-option.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 63a722890fa74f1f79346ebc2c4e158882d2bc0f Mon Sep 17 00:00:00 2001 -From: Jonathon Jongsma -Date: Tue, 8 Feb 2022 12:59:11 -0600 -Subject: [PATCH] man: fix default value for filesystem accessmode option - -Commit 85307b9bd2971cfc972c976c78e411f018647861 changed the default -value for 'accessmode' from 'passthrough' to 'mapped', but forgot to -update the documentation in the man page. - -Signed-off-by: Jonathon Jongsma -(cherry picked from commit 17cd4477b8b18051c5bc4d57da5ca611cfd2d372) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2045932 - -Signed-off-by: Jonathon Jongsma ---- - man/virt-install.rst | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/man/virt-install.rst b/man/virt-install.rst -index f75af635..e97a2266 100644 ---- a/man/virt-install.rst -+++ b/man/virt-install.rst -@@ -1197,7 +1197,7 @@ Some example suboptions: - - ``accessmode`` or ``mode`` - The access mode for the source directory from the guest OS. Only used with -- QEMU and type=mount. Valid modes are 'passthrough' (the default), 'mapped', -+ QEMU and type=mount. Valid modes are 'mapped' (the default), 'passthrough', - or 'squash'. See libvirt domain XML documentation for more info. - - ``source`` --- -2.34.1 - diff --git a/SOURCES/virt-manager-nodedev-Improve-error-with-unknown-address-strings.patch b/SOURCES/virt-manager-nodedev-Improve-error-with-unknown-address-strings.patch deleted file mode 100644 index 17ca6c4..0000000 --- a/SOURCES/virt-manager-nodedev-Improve-error-with-unknown-address-strings.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 6cdb34eb04e17315cfc7ee7cf6538bc6370c8d8b Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Tue, 11 Jan 2022 11:39:29 -0500 -Subject: [PATCH] nodedev: Improve error with unknown address strings - -Signed-off-by: Cole Robinson -(cherry picked from commit ed7b8769c4d48c89ed593138171bc8dbb1ead108) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2017840 - -Signed-off-by: Jonathon Jongsma ---- - virtinst/nodedev.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/virtinst/nodedev.py b/virtinst/nodedev.py -index 248723b9..f0bc769b 100644 ---- a/virtinst/nodedev.py -+++ b/virtinst/nodedev.py -@@ -235,7 +235,8 @@ def _AddressStringToHostdev(conn, addrstr): - hostdev.bus = bus - hostdev.device = device - else: -- raise RuntimeError("Unknown address type") -+ raise RuntimeError( -+ "Unknown hostdev address string format '%s'" % addrstr) - except Exception: - log.debug("Error parsing node device string.", exc_info=True) - raise --- -2.34.1 - diff --git a/SOURCES/virt-manager-tests-verify-MDEV-support.patch b/SOURCES/virt-manager-tests-verify-MDEV-support.patch deleted file mode 100644 index 21538e4..0000000 --- a/SOURCES/virt-manager-tests-verify-MDEV-support.patch +++ /dev/null @@ -1,230 +0,0 @@ -From bbf159da53b34060ae8e5f3023a78a541fec333a Mon Sep 17 00:00:00 2001 -From: Shalini Chellathurai Saroja -Date: Mon, 31 May 2021 21:54:28 +0200 -Subject: [PATCH] tests: verify MDEV support - -Add tests to verify add, edit and remove features of mediated -devices. - -Reviewed-by: Cole Robinson -Signed-off-by: Shalini Chellathurai Saroja - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1995131 - -(cherry picked from commit 9d4002ee0f7088c490748ffb3144c006f4e39c68) -Signed-off-by: Jonathon Jongsma ---- - .../virt-xml-add-hostdev-mdev-start.xml | 12 +++++++ - .../cli/compare/virt-xml-add-hostdev-mdev.xml | 14 ++++++++ - tests/data/cli/compare/virt-xml-edit-all.xml | 7 ++++ - .../compare/virt-xml-edit-hostdev-mdev.xml | 11 +++++++ - .../compare/virt-xml-edit-simple-redirdev.xml | 2 +- - .../compare/virt-xml-remove-hostdev-mdev.xml | 15 +++++++++ - tests/data/testdriver/testsuite.xml | 32 +++++++++++++++++++ - tests/test_cli.py | 4 +++ - tests/utils.py | 2 +- - 9 files changed, 97 insertions(+), 2 deletions(-) - create mode 100644 tests/data/cli/compare/virt-xml-add-hostdev-mdev-start.xml - create mode 100644 tests/data/cli/compare/virt-xml-add-hostdev-mdev.xml - create mode 100644 tests/data/cli/compare/virt-xml-edit-hostdev-mdev.xml - create mode 100644 tests/data/cli/compare/virt-xml-remove-hostdev-mdev.xml - -diff --git a/tests/data/cli/compare/virt-xml-add-hostdev-mdev-start.xml b/tests/data/cli/compare/virt-xml-add-hostdev-mdev-start.xml -new file mode 100644 -index 00000000..3742d454 ---- /dev/null -+++ b/tests/data/cli/compare/virt-xml-add-hostdev-mdev-start.xml -@@ -0,0 +1,12 @@ -+ -+ -+ -++ -++ -++
-++ -++ -+ -+ -+ -+Domain 'test-state-shutoff' started successfully. -diff --git a/tests/data/cli/compare/virt-xml-add-hostdev-mdev.xml b/tests/data/cli/compare/virt-xml-add-hostdev-mdev.xml -new file mode 100644 -index 00000000..c2acff8f ---- /dev/null -+++ b/tests/data/cli/compare/virt-xml-add-hostdev-mdev.xml -@@ -0,0 +1,14 @@ -+ -+ -+ -++ -++ -++
-++ -++ -+ -+ -+ -+ -+Domain 'test-for-virtxml' defined successfully. -+Changes will take effect after the domain is fully powered off. -diff --git a/tests/data/cli/compare/virt-xml-edit-all.xml b/tests/data/cli/compare/virt-xml-edit-all.xml -index ed09effc..5bdee2aa 100644 ---- a/tests/data/cli/compare/virt-xml-edit-all.xml -+++ b/tests/data/cli/compare/virt-xml-edit-all.xml -@@ -8,6 +8,13 @@ -
- - -++ -+ -+ -+ -+
-+ -+
- + - - -diff --git a/tests/data/cli/compare/virt-xml-edit-hostdev-mdev.xml b/tests/data/cli/compare/virt-xml-edit-hostdev-mdev.xml -new file mode 100644 -index 00000000..ef5523db ---- /dev/null -+++ b/tests/data/cli/compare/virt-xml-edit-hostdev-mdev.xml -@@ -0,0 +1,11 @@ -+ -+
-+ -+-
-++
-+ -+ -+ -+ -+Domain 'test-for-virtxml' defined successfully. -+Changes will take effect after the domain is fully powered off. -diff --git a/tests/data/cli/compare/virt-xml-edit-simple-redirdev.xml b/tests/data/cli/compare/virt-xml-edit-simple-redirdev.xml -index 52ffddfe..f1a0ff6c 100644 ---- a/tests/data/cli/compare/virt-xml-edit-simple-redirdev.xml -+++ b/tests/data/cli/compare/virt-xml-edit-simple-redirdev.xml -@@ -1,5 +1,5 @@ - -- -+
- - - - - -diff --git a/tests/data/cli/compare/virt-xml-remove-hostdev-mdev.xml b/tests/data/cli/compare/virt-xml-remove-hostdev-mdev.xml -new file mode 100644 -index 00000000..d4c33804 ---- /dev/null -+++ b/tests/data/cli/compare/virt-xml-remove-hostdev-mdev.xml -@@ -0,0 +1,15 @@ -+ -+ -+ -+- -+- -+-
-+- -+-
-+- -+ -+ -+ -+ -+Domain 'test-for-virtxml' defined successfully. -+Changes will take effect after the domain is fully powered off. -diff --git a/tests/data/testdriver/testsuite.xml b/tests/data/testdriver/testsuite.xml -index fd255138..a073cbce 100644 ---- a/tests/data/testdriver/testsuite.xml -+++ b/tests/data/testdriver/testsuite.xml -@@ -259,6 +259,12 @@ - - - -+ -+ -+
-+ -+
-+ - - - -@@ -737,5 +743,31 @@ - - - -+ -+ mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110 -+ /sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110 -+ css_0_0_0023 -+ -+ vfio_mdev -+ -+ -+ -+ -+ -+ -+ -+ -+ mdev_b1ae8bf6_38b0_4c81_9d44_78ce3f520496 -+ /sys/devices/css0/0.0.0023/b1ae8bf6-38b0-4c81-9d44-78ce3f520496 -+ css_0_0_0023 -+ -+ vfio_mdev -+ -+ -+ -+ -+ -+ -+ - - -diff --git a/tests/test_cli.py b/tests/test_cli.py -index 092e087a..4b714e3e 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -1274,6 +1274,7 @@ c.add_compare("--edit mac=00:11:7f:33:44:55 --network target=nic55", "edit-selec - c.add_compare("--edit target=hda --disk boot_order=1", "edit-select-disk-bootorder") - c.add_compare("--edit path=/dev/null --disk path=,target=fdb,boot_order=12", "edit-disk-unset") # --disk matching, using empty value to unset path - c.add_compare("--edit --memballoon none", "edit-disable-memballoon") -+c.add_compare("--edit address.devno=0x0002 --hostdev address.devno=0x0008", "edit-hostdev-mdev") - - c = vixml.add_category("edit and start selection", "test-state-shutoff --print-diff --start") - c.add_compare("--define --edit target=vda --disk boot_order=1", "start-select-disk-bootorder") -@@ -1308,6 +1309,8 @@ c.add_compare("--remove-device --disk /dev/null", "remove-disk-path") - c.add_compare("--remove-device --video all", "remove-video-all") - c.add_compare("--remove-device --host-device 0x04b3:0x4485", "remove-hostdev-name") - c.add_compare("--remove-device --memballoon all", "remove-memballoon") -+c.add_compare("--add-device --hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110", "add-hostdev-mdev") -+c.add_compare("--remove-device --hostdev mdev_b1ae8bf6_38b0_4c81_9d44_78ce3f520496", "remove-hostdev-mdev") - - c = vixml.add_category("add/rm devices and start", "test-state-shutoff --print-diff --start") - c.add_invalid("--add-device --pm suspend_to_disk=yes") # --add-device without a device -@@ -1318,6 +1321,7 @@ c.add_compare("--define --add-device --host-device usb_device_4b3_4485_noserial" - c.add_compare("--add-device --disk %(EXISTIMG1)s,bus=virtio,target=vdf", "add-disk-basic-start") - c.add_compare("--add-device --disk %(NEWIMG1)s,size=.01", "add-disk-create-storage-start") - c.add_compare("--remove-device --disk /dev/null", "remove-disk-path-start") -+c.add_compare("--add-device --hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110", "add-hostdev-mdev-start") - - c = vixml.add_category("add/rm devices OS KVM", "--connect %(URI-KVM)s test --print-diff --define") - c.add_compare("--add-device --disk %(EXISTIMG1)s", "kvm-add-disk-os-from-xml") # Guest OS (none) from XML -diff --git a/tests/utils.py b/tests/utils.py -index 16ba26b4..62443ca8 100644 ---- a/tests/utils.py -+++ b/tests/utils.py -@@ -231,7 +231,7 @@ def diff_compare(actual_out, filename=None, expect_out=None): - open(filename, "w").write(actual_out) - expect_out = open(filename).read() - -- diff = xmlutil.diff(expect_out, actual_out, -+ diff = xmlutil.diff(expect_out.rstrip(), actual_out.rstrip(), - filename or '', "Generated output") - if diff: - raise AssertionError("Conversion outputs did not match.\n%s" % diff) --- -2.31.1 - diff --git a/SOURCES/virt-manager-urlfetcher-Add-xorriso-ISOReader-implementation.patch b/SOURCES/virt-manager-urlfetcher-Add-xorriso-ISOReader-implementation.patch deleted file mode 100644 index 3521d45..0000000 --- a/SOURCES/virt-manager-urlfetcher-Add-xorriso-ISOReader-implementation.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 2bda38a197a780a85e9ce448ea81a81fe866c981 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Wed, 7 Apr 2021 11:45:00 -0400 -Subject: [PATCH] urlfetcher: Add xorriso ISOReader implementation - -xorisso is the still maintained isoinfo alternative, and may be -the only iso reading tool in RHEL9, so we need to support it. -Make it the default for our spec file and test suite too - -Signed-off-by: Cole Robinson -(cherry picked from commit f793986378f84bb409d2451bdb62ca08fd4cb5b4) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973236 - -Signed-off-by: Jonathon Jongsma ---- - man/virt-install.rst | 2 +- - tests/test_cli.py | 12 ++++----- - virt-manager.spec | 4 +-- - virtinst/install/urldetect.py | 4 +-- - virtinst/install/urlfetcher.py | 48 +++++++++++++++++++++++++--------- - 5 files changed, 47 insertions(+), 23 deletions(-) - -diff --git a/man/virt-install.rst b/man/virt-install.rst -index 963f9564..f75af635 100644 ---- a/man/virt-install.rst -+++ b/man/virt-install.rst -@@ -617,7 +617,7 @@ ftp://host/path - An FTP server location containing an installable distribution image. - - ISO -- Probe the ISO and extract files using 'isoinfo' -+ Extract files directly from the ISO path - - DIRECTORY - Path to a local directory containing an installable distribution image. -diff --git a/tests/test_cli.py b/tests/test_cli.py -index 5e69a135..3534e0e2 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -39,7 +39,7 @@ MEDIA_DIR = os.path.relpath(utils.DATADIR + "/fakemedia", utils.TOPDIR) - UNATTENDED_DIR = XMLDIR + "/unattended" - OLD_OSINFO = utils.has_old_osinfo() - NO_OSINFO_UNATTEND = not unattended.OSInstallScript.have_new_libosinfo() --HAS_ISOINFO = shutil.which("isoinfo") -+HAS_xorriso = shutil.which("xorriso") - - # We use this check as a surrogate for a released libosinfo with a bug - # fix we need to get full test coverage -@@ -100,9 +100,9 @@ def has_old_osinfo(): - return "osinfo is too old" - - --def missing_isoinfo(): -- if not HAS_ISOINFO: -- return "isoinfo not installed" -+def missing_xorriso(): -+ if not HAS_xorriso: -+ return "xorriso not installed" - - - def no_osinfo_unattend_cb(): -@@ -995,8 +995,8 @@ c.add_compare("--connect " + utils.URIs.kvm_session + " --disk size=8 --os-varia - c.add_valid("--connect " + utils.URIs.kvm_session + " --install fedora21", prerun_check=has_old_osinfo) # hits some get_search_paths and media_upload code paths - - # misc KVM config tests --c.add_compare("--disk none --location %(ISO-NO-OS)s,kernel=frib.img,initrd=/frob.img", "location-manual-kernel", prerun_check=missing_isoinfo) # --location with an unknown ISO but manually specified kernel paths --c.add_compare("--disk %(EXISTIMG1)s --location %(ISOTREE)s --nonetworks", "location-iso", prerun_check=missing_isoinfo) # Using --location iso mounting -+c.add_compare("--disk none --location %(ISO-NO-OS)s,kernel=frib.img,initrd=/frob.img", "location-manual-kernel", prerun_check=missing_xorriso) # --location with an unknown ISO but manually specified kernel paths -+c.add_compare("--disk %(EXISTIMG1)s --location %(ISOTREE)s --nonetworks", "location-iso", prerun_check=missing_xorriso) # Using --location iso mounting - c.add_compare("--disk %(EXISTIMG1)s --cdrom %(ISOLABEL)s", "cdrom-centos-label") # Using --cdrom with centos CD label, should use virtio etc. - c.add_compare("--disk %(EXISTIMG1)s --install bootdev=network --os-variant rhel5.4 --cloud-init none", "kvm-rhel5") # RHEL5 defaults - c.add_compare("--disk %(EXISTIMG1)s --install kernel=%(ISO-WIN7)s,initrd=%(ISOLABEL)s,kernel_args='foo bar' --os-variant rhel6.4 --unattended none", "kvm-rhel6") # RHEL6 defaults. ISO paths are just to point at existing files -diff --git a/virt-manager.spec b/virt-manager.spec -index f523551b..3946c300 100644 ---- a/virt-manager.spec -+++ b/virt-manager.spec -@@ -71,8 +71,8 @@ Requires: python3-requests - Requires: libosinfo >= 0.2.10 - # Required for gobject-introspection infrastructure - Requires: python3-gobject-base --# Required for pulling files from iso media with isoinfo --Requires: genisoimage -+# Required for pulling files from iso media -+Requires: xorriso - - %description common - Common files used by the different virt-manager interfaces, as well as -diff --git a/virtinst/install/urldetect.py b/virtinst/install/urldetect.py -index a73b0bf1..f5ed0270 100644 ---- a/virtinst/install/urldetect.py -+++ b/virtinst/install/urldetect.py -@@ -40,9 +40,9 @@ class _DistroCache(object): - if path not in self._filecache: - try: - content = self._fetcher.acquireFileContent(path) -- except ValueError: -+ except ValueError as e: - content = None -- log.debug("Failed to acquire file=%s", path) -+ log.debug("Failed to acquire file=%s: %s", path, e) - self._filecache[path] = content - return self._filecache[path] - -diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py -index 3cacab1a..835c9e40 100644 ---- a/virtinst/install/urlfetcher.py -+++ b/virtinst/install/urlfetcher.py -@@ -26,7 +26,7 @@ class _ISOReader: - def __init__(self, location): - self._location = location - -- def grabFile(self, url): -+ def grabFile(self, url, scratchdir): - raise NotImplementedError() - def hasFile(self, url): - raise NotImplementedError() -@@ -43,20 +43,50 @@ class _ISOinfoReader(_ISOReader): - def _make_file_list(self): - cmd = ["isoinfo", "-J", "-i", self._location, "-f"] - -- log.debug("Running isoinfo: %s", cmd) -+ log.debug("Generating iso filelist: %s", cmd) - output = subprocess.check_output(cmd, stderr=subprocess.DEVNULL) - return output.splitlines(False) - -- def grabFile(self, url): -+ def grabFile(self, url, scratchdir): -+ ignore = scratchdir - cmd = ["isoinfo", "-J", "-i", self._location, "-x", url] - -- log.debug("Running isoinfo: %s", cmd) -+ log.debug("Extracting iso file: %s", cmd) - return subprocess.check_output(cmd) - - def hasFile(self, url): - return url.encode("ascii") in self._cache_file_list - - -+class _XorrisoReader(_ISOReader): -+ def __init__(self, location): -+ super().__init__(location) -+ self._cache_file_list = self._make_file_list() -+ -+ def _make_file_list(self): -+ delim = "VIRTINST_BEGINLIST" -+ cmd = ["xorriso", "-indev", self._location, "-print", delim, "-find"] -+ -+ log.debug("Generating iso filelist: %s", cmd) -+ output = subprocess.check_output(cmd, -+ stderr=subprocess.DEVNULL, text=True) -+ return output.split(delim, 1)[1].strip().splitlines() -+ -+ def grabFile(self, url, scratchdir): -+ tmp = tempfile.NamedTemporaryFile( -+ prefix="virtinst-iso", suffix="-" + os.path.basename(url), -+ dir=scratchdir) -+ -+ cmd = ["xorriso", "-osirrox", "on", "-indev", self._location, -+ "-extract", url, tmp.name] -+ log.debug("Extracting iso file: %s", cmd) -+ subprocess.check_output(cmd) -+ return open(tmp.name, "rb").read() -+ -+ def hasFile(self, url): -+ return ("'.%s'" % url) in self._cache_file_list -+ -+ - ########################### - # Fetcher implementations # - ########################### -@@ -349,23 +379,17 @@ class _ISOURLFetcher(_URLFetcher): - - def _get_isoreader(self): - if not self._isoreader: -- self._isoreader = _ISOinfoReader(self.location) -+ self._isoreader = _XorrisoReader(self.location) - return self._isoreader - - def _grabber(self, url): -- """ -- Use isoinfo to grab the file -- """ - if not self._hasFile(url): - raise RuntimeError("iso doesn't have file=%s" % url) - -- output = self._get_isoreader().grabFile(url) -+ output = self._get_isoreader().grabFile(url, self.scratchdir) - return io.BytesIO(output), len(output) - - def _hasFile(self, url): -- """ -- Use isoinfo to list and search for the file -- """ - return self._get_isoreader().hasFile(url) - - --- -2.31.1 - diff --git a/SOURCES/virt-manager-urlfetcher-Delete-the-isoinfo-ISOReader.patch b/SOURCES/virt-manager-urlfetcher-Delete-the-isoinfo-ISOReader.patch deleted file mode 100644 index 93fb64c..0000000 --- a/SOURCES/virt-manager-urlfetcher-Delete-the-isoinfo-ISOReader.patch +++ /dev/null @@ -1,78 +0,0 @@ -From a3017ef3d61139362482d5f3c5d6bf056fe6fb6e Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Sat, 22 May 2021 12:18:22 -0400 -Subject: [PATCH] urlfetcher: Delete the 'isoinfo' ISOReader - -We didn't delete this in the last commit, mostly to make it easier -to revert this commit if it turns out we need to support both isoinfo -and xorriso. Right now I don't know of any reason why that should -be necessary but time will tell. - -If we do go that route it will take more work to teach urlfetcher -to dynamically detect the presence of one or the other, along with -similar tweaks. - -Signed-off-by: Cole Robinson -(cherry picked from commit 08d1a6a2ddd18f88222f9fdffa3f60f42a40bc67) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973236 - -Signed-off-by: Jonathon Jongsma ---- - virtinst/install/urlfetcher.py | 38 +--------------------------------- - 1 file changed, 1 insertion(+), 37 deletions(-) - -diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py -index 835c9e40..838a206a 100644 ---- a/virtinst/install/urlfetcher.py -+++ b/virtinst/install/urlfetcher.py -@@ -22,45 +22,9 @@ from ..logger import log - # isoreader abstraction # - ######################### - --class _ISOReader: -+class _XorrisoReader(): - def __init__(self, location): - self._location = location -- -- def grabFile(self, url, scratchdir): -- raise NotImplementedError() -- def hasFile(self, url): -- raise NotImplementedError() -- -- --class _ISOinfoReader(_ISOReader): -- """ -- Handle reading reading files off an iso -- """ -- def __init__(self, location): -- super().__init__(location) -- self._cache_file_list = self._make_file_list() -- -- def _make_file_list(self): -- cmd = ["isoinfo", "-J", "-i", self._location, "-f"] -- -- log.debug("Generating iso filelist: %s", cmd) -- output = subprocess.check_output(cmd, stderr=subprocess.DEVNULL) -- return output.splitlines(False) -- -- def grabFile(self, url, scratchdir): -- ignore = scratchdir -- cmd = ["isoinfo", "-J", "-i", self._location, "-x", url] -- -- log.debug("Extracting iso file: %s", cmd) -- return subprocess.check_output(cmd) -- -- def hasFile(self, url): -- return url.encode("ascii") in self._cache_file_list -- -- --class _XorrisoReader(_ISOReader): -- def __init__(self, location): -- super().__init__(location) - self._cache_file_list = self._make_file_list() - - def _make_file_list(self): --- -2.31.1 - diff --git a/SOURCES/virt-manager-urlfetcher-Factor-out-ISOReader-class.patch b/SOURCES/virt-manager-urlfetcher-Factor-out-ISOReader-class.patch deleted file mode 100644 index c824c07..0000000 --- a/SOURCES/virt-manager-urlfetcher-Factor-out-ISOReader-class.patch +++ /dev/null @@ -1,120 +0,0 @@ -From dae2f3471a56f3967952e6951f60f523060c89a0 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Wed, 7 Apr 2021 09:51:41 -0400 -Subject: [PATCH] urlfetcher: Factor out ISOReader class - -This contains all the isoinfo command logic. This will be used -to add an xorriso backend as well - -Signed-off-by: Cole Robinson -(cherry picked from commit b13b5e0f5edf8efabae643d28f12693f43f094db) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973236 - -Signed-off-by: Jonathon Jongsma ---- - virtinst/install/urlfetcher.py | 64 +++++++++++++++++++++++++--------- - 1 file changed, 48 insertions(+), 16 deletions(-) - -diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py -index f531fe50..3cacab1a 100644 ---- a/virtinst/install/urlfetcher.py -+++ b/virtinst/install/urlfetcher.py -@@ -18,6 +18,45 @@ import requests - from ..logger import log - - -+######################### -+# isoreader abstraction # -+######################### -+ -+class _ISOReader: -+ def __init__(self, location): -+ self._location = location -+ -+ def grabFile(self, url): -+ raise NotImplementedError() -+ def hasFile(self, url): -+ raise NotImplementedError() -+ -+ -+class _ISOinfoReader(_ISOReader): -+ """ -+ Handle reading reading files off an iso -+ """ -+ def __init__(self, location): -+ super().__init__(location) -+ self._cache_file_list = self._make_file_list() -+ -+ def _make_file_list(self): -+ cmd = ["isoinfo", "-J", "-i", self._location, "-f"] -+ -+ log.debug("Running isoinfo: %s", cmd) -+ output = subprocess.check_output(cmd, stderr=subprocess.DEVNULL) -+ return output.splitlines(False) -+ -+ def grabFile(self, url): -+ cmd = ["isoinfo", "-J", "-i", self._location, "-x", url] -+ -+ log.debug("Running isoinfo: %s", cmd) -+ return subprocess.check_output(cmd) -+ -+ def hasFile(self, url): -+ return url.encode("ascii") in self._cache_file_list -+ -+ - ########################### - # Fetcher implementations # - ########################### -@@ -302,39 +341,32 @@ class _LocalURLFetcher(_URLFetcher): - - - class _ISOURLFetcher(_URLFetcher): -- _cache_file_list = None -+ _isoreader = None - _is_iso = True - - def _make_full_url(self, filename): - return os.path.join("/", filename) - -+ def _get_isoreader(self): -+ if not self._isoreader: -+ self._isoreader = _ISOinfoReader(self.location) -+ return self._isoreader -+ - def _grabber(self, url): - """ - Use isoinfo to grab the file - """ - if not self._hasFile(url): -- raise RuntimeError("isoinfo didn't find file=%s" % url) -- -- cmd = ["isoinfo", "-J", "-i", self.location, "-x", url] -- -- log.debug("Running isoinfo: %s", cmd) -- output = subprocess.check_output(cmd) -+ raise RuntimeError("iso doesn't have file=%s" % url) - -+ output = self._get_isoreader().grabFile(url) - return io.BytesIO(output), len(output) - - def _hasFile(self, url): - """ - Use isoinfo to list and search for the file - """ -- if not self._cache_file_list: -- cmd = ["isoinfo", "-J", "-i", self.location, "-f"] -- -- log.debug("Running isoinfo: %s", cmd) -- output = subprocess.check_output(cmd, stderr=subprocess.DEVNULL) -- -- self._cache_file_list = output.splitlines(False) -- -- return url.encode("ascii") in self._cache_file_list -+ return self._get_isoreader().hasFile(url) - - - class DirectFetcher(_URLFetcher): --- -2.31.1 - diff --git a/SOURCES/virt-manager-urlfetcher-Silence-xorisso-stderr-output.patch b/SOURCES/virt-manager-urlfetcher-Silence-xorisso-stderr-output.patch deleted file mode 100644 index 362db10..0000000 --- a/SOURCES/virt-manager-urlfetcher-Silence-xorisso-stderr-output.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 900413f1fccc3a4f64f66066d851e3a03b821156 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Fri, 30 Jul 2021 10:45:07 -0400 -Subject: [PATCH] urlfetcher: Silence xorisso stderr output - -Signed-off-by: Cole Robinson -(cherry picked from commit 8754a59d9228caacf43bcb1af6ad307da7217b09) - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1973236 - -Signed-off-by: Jonathon Jongsma ---- - virtinst/install/urlfetcher.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/virtinst/install/urlfetcher.py b/virtinst/install/urlfetcher.py -index 838a206a..67a68002 100644 ---- a/virtinst/install/urlfetcher.py -+++ b/virtinst/install/urlfetcher.py -@@ -44,7 +44,7 @@ class _XorrisoReader(): - cmd = ["xorriso", "-osirrox", "on", "-indev", self._location, - "-extract", url, tmp.name] - log.debug("Extracting iso file: %s", cmd) -- subprocess.check_output(cmd) -+ subprocess.check_output(cmd, stderr=subprocess.DEVNULL) - return open(tmp.name, "rb").read() - - def hasFile(self, url): --- -2.31.1 - diff --git a/SOURCES/virt-manager-virt-install-add-mediated-device.patch b/SOURCES/virt-manager-virt-install-add-mediated-device.patch deleted file mode 100644 index 1b7c408..0000000 --- a/SOURCES/virt-manager-virt-install-add-mediated-device.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 06f12e246c206311bc5d7fcbd24ac02df1e3fff9 Mon Sep 17 00:00:00 2001 -From: Shalini Chellathurai Saroja -Date: Wed, 14 Apr 2021 17:18:55 +0200 -Subject: [PATCH] virt-install: add mediated device - -Add support to install a virtual server with passed-through mediated -device. Mediated device can be created using vGPU attached to -vfio_pci driver or DASD attached to vfio_ccw driver or APQNs attached -to vfio_ap driver. - -Reviewed-by: Cole Robinson -Signed-off-by: Shalini Chellathurai Saroja - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1995131 - -(cherry picked from commit 965480e8bc85caf8a4f36b4a2f07963067b63cf6) -Signed-off-by: Jonathon Jongsma ---- - .../cli/compare/virt-install-many-devices.xml | 19 +++++++++ - tests/data/testdriver/testdriver.xml | 40 +++++++++++++++++++ - tests/test_cli.py | 3 ++ - tests/test_nodedev.py | 30 ++++++++++++++ - virtinst/devices/hostdev.py | 36 ++++++++++++++++- - virtinst/nodedev.py | 4 ++ - 6 files changed, 131 insertions(+), 1 deletion(-) - -diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml -index 49e9dcc7..3bd756b3 100644 ---- a/tests/data/cli/compare/virt-install-many-devices.xml -+++ b/tests/data/cli/compare/virt-install-many-devices.xml -@@ -592,6 +592,25 @@ - /dev/pty7 - - -+ -+
-+ -+
-+ -+ -+ -+ -+
-+ -+ -+ -+
-+ -+
-+ -+
-+ -+ - - - -diff --git a/tests/data/testdriver/testdriver.xml b/tests/data/testdriver/testdriver.xml -index ea90f0f7..b8d67bac 100644 ---- a/tests/data/testdriver/testdriver.xml -+++ b/tests/data/testdriver/testdriver.xml -@@ -3645,5 +3645,45 @@ ba - - - -+ -+ mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110 -+ /sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110 -+ css_0_0_0023 -+ -+ vfio_mdev -+ -+ -+ -+ -+ -+ -+ -+ -+ mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9 -+ /sys/devices/vfio_ap/matrix/11f92c9d-b0b0-4016-b306-a8071277f8b9 -+ ap_matrix -+ -+ vfio_mdev -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ mdev_4b20d080_1b54_4048_85b3_a6a62d165c01 -+ /sys/devices/pci0000:00/0000:00:02.0/4b20d080-1b54-4048-85b3-a6a62d165c01 -+ pci_0000_06_00_0 -+ -+ vfio_mdev -+ -+ -+ -+ -+ -+ - - -diff --git a/tests/test_cli.py b/tests/test_cli.py -index 3534e0e2..092e087a 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -675,6 +675,9 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser - --hostdev wlan0,type=net - --hostdev /dev/vdz,type=storage - --hostdev /dev/pty7,type=misc -+--hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110,address.type=ccw,address.cssid=0xfe,address.ssid=0x1,address.devno=0x0008 -+--hostdev mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9 -+--hostdev mdev_4b20d080_1b54_4048_85b3_a6a62d165c01,address.type=pci,address.domain=0x0000,address.bus=0x01,address.slot=0x01,address.function=0x0,address.zpci.uid=0x0001,address.zpci.fid=0x00000001 - - - --filesystem /source,/target,alias.name=testfsalias,driver.ats=on,driver.iommu=off,driver.packed=on -diff --git a/tests/test_nodedev.py b/tests/test_nodedev.py -index 406e321f..79678bc8 100644 ---- a/tests/test_nodedev.py -+++ b/tests/test_nodedev.py -@@ -126,6 +126,36 @@ def testDRMDevice(): - assert dev.get_devnode("frob") - - -+def testDASDMdev(): -+ conn = utils.URIs.open_testdriver_cached() -+ devname = "mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110" -+ dev = _nodeDevFromName(conn, devname) -+ assert dev.name == devname -+ assert dev.parent == "css_0_0_0023" -+ assert dev.device_type == "mdev" -+ assert dev.type_id == "vfio_ccw-io" -+ -+ -+def testAPQNMdev(): -+ conn = utils.URIs.open_testdriver_cached() -+ devname = "mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9" -+ dev = _nodeDevFromName(conn, devname) -+ assert dev.name == devname -+ assert dev.parent == "ap_matrix" -+ assert dev.device_type == "mdev" -+ assert dev.type_id == "vfio_ap-passthrough" -+ -+ -+def testPCIMdev(): -+ conn = utils.URIs.open_testdriver_cached() -+ devname = "mdev_4b20d080_1b54_4048_85b3_a6a62d165c01" -+ dev = _nodeDevFromName(conn, devname) -+ assert dev.name == devname -+ assert dev.parent == "pci_0000_06_00_0" -+ assert dev.device_type == "mdev" -+ assert dev.type_id == "nvidia-11" -+ -+ - # NodeDevice 2 Device XML tests - - def testNodeDev2USB1(): -diff --git a/virtinst/devices/hostdev.py b/virtinst/devices/hostdev.py -index 3e9de2ad..e8d0fae2 100644 ---- a/virtinst/devices/hostdev.py -+++ b/virtinst/devices/hostdev.py -@@ -4,6 +4,8 @@ - # This work is licensed under the GNU GPLv2 or later. - # See the COPYING file in the top-level directory. - -+import re -+ - from .device import Device - from ..nodedev import NodeDevice - from ..xmlbuilder import XMLProperty -@@ -53,16 +55,45 @@ class DeviceHostdev(Device): - self.scsi_unit = nodedev.lun - self.managed = False - -+ elif nodedev.device_type == nodedev.CAPABILITY_TYPE_MDEV: -+ self.type = "mdev" -+ -+ if nodedev.type_id == "vfio_ccw-io": -+ self.model = "vfio-ccw" -+ self.managed = "no" -+ -+ elif nodedev.type_id == "vfio_ap-passthrough": -+ self.model = "vfio-ap" -+ self.managed = "no" -+ -+ elif (re.match("^nvidia-[0-9]{2}", nodedev.type_id) or -+ re.match("^i915-GVTg_V[0-9]_[0-9]", nodedev.type_id)): -+ self.model = "vfio-pci" -+ self.managed = "yes" -+ self.display = "off" -+ self.ramfb = "off" -+ -+ else: -+ raise ValueError( # pragma: no cover -+ _("Don't know how to generate nodedev for mdev type id '%s'") % -+ nodedev.type_id) -+ -+ self.uuid = nodedev.name[5:].replace('_', '-') -+ - else: - raise ValueError(_("Unknown node device type %s") % nodedev) - - - _XML_PROP_ORDER = ["mode", "type", "managed", "vendor", "product", -- "domain", "bus", "slot", "function"] -+ "domain", "bus", "slot", "function", "model", -+ "display", "ramfb"] - - mode = XMLProperty("./@mode") - type = XMLProperty("./@type") - managed = XMLProperty("./@managed", is_yesno=True) -+ model = XMLProperty("./@model") -+ display = XMLProperty("./@display") -+ ramfb = XMLProperty("./@ramfb") - - vendor = XMLProperty("./source/vendor/@id") - product = XMLProperty("./source/product/@id") -@@ -92,6 +123,9 @@ class DeviceHostdev(Device): - # type=misc handling - storage_block = XMLProperty("./source/block") - -+ # type=mdev -+ uuid = XMLProperty("./source/address/@uuid") -+ - - ################## - # Default config # -diff --git a/virtinst/nodedev.py b/virtinst/nodedev.py -index 9d2c8f10..97841794 100644 ---- a/virtinst/nodedev.py -+++ b/virtinst/nodedev.py -@@ -40,6 +40,7 @@ class NodeDevice(XMLBuilder): - CAPABILITY_TYPE_SCSIBUS = "scsi_host" - CAPABILITY_TYPE_SCSIDEV = "scsi" - CAPABILITY_TYPE_DRM = "drm" -+ CAPABILITY_TYPE_MDEV = "mdev" - - @staticmethod - def lookupNodedevFromString(conn, idstring): -@@ -168,6 +169,9 @@ class NodeDevice(XMLBuilder): - if len(self.devnodes) > 0: - return self.devnodes[0] - -+ # type='mdev' options -+ type_id = XMLProperty("./capability/type/@id") -+ - - def _AddressStringToHostdev(conn, addrstr): - from .devices import DeviceHostdev --- -2.31.1 - diff --git a/SOURCES/virt-manager-virt-install-add-support-for-qemu-vdagent-channel.patch b/SOURCES/virt-manager-virt-install-add-support-for-qemu-vdagent-channel.patch new file mode 100644 index 0000000..2759e05 --- /dev/null +++ b/SOURCES/virt-manager-virt-install-add-support-for-qemu-vdagent-channel.patch @@ -0,0 +1,146 @@ +From 6ec78c1b8a935bd5fe0896dc323bfdf51cc67585 Mon Sep 17 00:00:00 2001 +From: Jonathon Jongsma +Date: Wed, 18 May 2022 17:03:29 -0500 +Subject: [PATCH] virt-install: add support for qemu-vdagent channel + +This allows support for host/guest clipboard sharing when using vnc +guests (and possibly other graphics types in the future). This channel +is similar to the spicevmc channel, but it contains a couple additional +options to enable/disable clipboard sharing and specify the mouse mode. +In the case of spice, these settings are specified on the 'graphics' +element, but for qemu-vdagent, they are specified on the channel. For +example: + + --channel=qemu-vdagent,source.clipboard.copypaste=on,source.mouse.mode=client + +Signed-off-by: Jonathon Jongsma +(cherry picked from commit 44355e5ed0d0791675e8113732dde37664d5aa91) + +Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2060724 + +Signed-off-by: Jonathon Jongsma +--- + man/virt-install.rst | 9 +++++++++ + tests/data/cli/compare/virt-install-many-devices.xml | 7 +++++++ + tests/test_cli.py | 5 +++-- + virtinst/cli.py | 2 ++ + virtinst/devices/char.py | 8 +++++++- + 5 files changed, 28 insertions(+), 3 deletions(-) + +diff --git a/man/virt-install.rst b/man/virt-install.rst +index c1d1c1aa1..3a6e8dcd2 100644 +--- a/man/virt-install.rst ++++ b/man/virt-install.rst +@@ -1761,6 +1761,15 @@ Some of the types of character device redirection are: + and can be any string, such as the default com.redhat.spice.0 that + specifies how the guest will see the channel. + ++``--channel qemu-vdagent,target.type=virtio[,target.name=NAME]`` ++ Communication channel for QEMU vd agent, using virtio serial (requires ++ 2.6.34 or later host and guest). This allows copy/paste functionality with ++ VNC guests. Note that the guest clipboard integration is implemented via ++ spice-vdagent, which must be running even when the guest does not use spice ++ graphics. NAME is optional metadata that specifies how the guest will see ++ the channel, and should be left as the default com.redhat.spice.0 unless you ++ know what you are doing. ++ + + Use --channel=? to see a list of all available sub options. + Complete details at https://libvirt.org/formatdomain.html#elementsCharChannel +diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml +index 4c0024225..be82032fe 100644 +--- a/tests/data/cli/compare/virt-install-many-devices.xml ++++ b/tests/data/cli/compare/virt-install-many-devices.xml +@@ -647,6 +647,13 @@ + + + ++ ++ ++ ++ ++ ++ ++ + + + +diff --git a/tests/test_cli.py b/tests/test_cli.py +index 8b78a1a78..22749d43a 100644 +--- a/tests/test_cli.py ++++ b/tests/test_cli.py +@@ -669,6 +669,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser + --channel pty,target_type=virtio,name=org.linux-kvm.port1 + --channel pty,target.type=virtio,target.name=org.linux-kvm.port2 + --channel spicevmc ++--channel qemu-vdagent,source.clipboard.copypaste=on,source.mouse.mode=client + + + --console pty,target_type=virtio +@@ -734,7 +735,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser + + + --rng /dev/random +---rng device=/dev/urandom,backend.protocol.type=,backend.log.file=,backend.log.append= ++--rng device=/dev/urandom,backend.protocol.type=,backend.log.file=,backend.log.append=,backend.source.clipboard.copypaste=,backend.source.mouse.mode= + --rng type=egd,backend.type=nmdm,backend.source.master=/dev/foo1,backend.source.slave=/dev/foo2 + --rng egd,backend_host=127.0.0.1,backend_service=8000,backend_type=udp,backend_mode=bind,backend_connect_host=foo,backend_connect_service=708,rate.bytes=1234,rate.period=1000,model=virtio + +@@ -786,7 +787,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser + --xml xpath.delete=./deleteme/deleteme2 + + +-""", "many-devices", predefine_check="7.4.0") ++""", "many-devices", predefine_check="8.4.0") + + + # Specific XML test cases #1 +diff --git a/virtinst/cli.py b/virtinst/cli.py +index 52be9f298..c869c323a 100644 +--- a/virtinst/cli.py ++++ b/virtinst/cli.py +@@ -3396,6 +3396,8 @@ def _add_char_source_args(cls, prefix=""): + _add_arg("protocol.type", "source.protocol") + _add_arg("log.file", "source.log_file") + _add_arg("log.append", "source.log_append", is_onoff=True) ++ _add_arg("source.clipboard.copypaste", "source.clipboard_copypaste", is_onoff=True) ++ _add_arg("source.mouse.mode", "source.mouse_mode") + + + ################## +diff --git a/virtinst/devices/char.py b/virtinst/devices/char.py +index 9547c649e..01fc634b1 100644 +--- a/virtinst/devices/char.py ++++ b/virtinst/devices/char.py +@@ -45,6 +45,10 @@ class CharSource(XMLBuilder): + slave = XMLProperty("./@slave") + mode = XMLProperty("./@mode") + ++ # for qemu-vdagent channel ++ clipboard_copypaste = XMLProperty("./clipboard/@copypaste", is_yesno=True) ++ mouse_mode = XMLProperty("./mouse/@mode") ++ + # It's weird to track these properties here, since the XML is set on + # the parent, but this is how libvirt does it internally, which means + # everything that shares a charsource has these values too. +@@ -80,6 +84,7 @@ class _DeviceChar(Device): + TYPE_SPICEVMC = "spicevmc" + TYPE_SPICEPORT = "spiceport" + TYPE_NMDM = "nmdm" ++ TYPE_QEMUVDAGENT = "qemu-vdagent" + + CHANNEL_NAME_SPICE = "com.redhat.spice.0" + CHANNEL_NAME_QEMUGA = "org.qemu.guest_agent.0" +@@ -117,7 +122,8 @@ class _DeviceChar(Device): + self.source.mode = "bind" + if not self.target_type and self.DEVICE_TYPE == "channel": + self.target_type = "virtio" +- if not self.target_name and self.type == self.TYPE_SPICEVMC: ++ if not self.target_name and (self.type == self.TYPE_SPICEVMC or ++ self.type == self.TYPE_QEMUVDAGENT): + self.target_name = self.CHANNEL_NAME_SPICE + + +-- +2.35.3 + diff --git a/SOURCES/virt-manager-virt-manager-add-support-for-qemu-vdagent-channel.patch b/SOURCES/virt-manager-virt-manager-add-support-for-qemu-vdagent-channel.patch new file mode 100644 index 0000000..506f9f7 --- /dev/null +++ b/SOURCES/virt-manager-virt-manager-add-support-for-qemu-vdagent-channel.patch @@ -0,0 +1,231 @@ +From e4e7210b3bd669bfeb8015f66163e7e49d710d1d Mon Sep 17 00:00:00 2001 +From: Jonathon Jongsma +Date: Wed, 18 May 2022 17:03:30 -0500 +Subject: [PATCH] virt-manager: add support for qemu-vdagent channel + + This provides the UI support for the qemu-vdagent channel which allows + clipboard sharing with VNC graphics (see previous commit for more + information). + + The channel name in the device list was changed slightly in order to + avoid confusion. Due to the fact that both the spice-vdagent and the + qemu-vdagent specify the same virtio name (com.redhat.spice.0), both of + these channels were showing up in the device list as "Channel spice", + which is a bit confusing. + + In order to disambiguate these, channels now show up in the device list + as "Channel {type} ({name})" instead of "Channel {name}". So for + example, a qemu-vdagent channel would show up as: + Channel Qemu vdagent (spice) +Whereas a spice-vdagent channel would show up as: + Channel Spice agent (spice) + +Signed-off-by: Jonathon Jongsma +(cherry picked from commit caa99a6001be0c86a1dd0eb5fc0ce142ab929a31) + +Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2060724 + +Signed-off-by: Jonathon Jongsma +--- + ui/addhardware.ui | 28 +++++++++++++++++++++++++++- + ui/details.ui | 27 ++++++++++++++++++++++++++- + virtManager/addhardware.py | 10 +++++++++- + virtManager/details/details.py | 7 +++++-- + 4 files changed, 67 insertions(+), 5 deletions(-) + +diff --git a/ui/addhardware.ui b/ui/addhardware.ui +index fa88127b8..f212481a3 100644 +--- a/ui/addhardware.ui ++++ b/ui/addhardware.ui +@@ -725,7 +725,7 @@ + + + +- ++ + + True + False +@@ -901,6 +901,32 @@ + 2 + + ++ ++ ++ True ++ False ++ _Share Clipboard: ++ True ++ char-vdagent-clipboard ++ ++ ++ 0 ++ 6 ++ ++ ++ ++ ++ True ++ True ++ False ++ start ++ True ++ ++ ++ 1 ++ 6 ++ ++ + + + char-tab +diff --git a/ui/details.ui b/ui/details.ui +index 10b308242..264f7cdd4 100644 +--- a/ui/details.ui ++++ b/ui/details.ui +@@ -3506,7 +3506,7 @@ + 12 + 3 + +- ++ + + True + False +@@ -3601,6 +3601,19 @@ + 6 + + ++ ++ ++ True ++ False ++ start ++ label507 ++ True ++ ++ ++ 1 ++ 7 ++ ++ + + + True +@@ -3673,6 +3686,18 @@ + 6 + + ++ ++ ++ True ++ False ++ end ++ Clipboard: ++ ++ ++ 0 ++ 7 ++ ++ + + + True +diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py +index 8c7fa0c72..0a8e33d30 100644 +--- a/virtManager/addhardware.py ++++ b/virtManager/addhardware.py +@@ -308,6 +308,7 @@ class vmmAddHardware(vmmGObjectUI): + self.widget("char-path").set_text("") + self.widget("char-channel").set_text("") + self.widget("char-auto-socket").set_active(True) ++ self.widget("char-vdagent-clipboard").set_active(True) + + + # RNG params +@@ -399,7 +400,8 @@ class vmmAddHardware(vmmGObjectUI): + DeviceSerial.TYPE_UNIX] + if char_class.XML_NAME == "channel": + ret = [DeviceSerial.TYPE_SPICEVMC, +- DeviceSerial.TYPE_SPICEPORT] + ret ++ DeviceSerial.TYPE_SPICEPORT, ++ DeviceSerial.TYPE_QEMUVDAGENT] + ret + return ret + + @staticmethod +@@ -425,6 +427,7 @@ class vmmAddHardware(vmmGObjectUI): + DeviceSerial.TYPE_UNIX: _("UNIX socket"), + DeviceSerial.TYPE_SPICEVMC: _("Spice agent"), + DeviceSerial.TYPE_SPICEPORT: _("Spice port"), ++ DeviceSerial.TYPE_QEMUVDAGENT: _("QEMU vdagent"), + } + return labels.get(val, val) + +@@ -1114,11 +1117,14 @@ class vmmAddHardware(vmmGObjectUI): + supports_path = [dev.TYPE_FILE, dev.TYPE_UNIX, + dev.TYPE_DEV, dev.TYPE_PIPE] + supports_channel = [dev.TYPE_SPICEPORT] ++ supports_clipboard = [dev.TYPE_QEMUVDAGENT] + + uiutil.set_grid_row_visible(self.widget("char-path-label"), + devtype in supports_path) + uiutil.set_grid_row_visible(self.widget("char-channel-label"), + devtype in supports_channel) ++ uiutil.set_grid_row_visible(self.widget("char-vdagent-clipboard-label"), ++ devtype in supports_clipboard) + + uiutil.set_grid_row_visible( + self.widget("char-target-name-label"), ischan) +@@ -1472,6 +1478,7 @@ class vmmAddHardware(vmmGObjectUI): + source_channel = self.widget("char-channel").get_text() + target_name = self.widget("char-target-name").get_child().get_text() + target_type = uiutil.get_list_selection(typebox) ++ clipboard = self.widget("char-vdagent-clipboard").get_active() + + if not self.widget("char-path").get_visible(): + source_path = None +@@ -1486,6 +1493,7 @@ class vmmAddHardware(vmmGObjectUI): + dev.type = devtype + dev.source.path = source_path + dev.source.channel = source_channel ++ dev.source.clipboard_copypaste = clipboard + dev.target_name = target_name + dev.target_type = target_type + return dev +diff --git a/virtManager/details/details.py b/virtManager/details/details.py +index 24810f0ff..ddc43b767 100644 +--- a/virtManager/details/details.py ++++ b/virtManager/details/details.py +@@ -207,10 +207,10 @@ def _label_for_device(dev, disk_bus_index): + return _("Console %(num)d") % {"num": port + 1} + + if devtype == "channel": ++ pretty_type = vmmAddHardware.char_pretty_type(dev.type) + name = vmmAddHardware.char_pretty_channel_name(dev.target_name) + if name: +- return _("Channel %(name)s") % {"name": name} +- pretty_type = vmmAddHardware.char_pretty_type(dev.type) ++ return _("Channel %(type)s (%(name)s)") % {"type": pretty_type, "name": name} + return _("Channel %(type)s") % {"type": pretty_type} + + if devtype == "graphics": +@@ -2098,6 +2098,7 @@ class vmmDetails(vmmGObjectUI): + primary = self.vm.serial_is_console_dup(chardev) + show_target_type = not (char_type in ["serial", "parallel"]) + is_qemuga = chardev.target_name == chardev.CHANNEL_NAME_QEMUGA ++ show_clipboard = chardev.type == chardev.TYPE_QEMUVDAGENT + + if char_type == "serial": + typelabel = _("Serial Device") +@@ -2152,6 +2153,8 @@ class vmmDetails(vmmGObjectUI): + # notifiations about connection state. For spice this UI field + # can get out of date + show_ui("char-target-state", chardev.target_state, doshow=is_qemuga) ++ clipboard = _("On") if chardev.source.clipboard_copypaste else _("Off") ++ show_ui("char-clipboard-sharing", clipboard, doshow=show_clipboard) + + def _refresh_hostdev_page(self, hostdev): + rom_bar = hostdev.rom_bar +-- +2.35.3 + diff --git a/SOURCES/virt-manager-virt-manager-enable-MDEV-support.patch b/SOURCES/virt-manager-virt-manager-enable-MDEV-support.patch deleted file mode 100644 index 02de13c..0000000 --- a/SOURCES/virt-manager-virt-manager-enable-MDEV-support.patch +++ /dev/null @@ -1,164 +0,0 @@ -From fe341d97aee2666dc378f89de4a957bc8ae35a21 Mon Sep 17 00:00:00 2001 -From: Shalini Chellathurai Saroja -Date: Mon, 7 Jun 2021 11:34:21 +0200 -Subject: [PATCH] virt-manager: enable MDEV support - -Enable virt-manager GUI to support add, edit, remove, hot-plug and -hot-unplug of mediated devices (like DASDs, APQNs and PCIs) in virtual -server. - -It is not possible to edit MDEV when a virtual server is in -running state, as this is not supported by libvirt. - -Reviewed-by: Cole Robinson -Signed-off-by: Shalini Chellathurai Saroja - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1995131 - -(cherry picked from commit 0e15cd51dfbdaa09f7d34ed1edce2f5416130361) -Signed-off-by: Jonathon Jongsma ---- - tests/data/testdriver/testdriver.xml | 39 ++++++++++++++++++++++++++++ - tests/uitests/test_addhardware.py | 6 +++++ - virtManager/addhardware.py | 19 +++++++++++++- - 3 files changed, 63 insertions(+), 1 deletion(-) - -diff --git a/tests/data/testdriver/testdriver.xml b/tests/data/testdriver/testdriver.xml -index b8d67bac..5875732a 100644 ---- a/tests/data/testdriver/testdriver.xml -+++ b/tests/data/testdriver/testdriver.xml -@@ -3645,6 +3645,27 @@ ba - - - -+ -+ css_0_0_0023 -+ /sys/devices/css0/0.0.0023 -+ computer -+ -+ vfio_ccw -+ -+ -+ 0x0 -+ 0x0 -+ 0x0023 -+ -+ -+ I/O subchannel (Non-QDIO) -+ vfio-ccw -+ 0 -+ -+ -+ -+ -+ - - mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110 - /sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110 -@@ -3658,6 +3679,24 @@ ba - - - -+ -+ ap_matrix -+ /sys/devices/vfio_ap/matrix -+ computer -+ -+ vfio_ap -+ -+ -+ -+ -+ VFIO AP Passthrough Device -+ vfio-ap -+ 65536 -+ -+ -+ -+ -+ - - mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9 - /sys/devices/vfio_ap/matrix/11f92c9d-b0b0-4016-b306-a8071277f8b9 -diff --git a/tests/uitests/test_addhardware.py b/tests/uitests/test_addhardware.py -index ce3da57c..56acc2fa 100644 ---- a/tests/uitests/test_addhardware.py -+++ b/tests/uitests/test_addhardware.py -@@ -459,6 +459,12 @@ def testAddHosts(app): - app.click_alert_button("device is already in use by", "Yes") - lib.utils.check(lambda: details.active) - -+ # Add MDEV device -+ _open_addhw(app, details) -+ tab = _select_hw(addhw, "MDEV Host Device", "host-tab") -+ tab.find_fuzzy("mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110", -+ "table cell").click() -+ _finish(addhw, check=details) - - - def testAddChars(app): -diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py -index cbf19f58..13b899c3 100644 ---- a/virtManager/addhardware.py -+++ b/virtManager/addhardware.py -@@ -249,6 +249,10 @@ class vmmAddHardware(vmmGObjectUI): - add_hw_option(_("PCI Host Device"), "system-run", PAGE_HOSTDEV, - nodedev_enabled, nodedev_errstr, "pci") - -+ add_hw_option(_("MDEV Host Device"), "system-run", PAGE_HOSTDEV, -+ self.conn.support.conn_nodedev(), -+ _("Connection does not support host device enumeration"), -+ "mdev") - add_hw_option(_("Video"), "video-display", PAGE_VIDEO, True, - _("Libvirt version does not support video devices.")) - add_hw_option(_("Watchdog"), "device_pci", PAGE_WATCHDOG, -@@ -656,6 +660,9 @@ class vmmAddHardware(vmmGObjectUI): - (dehex(hostdev.domain), dehex(hostdev.bus), - dehex(hostdev.slot), dehex(hostdev.function))) - -+ elif hostdev.uuid: -+ label += " %s" % (str(hostdev.uuid)) -+ - return label - - -@@ -775,6 +782,12 @@ class vmmAddHardware(vmmGObjectUI): - if dev.xmlobj.name == subdev.xmlobj.parent: - prettyname += " (%s)" % subdev.pretty_name() - -+ if devtype == "mdev": -+ for parentdev in self.conn.list_nodedevs(): -+ if dev.xmlobj.parent == parentdev.xmlobj.name: -+ prettyname = "%s %s" % ( -+ parentdev.pretty_name(), prettyname) -+ - model.append([dev.xmlobj, prettyname]) - - if len(model) == 0: -@@ -981,11 +994,13 @@ class vmmAddHardware(vmmGObjectUI): - - if page == PAGE_HOSTDEV: - # Need to do this here, since we share the hostdev page -- # between two different HW options -+ # between different HW options - row = self._get_hw_selection() - devtype = "usb_device" - if row and row[5] == "pci": - devtype = "pci" -+ if row and row[5] == "mdev": -+ devtype = "mdev" - self._populate_hostdev_model(devtype) - - if page == PAGE_CONTROLLER: -@@ -1036,6 +1051,8 @@ class vmmAddHardware(vmmGObjectUI): - row = self._get_hw_selection() - if row and row[5] == "pci": - return _("PCI Device") -+ if row and row[5] == "mdev": -+ return _("MDEV Device") - return _("USB Device") - - raise RuntimeError("Unknown page %s" % page) # pragma: no cover --- -2.31.1 - diff --git a/SOURCES/virt-manager-virt-xml-add-support-for-mediated-devices.patch b/SOURCES/virt-manager-virt-xml-add-support-for-mediated-devices.patch deleted file mode 100644 index 7ef886d..0000000 --- a/SOURCES/virt-manager-virt-xml-add-support-for-mediated-devices.patch +++ /dev/null @@ -1,77 +0,0 @@ -From d4a11d8f8a0b7990c9d349da2306c7f4103a43e0 Mon Sep 17 00:00:00 2001 -From: Shalini Chellathurai Saroja -Date: Mon, 31 May 2021 21:54:26 +0200 -Subject: [PATCH] virt-xml: add support for mediated devices - -Provide support to add/remove MDEV in a guest domain, which is in -shut-off or running state (hotplug/unplug). Also support update of -already existing MDEV device, when the guest domain is in shut-off -state. Please note that libvirt does not support update of MDEV -device, when the guest domain is in running state. - -Reviewed-by: Cole Robinson -Signed-off-by: Shalini Chellathurai Saroja - -Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1995131 - -(cherry picked from commit 9363e1e692bb0d01184ecc7991d61c95542f690b) -Signed-off-by: Jonathon Jongsma ---- - virtinst/nodedev.py | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/virtinst/nodedev.py b/virtinst/nodedev.py -index 97841794..f54a311c 100644 ---- a/virtinst/nodedev.py -+++ b/virtinst/nodedev.py -@@ -5,6 +5,7 @@ - # See the COPYING file in the top-level directory. - - import os -+import uuid - - from .logger import log - from .xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty -@@ -25,6 +26,16 @@ def _compare_int(nodedev_val, hostdev_val): - return (nodedev_val == hostdev_val or hostdev_val == -1) - - -+def _compare_uuid(nodedev_val, hostdev_val): -+ try: -+ nodedev_val = uuid.UUID(nodedev_val) -+ hostdev_val = uuid.UUID(hostdev_val) -+ except Exception: # pragma: no cover -+ return -1 -+ -+ return (nodedev_val == hostdev_val) -+ -+ - class DevNode(XMLBuilder): - XML_NAME = "devnode" - -@@ -82,6 +93,9 @@ class NodeDevice(XMLBuilder): - parent = XMLProperty("./parent") - device_type = XMLProperty("./capability/@type") - -+ def get_mdev_uuid(self): -+ return self.name[5:].replace('_', '-') -+ - def compare_to_hostdev(self, hostdev): - if self.device_type == "pci": - if hostdev.type != "pci": -@@ -101,6 +115,12 @@ class NodeDevice(XMLBuilder): - _compare_int(self.bus, hostdev.bus) and - _compare_int(self.device, hostdev.device)) - -+ if self.device_type == "mdev": -+ if hostdev.type != "mdev": -+ return False -+ -+ return _compare_uuid(self.get_mdev_uuid(), hostdev.uuid) -+ - return False - - --- -2.31.1 - diff --git a/SPECS/virt-manager.spec b/SPECS/virt-manager.spec index ebef992..16755d1 100644 --- a/SPECS/virt-manager.spec +++ b/SPECS/virt-manager.spec @@ -7,8 +7,8 @@ # End local config Name: virt-manager -Version: 3.2.0 -Release: 14%{?dist}%{?extra_release} +Version: 4.0.0 +Release: 1%{?dist}%{?extra_release} %global verrel %{version}-%{release} Summary: Desktop tool for managing virtual machines via libvirt @@ -16,30 +16,15 @@ License: GPLv2+ BuildArch: noarch URL: https://virt-manager.org/ Source0: https://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz +Source1: symlinks -# Fix 'domain not found' race (bz #1901081) -Patch0001: 0001-virtinst-Fix-TOCTOU-in-domain-enumeration.patch -Patch2: virt-manager-installer-Prefer-xorrisofs-over-genisoimage-mkisofs.patch -Patch3: virt-manager-urlfetcher-Factor-out-ISOReader-class.patch -Patch4: virt-manager-urlfetcher-Add-xorriso-ISOReader-implementation.patch -Patch5: virt-manager-urlfetcher-Delete-the-isoinfo-ISOReader.patch -Patch6: virt-manager-urlfetcher-Silence-xorisso-stderr-output.patch -Patch7: virt-manager-virt-install-add-mediated-device.patch -Patch8: virt-manager-virt-xml-add-support-for-mediated-devices.patch -Patch9: virt-manager-hostdev-use-method-get_mdev_uuid.patch -Patch10: virt-manager-tests-verify-MDEV-support.patch -Patch11: virt-manager-virt-manager-enable-MDEV-support.patch -Patch12: virt-manager-cli-introduce-resource-fibrechannel.appid-option.patch -Patch13: virt-manager-Handle-new-nodedev-name-for-mediated-devices.patch -Patch14: virt-manager-cli-add-ioapic.driver-to-features.patch -Patch15: virt-manager-cli-filesystem-add-binary.sandbox.mode-and-source.socket.patch -Patch16: virt-manager-nodedev-Improve-error-with-unknown-address-strings.patch -Patch17: virt-manager-man-fix-default-value-for-filesystem-accessmode-option.patch +Patch1: virt-manager-virt-install-add-support-for-qemu-vdagent-channel.patch +Patch2: virt-manager-virt-manager-add-support-for-qemu-vdagent-channel.patch Requires: virt-manager-common = %{verrel} -Requires: python3-gobject -Requires: gtk3 +Requires: python3-gobject >= 3.31.3 +Requires: gtk3 >= 3.22.0 Requires: libvirt-glib >= 0.0.9 Requires: gtk-vnc2 @@ -71,6 +56,7 @@ BuildRequires: git BuildRequires: gettext BuildRequires: python3-devel BuildRequires: python3-docutils +BuildRequires: python3-setuptools %description @@ -119,12 +105,24 @@ machine). %prep %autosetup -S git_am -N +# "make dist" replaces all symlinks with a copy of the linked files; +# we need to replace all of them with the original symlinks +echo "Restoring symlinks" +while read lnk target; do + if [ -e $lnk ]; then + rm -rf $lnk + ln -s $target $lnk + fi +done <%{_sourcedir}/symlinks || exit 1 +git add . +git commit -q -a --allow-empty --author 'rpm-build ' -m symlinks + + git config gc.auto 0 %autopatch - %build %if %{default_hvs} %global _default_hvs --default-hvs %{default_hvs} @@ -143,19 +141,12 @@ git config gc.auto 0 %if 0%{?py_byte_compile:1} # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#manual-bytecompilation -%py_byte_compile %{python3} %{buildroot}%{_datadir}/virt-manager/ +%py_byte_compile %{__python3} %{buildroot}%{_datadir}/virt-manager/ %endif -# Replace '#!/usr/bin/env python3' with '#!/usr/bin/python3' -# The format is ideal for upstream, but not a distro. See: -# https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython -for f in $(find %{buildroot} -type f -executable -print); do - sed -i "1 s|^#!/usr/bin/env python3|#!%{__python3}|" $f || : -done %files -%doc README.md COPYING NEWS.md %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* @@ -172,8 +163,10 @@ done %files common -f %{name}.lang -%dir %{_datadir}/%{name} +%license COPYING +%doc README.md NEWS.md +%dir %{_datadir}/%{name} %{_datadir}/%{name}/virtinst @@ -192,6 +185,11 @@ done %changelog +* Thu Jul 7 2022 Jonathon Jongsma - 4.0.0-1 +- Rebased to virt-manager-4.0.0 (rhbz#2100525) +- virt-install: add support for qemu-vdagent channel (rhbz#2060724) +- virt-manager: add support for qemu-vdagent channel (rhbz#2060724) + * Wed Feb 9 2022 Jonathon Jongsma - 3.2.0-14 - man: fix default value for filesystem accessmode option (rhbz#2045932)