[virt-tools-list] [PATCH] virtManager: do not call set_cell_data_func with an empty func

Cole Robinson crobinso at redhat.com
Wed Oct 30 18:01:36 UTC 2013


On 10/30/2013 12:00 PM, Giuseppe Scrivano wrote:
> It fixes this exception:
> 
> Traceback (most recent call last):
>   File "src/virt-manager/virtManager/engine.py", line 133, in _activate
>     self.show_manager()
>   File "src/virt-manager/virtManager/engine.py", line 867, in show_manager
>     self._do_show_manager(None)
>   File "src/virt-manager/virtManager/engine.py", line 811, in _do_show_manager
>     manager = self.get_manager()
>   File "src/virt-manager/virtManager/engine.py", line 772, in get_manager
>     obj = vmmManager()
>   File "src/virt-manager/virtManager/manager.py", line 173, in __init__
>     self.init_stats()
>   File "src/virt-manager/virtManager/manager.py", line 276, in init_stats
>     self.toggle_host_cpu_usage_visible_widget()
>   File "src/virt-manager/virtManager/manager.py", line 1026, in toggle_host_cpu_usage_visible_widget
>     self.host_cpu_usage_img, "menu_view_stats_host_cpu")
>   File "src/virt-manager/virtManager/manager.py", line 1003, in _toggle_graph_helper
>     col.set_cell_data_func(img, datafunc, None)
>   File "/usr/lib/python2.7/site-packages/gi/overrides/Gtk.py", line 1320, in set_cell_data_func
>     super(TreeViewColumn, self).set_cell_data_func(cell_renderer, func, func_data)
> TypeError: When passing None for a callback userdata must also be None
> 
> Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1024569
> 
> Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
> ---
>  virtManager/manager.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/virtManager/manager.py b/virtManager/manager.py
> index 114904b..fe5be75 100644
> --- a/virtManager/manager.py
> +++ b/virtManager/manager.py
> @@ -998,9 +998,8 @@ class vmmManager(vmmGObjectUI):
>          for child in col.get_cells():
>              if isinstance(child, CellRendererSparkline):
>                  img = child
> -        datafunc = do_show and datafunc or None
> -
> -        col.set_cell_data_func(img, datafunc, None)
> +        if do_show:
> +            col.set_cell_data_func(img, datafunc, None)
>          col.set_visible(do_show)
>          self.widget(menu).set_active(do_show)
>  
> 

Hmm, the problem is this was an important piece in working around a pygobject
memory leak. That leak is fixed in upstream pygobject (and probably rawhide,
but I haven't checked the version), but if we commit this now but push a
release to F20, that memory leak bit will regress.

That error message was only added to pygobject last month:

https://mail.gnome.org/archives/commits-list/2012-October/msg03530.html

And it sounds bogus here anyways, since we aren't passing any user data. So I
think it's a pygobject bug. We can carry this patch in rawhide temporarily but
I don't think we should push it upstream yet.

The pygobject guys are very responsive upstream, if you boil down a minimal
reproducer and file a bug it'll likely be fixed very quickly.

Thanks,
Cole




More information about the virt-tools-list mailing list