[Libvir] Re: Can't connect to lxc driver
Daniel P. Berrange
berrange at redhat.com
Thu May 1 02:48:06 UTC 2008
On Wed, Apr 30, 2008 at 05:22:22PM -0700, Dave Leskovec wrote:
> Hi Dan,
>
> I updated today to the latest CVS and can no longer connect to the lxc driver.
> I've tracked it down to this check in doRemoteOpen() in remote_internal.c:
>
> if ((
> #ifdef HAVE_XMLURI_QUERY_RAW
> uri->query_raw =
> #else
> uri->query =
> #endif
> qparam_get_query (vars)) == NULL) goto failed;
>
> Looking at the recent VirBuffer changes, it looks like they changed the behavior
> of qparam_get_query. With the old VirBuffer, qparam_get_query returned a
> non-NULL result because virBufferNew allocated space. The new VirBuffer doesn't
> allocate space until something is added and hence this function returns NULL if
> nothing is ever put in the buffer. I'm not familiar enough with the intended
> behavior to know what the fix should be here.
So two things - with the old code it was impossible for qparam_get_query
to return NULL, so the NULL check was redundant. Aside from that, it
looks like it is valid for uri->query to be set to NULL anway to indicate
that no variables are set. So I'd suggest you try just removing the
NULL check & goto failed. If that doesn't work, then modify get_query
to return "", if the buffer is NULL.
Regards,
Dan.
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list