From 592a4901c967181911891320e55c0eab552f35af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 21 Nov 2014 21:45:03 +0100 Subject: [PATCH] core: import monitorlayoutnotify instead of calling it as external script Otherwise deadlock could happen - the script will try to get read lock on qubes.xml, while the calling tool can already hold the lock. If that was write lock (which is in case of qfile-daemon-dvm), the deadlock occurs. --- core-modules/000QubesVm.py | 11 ++++++----- core/qubes.py | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index 8a5fd0c7..7884fad3 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -1544,12 +1544,13 @@ class QubesVm(object): if (retcode != 0) : raise QubesException("Cannot start qubes-guid!") - if verbose: - print >> sys.stderr, "--> Sending monitor layout..." - try: - subprocess.call([system_path["monitor_layout_notify_cmd"], self.name]) - except Exception as e: + import qubes.monitorlayoutnotify + if verbose: + print >> sys.stderr, "--> Sending monitor layout..." + monitor_layout = qubes.monitorlayoutnotify.get_monitor_layout() + qubes.monitorlayoutnotify.notify_vm(self, monitor_layout) + except ImportError as e: print >>sys.stderr, "ERROR: %s" % e if verbose: diff --git a/core/qubes.py b/core/qubes.py index ef8a1de1..fd7c23d8 100755 --- a/core/qubes.py +++ b/core/qubes.py @@ -81,7 +81,6 @@ system_path = { 'qubes_pciback_cmd': '/usr/lib/qubes/unbind-pci-device.sh', 'prepare_volatile_img_cmd': '/usr/lib/qubes/prepare-volatile-img.sh', - 'monitor_layout_notify_cmd': '/usr/bin/qubes-monitor-layout-notify', } vm_files = {