[Libvir] Re: Can't connect to lxc driver

Dave Leskovec dlesko at linux.vnet.ibm.com
Thu May 1 06:13:18 UTC 2008


Thanks!  Removing the if == NULL goto fail works.  Patch is attached.

Daniel P. Berrange wrote:
> 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.

-- 
Best Regards,
Dave Leskovec
IBM Linux Technology Center
Open Virtualization
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conn_fix.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080430/c371c9d1/attachment-0001.bin>


More information about the libvir-list mailing list