2010/2/26 Matthias Bolte <[email protected]>:
> 2010/2/26 Sharadha Prabhakar (3P) <[email protected]>:
>> 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
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list