diff -pruN 1:4.0.0-2/debian/changelog 1:4.0.0-3/debian/changelog
--- 1:4.0.0-2/debian/changelog	2022-04-24 09:08:12.000000000 +0000
+++ 1:4.0.0-3/debian/changelog	2022-08-04 11:47:17.000000000 +0000
@@ -1,3 +1,19 @@
+virt-manager (1:4.0.0-3) unstable; urgency=medium
+
+  [ Pino Toscano ]
+  * Drop the python3-dbus dependency from virt-manager, no more needed.
+    GDBus is used, instead of the Python bindings of libdbus.
+  * Update standards version to 4.6.1, no changes needed.
+
+  [ Fabio Fantoni ]
+  * d/patches: add fixes from upstream for FTBFS with libvirt 8.5
+    - tests: Fix with latest osinfo-db
+    - tests: Fix with latest argcomplete
+    - tests: Fix with latest libvirt
+    (Closes: #1013667)
+
+ -- Guido Günther <agx@sigxcpu.org>  Thu, 04 Aug 2022 13:47:17 +0200
+
 virt-manager (1:4.0.0-2) unstable; urgency=medium
 
   [ Fabio Fantoni ]
diff -pruN 1:4.0.0-2/debian/control 1:4.0.0-3/debian/control
--- 1:4.0.0-2/debian/control	2022-04-24 07:54:44.000000000 +0000
+++ 1:4.0.0-3/debian/control	2022-08-04 11:45:13.000000000 +0000
@@ -6,7 +6,7 @@ Uploaders:
  Guido Günther <agx@sigxcpu.org>,
  Laurent Léonard <laurent@open-minds.org>,
  Pino Toscano <pino@debian.org>,
-Standards-Version: 4.6.0
+Standards-Version: 4.6.1
 Vcs-Git: https://salsa.debian.org/libvirt-team/virt-manager.git
 Vcs-Browser: https://salsa.debian.org/libvirt-team/virt-manager
 Homepage: https://virt-manager.org/
@@ -42,7 +42,6 @@ Depends:
  gir1.2-libosinfo-1.0,
  gir1.2-libvirt-glib-1.0,
  gir1.2-vte-2.91,
- python3-dbus,
  python3-gi (>= 3.31.3~),
  python3-gi-cairo,
  python3-libvirt (>= 0.7.1),
diff -pruN 1:4.0.0-2/debian/patches/series 1:4.0.0-3/debian/patches/series
--- 1:4.0.0-2/debian/patches/series	2022-04-24 07:52:15.000000000 +0000
+++ 1:4.0.0-3/debian/patches/series	2022-08-04 11:47:14.000000000 +0000
@@ -1,2 +1,5 @@
 upstream_tests-drop-usage-of-sgio-unfiltered.patch
 upstream_tests-fix-another-sgio-filtered-case.patch
+upstream_tests-fix-with-latest-osinfo-db.patch
+upstream_tests-fix-with-latest-argcomplete.patch
+upstream_tests-fix-with-latest-libvirt.patch
diff -pruN 1:4.0.0-2/debian/patches/upstream_tests-fix-with-latest-argcomplete.patch 1:4.0.0-3/debian/patches/upstream_tests-fix-with-latest-argcomplete.patch
--- 1:4.0.0-2/debian/patches/upstream_tests-fix-with-latest-argcomplete.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1:4.0.0-3/debian/patches/upstream_tests-fix-with-latest-argcomplete.patch	2022-08-04 11:47:14.000000000 +0000
@@ -0,0 +1,40 @@
+From 34662fecc9535c7d8d0a8e7d42fafa4b9e005c89 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 13 Jun 2022 12:55:31 -0400
+Subject: [PATCH] tests: Fix with latest argcomplete
+
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ virtinst/cli.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/virtinst/cli.py b/virtinst/cli.py
+index 52be9f298..c42fc0f0a 100644
+--- a/virtinst/cli.py
++++ b/virtinst/cli.py
+@@ -552,7 +552,15 @@ def autocomplete(parser):
+     kwargs = {"validator": _completer_validator}
+     if xmlutil.in_testsuite():
+         import io
+-        kwargs["output_stream"] = io.BytesIO()
++        class MyStream(io.StringIO):
++            # Custom class to handle both bytes() and str() on write.
++            # With argcomplete 2.0.0 and/or python3.10 something changed
++            # here, so this should hopefully cover back compat
++            def write(self, msg, *args, **kwargs):
++                if type(msg) is bytes:
++                    msg = msg.decode("utf-8")  # pragma: no cover
++                return super().write(msg, *args, **kwargs)
++        kwargs["output_stream"] = MyStream()
+         kwargs["exit_method"] = sys.exit
+ 
+     # This fdopen hackery is to avoid argcomplete debug_stream behavior
+@@ -568,7 +576,7 @@ def fake_fdopen_cb(*args, **kwargs):
+             argcomplete.autocomplete(parser, **kwargs)
+         except SystemExit:
+             if xmlutil.in_testsuite():
+-                output = kwargs["output_stream"].getvalue().decode("utf-8")
++                output = kwargs["output_stream"].getvalue()
+                 print(output)
+             raise
+ 
diff -pruN 1:4.0.0-2/debian/patches/upstream_tests-fix-with-latest-libvirt.patch 1:4.0.0-3/debian/patches/upstream_tests-fix-with-latest-libvirt.patch
--- 1:4.0.0-2/debian/patches/upstream_tests-fix-with-latest-libvirt.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1:4.0.0-3/debian/patches/upstream_tests-fix-with-latest-libvirt.patch	2022-08-04 11:47:14.000000000 +0000
@@ -0,0 +1,90 @@
+From a4a5c1529a81c5bd5636b4847b03643d97fa3dd3 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Wed, 27 Jul 2022 17:51:21 -0400
+Subject: [PATCH] tests: Fix with latest libvirt
+
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ tests/data/cli/compare/virt-install-many-devices.xml |  1 -
+ .../cli/compare/virt-install-singleton-config-2.xml  |  2 ++
+ tests/data/cli/compare/virt-xml-edit-boot-uefi.xml   | 12 ++++++------
+ tests/test_cli.py                                    |  6 ++++--
+ 4 files changed, 12 insertions(+), 9 deletions(-)
+
+--- a/tests/data/cli/compare/virt-install-many-devices.xml
++++ b/tests/data/cli/compare/virt-install-many-devices.xml
+@@ -105,7 +105,6 @@
+       <feature enabled="yes" name="secure-boot"/>
+       <feature enabled="no" name="enrolled-keys"/>
+     </firmware>
+-    <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+     <initarg>foo=bar</initarg>
+     <initarg>baz=woo</initarg>
+     <initenv name="MYENV">some value</initenv>
+--- a/tests/data/cli/compare/virt-install-singleton-config-2.xml
++++ b/tests/data/cli/compare/virt-install-singleton-config-2.xml
+@@ -11,6 +11,7 @@
+   <vcpu cpuset="1,3-5">2</vcpu>
+   <os>
+     <type arch="x86_64" machine="q35">hvm</type>
++    <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+     <smbios mode="emulate"/>
+     <boot dev="network"/>
+     <boot dev="hd"/>
+@@ -111,6 +112,7 @@
+   <vcpu cpuset="1,3-5">2</vcpu>
+   <os>
+     <type arch="x86_64" machine="q35">hvm</type>
++    <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+     <boot dev="hd"/>
+     <smbios mode="emulate"/>
+   </os>
+--- a/tests/data/cli/compare/virt-xml-edit-boot-uefi.xml
++++ b/tests/data/cli/compare/virt-xml-edit-boot-uefi.xml
+@@ -1,11 +1,11 @@
+-       <entry name="location">Upside down</entry>
+-     </baseBoard>
+-   </sysinfo>
++   <memory unit="KiB">8388608</memory>
++   <currentMemory unit="KiB">2097152</currentMemory>
++   <vcpu placement="static">2</vcpu>
+ -  <os>
+ +  <os firmware="efi">
+      <type arch="i686">hvm</type>
+-     <loader readonly="yes" type="pflash">/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
+-     <nvram>/nvram/test-many-devices_VARS.fd</nvram>
++     <boot dev="hd"/>
++   </os>
+ 
+-Domain 'test-many-devices' defined successfully.
++Domain 'test' defined successfully.
+ Changes will take effect after the domain is fully powered off.
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -486,7 +486,6 @@
+ initargs="foo=bar baz=woo",initdir=/my/custom/cwd,inituser=tester,initgroup=1000,\
+ bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,\
+ bootmenu.enable=yes,bootmenu.timeout=5000,\
+-loader_ro=yes,loader.type=rom,loader=/tmp/foo,loader_secure=no,\
+ acpi.table=/path/to/slic.dat,acpi.table.type=slic,\
+ initenv0.name=MYENV,initenv0='some value',initenv1.name=FOO,initenv1=bar,\
+ initdir=/my/custom/cwd,inituser=tester,initgroup=1000
+@@ -830,6 +829,9 @@
+ "--seclabel type=dynamic "  # test a fallback case when guessing model=
+ "--sysinfo emulate "  # special `--sysinfo emulate` handling
+ "--cpuset 1,3-5 "  # setting compat --cpuset when --vcpus is not present
++# --boot loader settings here, or they will conflict with firmware=efi
++# in other test cases
++"--boot loader_ro=yes,loader.type=rom,loader=/tmp/foo,loader_secure=no "
+ 
+ # 'default' handling for solo devices
+ """
+@@ -1341,7 +1343,7 @@
+ c.add_compare("--confirm 1 --edit --cpu host-passthrough", "prompt-response", input_text="yes")  # prompt response, also using domid lookup
+ c.add_compare("--edit --print-diff --qemu-commandline clearxml=yes", "edit-clearxml-qemu-commandline", input_file=(_VIRTXMLDIR + "virtxml-qemu-commandline-clear.xml"))
+ c.add_compare("--print-diff --remove-device --serial 1", "remove-console-dup", input_file=(_VIRTXMLDIR + "virtxml-console-dup.xml"))
+-c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test-many-devices --edit --boot uefi", "edit-boot-uefi")
++c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test --edit --boot uefi", "edit-boot-uefi")
+ c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test-many-devices --edit --cpu host-copy", "edit-cpu-host-copy")
+ c.add_compare("--connect %(URI-KVM-X86)s test-many-devices --build-xml --disk source.pool=pool-disk,source.volume=sdfg1", "build-pool-logical-disk")
+ c.add_compare("test --add-device --network default --update --confirm", "update-succeed", env={"VIRTXML_TESTSUITE_UPDATE_IGNORE_FAIL": "1", "VIRTINST_TEST_SUITE_INCREMENT_MACADDR": "1"}, input_text="yes\nyes\n")  # test hotplug success
diff -pruN 1:4.0.0-2/debian/patches/upstream_tests-fix-with-latest-osinfo-db.patch 1:4.0.0-3/debian/patches/upstream_tests-fix-with-latest-osinfo-db.patch
--- 1:4.0.0-2/debian/patches/upstream_tests-fix-with-latest-osinfo-db.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1:4.0.0-3/debian/patches/upstream_tests-fix-with-latest-osinfo-db.patch	2022-08-04 11:47:14.000000000 +0000
@@ -0,0 +1,61 @@
+From 0533bb8189c2d36fc18121bf394be5d35c038066 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso@redhat.com>
+Date: Mon, 13 Jun 2022 12:59:44 -0400
+Subject: [PATCH] tests: Fix with latest osinfo-db
+
+linux2020 is now reporting virtio-gpu support, adjust output and
+add a compat check
+
+Signed-off-by: Cole Robinson <crobinso@redhat.com>
+---
+ tests/data/cli/compare/virt-install-linux2020.xml | 4 ++--
+ tests/test_cli.py                                 | 7 ++++++-
+ 2 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/tests/data/cli/compare/virt-install-linux2020.xml b/tests/data/cli/compare/virt-install-linux2020.xml
+index cd3e8bb4d..5a7d7adf3 100644
+--- a/tests/data/cli/compare/virt-install-linux2020.xml
++++ b/tests/data/cli/compare/virt-install-linux2020.xml
+@@ -71,7 +71,7 @@
+     </graphics>
+     <sound model="ich9"/>
+     <video>
+-      <model type="qxl"/>
++      <model type="virtio"/>
+     </video>
+     <redirdev bus="usb" type="spicevmc"/>
+     <redirdev bus="usb" type="spicevmc"/>
+@@ -154,7 +154,7 @@
+     </graphics>
+     <sound model="ich9"/>
+     <video>
+-      <model type="qxl"/>
++      <model type="virtio"/>
+     </video>
+     <redirdev bus="usb" type="spicevmc"/>
+     <redirdev bus="usb" type="spicevmc"/>
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index 6a0df7870..02843b102 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -117,6 +117,11 @@ def no_osinfo_unattended_win_drivers_cb():
+         return "osinfo is too old for this win7 unattended test"
+ 
+ 
++def no_osinfo_linux2020_virtio():
++    linux2020 = OSDB.lookup_os("linux2020")
++    return not linux2020 or not linux2020.supports_virtiogpu()
++
++
+ ######################
+ # Test class helpers #
+ ######################
+@@ -1080,7 +1085,7 @@ def add_compare(self, cat, args, compbase, **kwargs):
+ c.add_compare("--cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --sound --controller usb", "kvm-win2k3-cdrom")  # HVM windows install with disk
+ c.add_compare("--os-variant name=ubuntusaucy --nodisks --boot cdrom --virt-type qemu --cpu Penryn --input tablet --boot uefi --graphics vnc", "qemu-plain")  # plain qemu
+ c.add_compare("--os-variant fedora20 --nodisks --boot network --graphics default --arch i686 --rng none", "qemu-32-on-64", prerun_check=has_old_osinfo)  # 32 on 64
+-c.add_compare("--osinfo linux2020 --pxe", "linux2020", prerun_check=lambda: not OSDB.lookup_os("linux2020"))
++c.add_compare("--osinfo linux2020 --pxe", "linux2020", prerun_check=no_osinfo_linux2020_virtio)
+ c.add_compare("--osinfo generic --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.
