From 8be54ab174542cc6e28f549f25fee431ff90b116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 28 Mar 2014 04:27:51 +0100 Subject: [PATCH] dispvm: display warning if the template is running (#754) Opening a DispVM when the TemplateVM is running forces savefile regeneration. Checking real root.img modification time (taking into account root-cow.img) is tricky, so display a warning instead. --- dispvm/qfile-daemon-dvm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dispvm/qfile-daemon-dvm b/dispvm/qfile-daemon-dvm index 2d217b71..47587c7d 100755 --- a/dispvm/qfile-daemon-dvm +++ b/dispvm/qfile-daemon-dvm @@ -125,6 +125,9 @@ class QfileDaemonDvm: dvm_mtime = os.stat(current_savefile).st_mtime root_mtime = os.stat(dvmdata_dir+'savefile-root').st_mtime if dvm_mtime < root_mtime: + template_name = os.path.basename(os.path.dirname(os.readlink(dvmdata_dir+'savefile-root'))) + if subprocess.call(["xl", "domid", template_name]) == 0: + self.tray_notify("For optimum performance, you should not start DispVM when its template is running.") return False return True