diff --git a/qubes/ext/audio.py b/qubes/ext/audio.py index c5c35a5d7..b40676268 100644 --- a/qubes/ext/audio.py +++ b/qubes/ext/audio.py @@ -93,9 +93,13 @@ def on_property_reset(self, subject, event, name, oldvalue=None): @staticmethod async def set_stubdom_audiovm_domid(qube, audiovm): + if audiovm: + audiovm_xid = audiovm.xid + else: + audiovm_xid = -1 try: await qube.run_service_for_stdio( - f"qubes.SetAudioVM+{audiovm.xid}", + f"qubes.SetAudioVM+{audiovm_xid}", user="root", stubdom=True, stdout=subprocess.DEVNULL, @@ -120,15 +124,10 @@ 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) ) - @qubes.ext.handler("property-del:audiovm") - def on_property_del(self, subject, event, name, oldvalue=None): - self.set_tag_and_qubesdb_entry(subject=subject, event=event) - @qubes.ext.handler("domain-qdb-create") def on_domain_qdb_create(self, vm, event): self.set_qubesdb_audiovm(vm) 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):