[Libvir] [PATCH] Fix xm_internal configCache

This patch: (1) Fixes inactive domains over remote. The real cause of this error turned out to be that after configCache hash is created, the last refresh date wasn't reset, so a subsequent call to xenXMConfigCacheRefresh might not actually repopulate the cache. This only affects the remote case, because only in the remote case do we have a long running process (libvirtd) which closes and reopens xm_internal.c, so this code had never been exercised before. It also explains why the bug was annoyingly intermittent. If you wait
= 10 seconds during testing, then the cache does get refilled, so the bug is hidden.
(2) Adds error messages to xenXMConfigCacheRefresh. (3) As Daniel Veillard suggested, change the obscure !nconnections-- condition to two explicit statements. (4) In xenXMOpen, change the condition from nconnections == 0 to configCache == NULL, to remove the implicit dependency between the two variables. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Wed, Jul 04, 2007 at 01:13:03PM +0100, Richard W.M. Jones wrote:
This patch:
(1) Fixes inactive domains over remote.
The real cause of this error turned out to be that after configCache hash is created, the last refresh date wasn't reset, so a subsequent call to xenXMConfigCacheRefresh might not actually repopulate the cache. This only affects the remote case, because only in the remote case do we have a long running process (libvirtd) which closes and reopens xm_internal.c, so this code had never been exercised before.
It also explains why the bug was annoyingly intermittent. If you wait
= 10 seconds during testing, then the cache does get refilled, so the bug is hidden.
(2) Adds error messages to xenXMConfigCacheRefresh.
(3) As Daniel Veillard suggested, change the obscure !nconnections-- condition to two explicit statements.
(4) In xenXMOpen, change the condition from nconnections == 0 to configCache == NULL, to remove the implicit dependency between the two variables.
Haha, looks fine to me ! +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

OK, I committed this one because I think it's a pretty important. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
participants (2)
-
Daniel Veillard
-
Richard W.M. Jones