[virt-tools-list] [PATCH virt-manager] Add host name to window title

Cole Robinson crobinso at redhat.com
Mon Aug 31 22:39:40 UTC 2015


On 08/14/2015 05:08 AM, Pavel Fedin wrote:
> Reports also host name in the title of machine properties window. Helps to
> differentiate between machines with similar names on different hosts.
> 
> Signed-off-by: Pavel Fedin <p.fedin at samsung.com>
> ---
>  virtManager/console.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virtManager/console.py b/virtManager/console.py
> index b07ae72..2f14bcc 100644
> --- a/virtManager/console.py
> +++ b/virtManager/console.py
> @@ -215,7 +215,7 @@ class vmmConsolePages(vmmGObjectUI):
>      #################
>  
>      def _change_title(self, ignore1=None):
> -        title = self.vm.get_name_or_title() + " " + _("Virtual Machine")
> +        title = self.vm.get_name_or_title() + " " + _("Virtual Machine") + " @ " + self.vm.conn.libvirt_gethostname()
>  
>          if self._pointer_is_grabbed and self._viewer:
>              keystr = self._viewer.console_get_grab_keys()
> 

I like the idea in general, but hostname isn't necessarily the best
differentiator either since you could have a VM named 'foo' on qemu:///system,
qemu:///session, and lxc:/// all connected to the same host, but they are
different machines.

I pushed a patch that used the connection row name from the main manager
window, which is also editable in the connection details dialog, so the user
has some control over it.

commit 364e352e5d517e9a0d64e900e062fa74e38b3d46
Author: Cole Robinson <crobinso at redhat.com>
Date:   Mon Aug 31 18:38:05 2015 -0400

    console: Show connection name in window title

    To differentiate between similarly named VMs on multiple connections.

    Suggested-by: Pavel Fedin <p.fedin at samsung.com>


Thanks,
Cole




More information about the virt-tools-list mailing list