Logs available for non-running VMs
This commit is contained in:
parent
a633090593
commit
4d620b0904
@ -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:
|
||||||
xid = vm.xid
|
menu_empty = True
|
||||||
|
text = "/var/log/xen/console/guest-"+vm.name+".log"
|
||||||
#xl console
|
if os.path.exists(text):
|
||||||
if xid != None:
|
action = self.logs_menu.addAction(QIcon(":/log.png"), text)
|
||||||
if xid != 0:
|
action.setData(QVariant(text))
|
||||||
text = "/var/log/xen/console/guest-"+vm.name+".log"
|
menu_empty = False
|
||||||
action = self.logs_menu.addAction(QIcon(":/log.png"), text)
|
|
||||||
action.setData(QVariant(text))
|
|
||||||
|
|
||||||
text = "/var/log/xen/console/guest-"+vm.name+"-dm.log"
|
text = "/var/log/xen/console/guest-"+vm.name+"-dm.log"
|
||||||
if os.path.exists(text):
|
if os.path.exists(text):
|
||||||
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))
|
||||||
|
menu_empty = False
|
||||||
|
|
||||||
|
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,11 +1428,10 @@ 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"
|
|
||||||
action = self.logs_menu.addAction(QIcon(":/log.png"), text)
|
|
||||||
action.setData(QVariant(text))
|
|
||||||
|
|
||||||
|
menu_empty = False
|
||||||
|
self.logs_menu.setEnabled(not menu_empty)
|
||||||
|
|
||||||
# blk menu
|
# blk menu
|
||||||
if not running:
|
if not running:
|
||||||
self.blk_menu.setEnabled(False)
|
self.blk_menu.setEnabled(False)
|
||||||
|
Loading…
Reference in New Issue
Block a user