Re: [libvirt] [PATCH 1/2] Addition of XenAPI support to libvirt

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

 



2010/2/26 Matthias Bolte <matthias.bolte@xxxxxxxxxxxxxx>:
> 2010/2/26 Sharadha Prabhakar (3P) <sharadha.prabhakar@xxxxxxxxxx>:
>> This patch contains XenAPI driver specific files.
>> Files included are
>> xenapi_driver.c
>> xenapi_utils.c
>> xenapi_driver.h
>> xenapi_driver_private.h
>> xenapi_utils.h
>> This patch includes changes suggested in the first review.
>>
>>

>> +/*
>> +* xenapiDomainLookupByUUID
>> +*
>> +* Returns the domain pointer of domain with matching UUID
>> +* or -1 in case of error
>> +*/
>> +static virDomainPtr
>> +xenapiDomainLookupByUUID (virConnectPtr conn,
>> +                          const unsigned char *uuid)
>> +{
>> +    /* vm.get_by_uuid */
>> +    xen_vm vm;
>> +    xen_vm_record *record;
>> +    unsigned char raw_uuid[VIR_UUID_BUFLEN];
>> +    virDomainPtr domP=NULL;
>> +    xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
>> +    if (xen_vm_get_by_uuid(session, &vm, (char *)uuid)) {
>> +        xen_vm_get_record(session, &record, vm);
>> +        if (record != NULL) {
>> +            virUUIDParse((char *)uuid,raw_uuid);
>
> const unsigned char *uuid is already in raw format. Parsing it again
> will give wrong results. Did you actually test this function?
>

Okay, I take this one back. You use the domain name for lookup in
other functions, so a broken UUID may not surface in manual tests.

Matthias

--
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]