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.
This commit is contained in:
Marek Marczykowski-Górecki 2014-03-28 04:27:51 +01:00
parent 242590902a
commit 8be54ab174

View File

@ -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