[virt-tools-list] [virt-manager] commit 5219e49e causes virt-manager hang

Cole Robinson crobinso at redhat.com
Wed May 20 18:21:22 UTC 2015


On 05/20/2015 03:18 AM, Lin Ma wrote:
> Hi Cole,
> 
> It seems that commit 5219e49e caused virt-manager to infinite recursion in
> certain cases.
> e.g: create new vm -> local install media -> select an iso(says fedora 21
> Server), Then the virt-manager hangs.
> 
> 
> Not sure whether the following changes make sense, just FYI:
> (actually I dont know which scenario meets the both of condition: 'if nothing
> is selected' and 'the widget is a combo box with a text entry')
> 
> diff --git a/virtManager/uiutil.py b/virtManager/uiutil.py
> index 82d2c1d..40a7964 100644
> --- a/virtManager/uiutil.py
> +++ b/virtManager/uiutil.py
> @@ -77,10 +77,10 @@ def get_list_selection(widget, column=0,
> check_visible=False):
>      return the value of that.
>      """
>      row = get_list_selected_row(widget, check_visible=check_visible)
> -    if row is not None:
> +    if row:
>          return row[column]
> 
> -    if hasattr(widget, "get_has_entry"):
> +    if row is not None and hasattr(widget, "get_has_entry"):
>          if widget.get_has_entry():
>              return widget.get_child().get_text().strip()
> 

Thanks for the report. The root issue is that we are triggering recursive
events when repopulating the OS list in the new VM wizard, the uiutil change
just made it fatal :) I pushed this commit now:

commit 43340f46a2f3bdf9f3c5017539b2627c8f645be5
Author: Cole Robinson <crobinso at redhat.com>
Date:   Wed May 20 14:18:09 2015 -0400

    create: Fix infinite loop after uiutil rework

    Repopulating the ostype/variant list triggers a bunch of change events,
    which causes us to enter an infinite loop due to some minor behavior
    change in the uiutil helpers.

    The uiutil helpers are still correct, the root problem is we should be
    disabling change events when repopulating those UI lists (we already
    have to do a similar trick in a few other places, like host.py)

- Cole




More information about the virt-tools-list mailing list