Re: [PATCH] virt-manager: Fix VNC connection on hypervisor without GraphicsFD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/26/2016 06:02 AM, Mikhail Feoktistov wrote:
> 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.
> ---
>  virtManager/domain.py | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/virtManager/domain.py b/virtManager/domain.py
> index 33535af..2c91314 100644
> --- a/virtManager/domain.py
> +++ b/virtManager/domain.py
> @@ -1117,7 +1117,11 @@ 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:
> +            fd = -1
> +        return fd
>  
>      def refresh_snapshots(self):
>          self._snapshot_list = None
> 

Sorry for the delay. Pushed, with an extra line to log the libvirt error

- Cole

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux