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.setEnabled(False)
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
        self.logs_menu.clear()
 | 
					        self.logs_menu.clear()
 | 
				
			||||||
            self.logs_menu.setEnabled(True)
 | 
					        if vm.qid == 0:
 | 
				
			||||||
            
 | 
					            text = "/var/log/xen/console/hypervisor.log"
 | 
				
			||||||
            xid = vm.xid
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
            #xl console
 | 
					 | 
				
			||||||
            if xid != None:
 | 
					 | 
				
			||||||
                if xid != 0:
 | 
					 | 
				
			||||||
                    text = "/var/log/xen/console/guest-"+vm.name+".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))
 | 
				
			||||||
 | 
					            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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            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,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:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user