From 59dd4a8bb69d251aed90b97191e65a9126bc1bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Fri, 3 May 2024 15:14:41 +0200 Subject: [PATCH] Support for providing audiovm on start for HVM Inspired from https://forum.qubes-os.org/t/audio-qube/20685#special-cases-of-non-linux-hvm-16 --- qubes/ext/audio.py | 3 +- qubes/tests/vm/qubesvm.py | 78 ++++++++++++++++++++++++++++++++++++++- templates/libvirt/xen.xml | 9 ++++- 3 files changed, 86 insertions(+), 4 deletions(-) diff --git a/qubes/ext/audio.py b/qubes/ext/audio.py index c5c35a5d7..2cbbaa00b 100644 --- a/qubes/ext/audio.py +++ b/qubes/ext/audio.py @@ -93,6 +93,8 @@ def on_property_reset(self, subject, event, name, oldvalue=None): @staticmethod async def set_stubdom_audiovm_domid(qube, audiovm): + if not audiovm: + return try: await qube.run_service_for_stdio( f"qubes.SetAudioVM+{audiovm.xid}", @@ -120,7 +122,6 @@ def on_property_set(self, subject, event, name, newvalue, oldvalue=None): subject.log.warning("Cannot change dynamically audiovm: qrexec" " is not available (stubdom-qrexec feature)") if has_audio_model and has_stubdom_qrexec: - subject.log.warning(f"setting {newvalue.xid}") asyncio.ensure_future( self.set_stubdom_audiovm_domid(subject, newvalue) ) diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index 232745181..da4f502ba 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -1633,7 +1633,7 @@ def test_610_libvirt_xml_network(self):