[libvirt] [PATCH V6 3/3] Add support for file descriptor sets

Stefan Berger stefanb at linux.vnet.ibm.com
Fri Feb 15 21:00:49 UTC 2013


On 02/15/2013 03:51 PM, Corey Bryant wrote:
>
>> +    char *fdsetstr = NULL;
>> +    int i;
>> +
>> +    virBufferAdd(buf, prefix, -1);
>> +    /*
>> +     * cmd == NULL hints at hotplugging; use old way of doing things
>
> I assume hotplug will be implemented at a later time by someone.

Yes, this can be done independently.


>
>> +            if (!fdsetstr)
>> +                goto error;
>> +            virCommandAddArgList(cmd, "-add-fd", fdsetstr, NULL);
>> +            VIR_FREE(fdsetstr);
>> +
>> +            i++;
>> +        }
>> +    }
>> +
>> +    return 0;
>> +
>> +error:
>
> Do fd's need to get cleaned up?  Are we leaking them here?

No, the virCommandTransferFD has put the fd into the virCommand and when 
that gets aborted due to the error propagation it will close the fd as well.

I will wait for further reviews also regarding the renaming of functions.




More information about the libvir-list mailing list