[virt-tools-list] [virt-manager PATCH] details: show port number of console device in typelabel

Cole Robinson crobinso at redhat.com
Tue Jan 28 14:22:57 UTC 2014


On 01/28/2014 04:18 AM, Chen Hanxiao wrote:
> From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> 
> We could set multi console for VM and containers.
> But our UI did not show the number of it.
> It would bring troubles when we want to delete one.
> This patch will show port number of console device
> int typelabel.
> 
> Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> ---
>  virtManager/details.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/virtManager/details.py b/virtManager/details.py
> index 39a016a..662aa7b 100644
> --- a/virtManager/details.py
> +++ b/virtManager/details.py
> @@ -3021,6 +3021,9 @@ class vmmDetails(vmmGObjectUI):
>          else:
>              typelabel = _("%s Device") % char_type.capitalize()
>  
> +        if target_port is not None and \
> +                chardev.virtual_device_type == "console":
> +            typelabel += " %s" % (int(target_port) + 1)
>          if target_port is not None and not show_target_type:
>              typelabel += " %s" % (int(target_port) + 1)
>          if primary:
> 

ACK, but please use parentheses around the statement, I try to avoid the line
break escape:

if (target_port is not None and
    chardev... ):

Thanks,
Cole




More information about the virt-tools-list mailing list