[libvirt] [PATCH] Don't exist if the libvirtd config does not exist

Eric Blake eblake at redhat.com
Fri Jul 8 16:09:21 UTC 2011

On 07/08/2011 10:07 AM, Eric Blake wrote:
> On 07/08/2011 08:28 AM, Daniel P. Berrange wrote:
>> From: "Daniel P. Berrange" <berrange at redhat.com>
>> It is common for the $HOME/.libvirt/libvirtd.conf file to not
>> exist. Treat this situation as non-fatal since we can carry
>> on with our default settings just fine.

>> +    if (access(filename, R_OK) == -1 &&
>> +        errno == ENOENT)
>> +        return 0;
>> +
> This patch breaks 'make check' - tests/libvirtd-fail is now reporting
> failure.

That test is checking that an explicit libvirtd --config=no-such-conf
reports failure.

I think the solution to this is to also pass around a bool stating
whether the conf file name was generated by default (ENOENT is okay) or
explicitly passed in (ENOENT must fail).

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110708/eb1cee8e/attachment-0001.sig>

More information about the libvir-list mailing list