From 9768b38ffcceacbb912e2f1594d7a9687f356fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 13 Mar 2014 18:32:13 +0100 Subject: [PATCH] core: handle errors with xenstore access during VM shutdown When netvm and firewallvm is shut down, netvm handling code will try to revoke firewallvm access to external IP. But if netvm shutdown happens in the meantime, xenstore will throw ENOENT error. --- core-modules/005QubesNetVm.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core-modules/005QubesNetVm.py b/core-modules/005QubesNetVm.py index 975b76f3..f21acb4c 100644 --- a/core-modules/005QubesNetVm.py +++ b/core-modules/005QubesNetVm.py @@ -22,6 +22,7 @@ # import sys import os.path +import xen.lowlevel.xs from qubes.qubes import QubesVm,register_qubes_vm_class,xs,dry_run from qubes.qubes import defaults,system_path,vm_files @@ -120,8 +121,12 @@ class QubesNetVm(QubesVm): for xid in self.__external_ip_allowed_xids: perms.append({ 'dom': xid, 'read': True }) - xs.set_permissions('', '/local/domain/{0}/qubes-netvm-external-ip'.format(xid), - perms) + try: + xs.set_permissions('', '/local/domain/{0}/qubes-netvm-external-ip'.format(xid), + perms) + except xen.lowlevel.xs.Error as e: + print >>sys.stderr, "WARNING: failed to update external IP " \ + "permissions: %s" % (str(e)) def start(self, **kwargs): if dry_run: