Logs available for non-running VMs

This commit is contained in:
Agnieszka Kostrzewa 2012-04-24 12:06:08 +02:00
parent a633090593
commit 4d620b0904

View File

@ -1398,26 +1398,29 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
running = vm.is_running() running = vm.is_running()
#logs menu #logs menu
if not running: self.logs_menu.clear()
self.logs_menu.setEnabled(False) if vm.qid == 0:
else: text = "/var/log/xen/console/hypervisor.log"
self.logs_menu.clear() action = self.logs_menu.addAction(QIcon(":/log.png"), text)
action.setData(QVariant(text))
self.logs_menu.setEnabled(True) self.logs_menu.setEnabled(True)
else:
menu_empty = True
text = "/var/log/xen/console/guest-"+vm.name+".log"
if os.path.exists(text):
action = self.logs_menu.addAction(QIcon(":/log.png"), text)
action.setData(QVariant(text))
menu_empty = False
xid = vm.xid text = "/var/log/xen/console/guest-"+vm.name+"-dm.log"
if os.path.exists(text):
#xl console action = self.logs_menu.addAction(QIcon(":/log.png"), text)
if xid != None: action.setData(QVariant(text))
if xid != 0: menu_empty = False
text = "/var/log/xen/console/guest-"+vm.name+".log"
action = self.logs_menu.addAction(QIcon(":/log.png"), text)
action.setData(QVariant(text))
text = "/var/log/xen/console/guest-"+vm.name+"-dm.log"
if os.path.exists(text):
action = self.logs_menu.addAction(QIcon(":/log.png"), text)
action.setData(QVariant(text))
if running:
xid = vm.xid
if xid != None:
text = "/var/log/qubes/guid."+str(xid)+".log" text = "/var/log/qubes/guid."+str(xid)+".log"
action = self.logs_menu.addAction(QIcon(":/log.png"), text) action = self.logs_menu.addAction(QIcon(":/log.png"), text)
action.setData(QVariant(text)) action.setData(QVariant(text))
@ -1425,10 +1428,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
text = "/var/log/qubes/qrexec."+str(xid)+".log" text = "/var/log/qubes/qrexec."+str(xid)+".log"
action = self.logs_menu.addAction(QIcon(":/log.png"), text) action = self.logs_menu.addAction(QIcon(":/log.png"), text)
action.setData(QVariant(text)) action.setData(QVariant(text))
else:
text = "/var/log/xen/console/hypervisor.log" menu_empty = False
action = self.logs_menu.addAction(QIcon(":/log.png"), text) self.logs_menu.setEnabled(not menu_empty)
action.setData(QVariant(text))
# blk menu # blk menu
if not running: if not running: