Просмотр исходного кода

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.
Marek Marczykowski-Górecki 10 лет назад
Родитель
Сommit
8be54ab174
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      dispvm/qfile-daemon-dvm

+ 3 - 0
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