mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
virt-manager: Fix VNC connection on hypervisor without GraphicsFD
Function virDomainOpenGraphicsFD() from libvirt can return -1
But in this case libvirt-python will raise an exception.
We should handle this case and return -1 as invalid FD.
In commit 5c451b64
Viewer._open() there is a code to open
graphics console in case of invalid GraphicsFD.
(crobinso: also log the error message)
This commit is contained in:
parent
a1383faff3
commit
32cccaa170
@ -1117,7 +1117,12 @@ class vmmDomain(vmmLibvirtObject):
|
||||
return self._backend.openConsole(devname, stream, flags)
|
||||
|
||||
def open_graphics_fd(self):
|
||||
return self._backend.openGraphicsFD(0)
|
||||
try:
|
||||
fd = self._backend.openGraphicsFD(0)
|
||||
except libvirt.libvirtError:
|
||||
logging.debug("openGraphicsFD failed", exc_info=True)
|
||||
fd = -1
|
||||
return fd
|
||||
|
||||
def refresh_snapshots(self):
|
||||
self._snapshot_list = None
|
||||
|
Loading…
Reference in New Issue
Block a user