[libvirt] [PATCH v5 3/9] pvs: add functions to list domains and get info
Dmitry Guryanov
dguryanov at parallels.com
Wed May 2 18:16:10 UTC 2012
On 05/02/2012 03:11 AM, Eric Blake wrote:
> On 04/20/2012 10:01 AM, Dmitry Guryanov wrote:
>> PVS driver is 'stateless', like vmware or openvz drivers.
>> It collects information about domains during startup using
>> command-line utility prlctl. VMs in PVS identified by UUIDs
>
.....
>> +/*
>> + * Must be called with privconn->lock held
>> + */
>> +static int
>> +pvsLoadDomains(pvsConnPtr privconn, const char *domain_name)
>> +{
>> + int count, i;
>> + virJSONValuePtr jobj;
>> + virJSONValuePtr jobj2;
>> + virDomainObjPtr dom = NULL;
>> + int ret = -1;
>> +
>> + jobj = pvsParseOutput(PRLCTL, "list", "-j", "-a",
>> + "-i", "-H", domain_name, NULL);
> I guess you can call this command with a domain name, to limit to one
> output, or with no argument, to list all domains, given...
>
>> @@ -150,6 +371,9 @@ pvsOpenDefault(virConnectPtr conn)
>> if (virDomainObjListInit(&privconn->domains)< 0)
>> goto error;
>>
>> + if (pvsLoadDomains(privconn, NULL))
>> + goto error;
> this usage.
>
>
>
Yes, you're right, I have to add comment about it.
--
Dmitry Guryanov
More information about the libvir-list
mailing list