Re: [PATCH v2 6/9] admin: Add URI support and introduce virAdmGetDefaultURI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> /**
>>  * virAdmConnectOpen:
>>  * @name: uri of the daemon to connect to, NULL for default
>> @@ -170,6 +199,7 @@ virAdmConnectOpen(const char *name, unsigned int
>> flags)
>> {
>>     char *sock_path = NULL;
>>     virAdmConnectPtr conn = NULL;
>> +    virConfPtr conf = NULL;
>>
>>     if (virAdmInitialize() < 0)
>>         goto error;
>> @@ -180,7 +210,18 @@ virAdmConnectOpen(const char *name, unsigned int
>> flags)
>>     if (!(conn = virAdmConnectNew()))
>>         goto error;
>>
>> -    if (!(sock_path = getSocketPath(name)))
>> +    if (virGetLibvirtConfigFile(&conf) < 0)
>> +        goto error;
>> +
>> +    if (!name) {
>> +        if (virAdmGetDefaultURI(conf, &conn->uri) < 0)
> 
> Are we planning on using the @conf anywhere else?  If not, I'd put the
> config getting inside this function.

Actually, yes. A couple of days ago I realized that I forgot to
introduce URI aliases support in this series, so I prepared a patch for
that on my local branch, where I'm reusing the @conf reference as I need
to read uri_aliases variable from the config.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]