Re: [PATCH 7/8] Asynchronous event for BlockPull completion

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

 




On 06/14/2011 05:03 AM, Daniel P. Berrange wrote:
>> +static virDomainEventPtr
>> +virDomainEventBlockPullNew(int id, const char *name, unsigned char *uuid,
>> +                           const char *path, int status)
>> +{
>> +    virDomainEventPtr ev =
>> +        virDomainEventNewInternal(VIR_DOMAIN_EVENT_ID_BLOCK_PULL,
>> +                                  id, name, uuid);
>> +
>> +    if (ev) {
>> +        if (!(ev->data.blockPull.path = strdup(path))) {
>> +            virDomainEventFree(ev);
>> +            return NULL;
> 
> You want a virReportOOMError() call there.

Yes, of course.

>> +static int
>> +qemuProcessHandleBlockPull(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
>> +                           virDomainObjPtr vm,
>> +                           const char *diskAlias,
>> +                           int status)
>> +{
>> +    struct qemud_driver *driver = qemu_driver;
>> +    virDomainEventPtr blockPullEvent = NULL;
>> +    const char *path;
>> +    virDomainDiskDefPtr disk;
>> +
>> +    virDomainObjLock(vm);
>> +    disk = qemuProcessFindDomainDiskByAlias(vm, diskAlias);
>> +
>> +    if (disk)
>> +        path = disk->src;
>> +    else
>> +        path = "";
> 
> If we can't find the disk associated with the alias, then
> I think we should just discard the event rather than emitting
> one with a zero-length path.

Yes, this makes sense.  Dome for the next series.

-- 
Adam Litke
IBM Linux Technology Center

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