[libvirt] [PATCHv1.5 18/27] conf: Add functions to copy and free network disk source definitions

Peter Krempa pkrempa at redhat.com
Tue Dec 3 08:46:52 UTC 2013


On 12/03/13 00:01, Eric Blake wrote:
> On 11/27/2013 04:15 AM, Michal Privoznik wrote:
>> On 26.11.2013 17:49, Peter Krempa wrote:
>>> To simplify operations on virDomainDiskHostDef arrays we will need deep
>>> copy and freeing functions. Add and properly export them.
>>> ---
> 
>>> +        if (VIR_STRDUP(dst->port, src->port) < 0)
>>> +            goto error;
>>> +
>>> +        if (VIR_STRDUP(dst->socket, src->socket) < 0)
>>> +            goto error;
>>
>> Could have been joined into one 'if' with or-ed VIR_STRDUP(). But this
>> is just fine too.
> 
> Dan has been (successfully) convincing me that separate 'if' is better
> for -O2 debugging, because then gdb is better able to show you which
> line of code failed.

Yep, I've read the conversation and kept this separate exactly for that
reason :)

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131203/b8c4716d/attachment-0001.sig>


More information about the libvir-list mailing list