[virt-tools-list] [PATCH 2/2] Show the new connection dialog if we can't find a default URI.

Cole Robinson crobinso at redhat.com
Fri Dec 5 15:06:13 UTC 2014


On 12/04/2014 05:08 AM, Cédric Bosdonnat wrote:
> ---
>   virtManager/engine.py | 18 +++++-------------
>   1 file changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/virtManager/engine.py b/virtManager/engine.py
> index 8e9caeb..487277a 100644
> --- a/virtManager/engine.py
> +++ b/virtManager/engine.py
> @@ -178,14 +178,6 @@ class vmmEngine(vmmGObject):
>           self.timeout_add(1000, self._add_default_conn, manager)
>
>       def _add_default_conn(self, manager):
> -        # Manager fail message
> -        msg = _("Could not detect a default hypervisor. Make\n"
> -                "sure the appropriate virtualization packages\n"
> -                "are installed (kvm, qemu, libvirt, etc.), and\n"
> -                "that libvirtd is running.\n\n"
> -                "A hypervisor connection can be manually\n"
> -                "added via File->Add Connection")
> -
>           logging.debug("Determining default libvirt URI")
>
>           ret = None
> @@ -202,10 +194,6 @@ class vmmEngine(vmmGObject):
>           else:
>               tryuri = vmmConnect.default_uri(always_system=True)
>
> -        if tryuri is None:
> -            manager.set_startup_error(msg)
> -            return
> -
>           warnmsg = _("The 'libvirtd' service will need to be started.\n\n"
>                       "After that, virt-manager will connect to libvirt on\n"
>                       "the next application start up.")
> @@ -219,7 +207,11 @@ class vmmEngine(vmmGObject):
>               if not connected and do_start:
>                   manager.err.ok(_("Libvirt service must be started"), warnmsg)
>
> -        self.idle_add(idle_connect)
> +        # If there is no default URI to be found, show the new connection dialog
> +        if tryuri is None:
> +            self._do_show_connect(self.windowManager)
> +        else:
> +            self.idle_add(idle_connect)
>
>
>       def load_stored_uris(self):
>

That message was specifically added in response to user confusion. clueless 
user runs virt-manager for the first time, packagekit installation fails or 
isn't available on their distro, and they get very little feedback.

If someone knows libvirt and knows what they are doing, the 'open connection' 
dialog is trivial. If someone is fairly ignorant about the underlying tech and 
just wants to create a windows VM, showing them the open connection dialog is 
just exposing them to more choices that they aren't qualified to make. And if 
virt-manager didn't find anything that on the local FS to facilitate a default 
connection, none of the available options will likely even work.

So for knowledgable users the error message doesn't add anything, and forces 
them to manually invoke 'open connection', which is a small price in a 
scenario that shouldn't hit often. For ignorant users, the error message could 
be the difference between them giving up entirely, vs giving them a hint to 
figure out how to continue on.

Is that convincing?

Regardless the message probably needs tweaking, droping the kvm mentions at least.

- Cole




More information about the virt-tools-list mailing list