[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [libvirt] [PATCH v2 1/2] qemu: parse: Use qemuParseCommandLineMem for -m memory
- From: Cole Robinson <crobinso redhat com>
- To: Ján Tomko <jtomko redhat com>
- Cc: libvir-list redhat com, Nishith Shah <nishithshah 2211 gmail com>
- Subject: Re: [libvirt] [PATCH v2 1/2] qemu: parse: Use qemuParseCommandLineMem for -m memory
- Date: Thu, 19 May 2016 08:21:40 -0400
On 05/19/2016 08:20 AM, Ján Tomko wrote:
> On Thu, May 19, 2016 at 08:08:39AM -0400, Cole Robinson wrote:
>> On 05/18/2016 02:36 AM, Nishith Shah wrote:
>>> + virDomainDefSetMemoryTotal(dom, mem * 1024);
>>> + dom->mem.cur_balloon = mem * 1024;
>>> +
>>> + return 0;
>>> +
>>> + error:
>>> + return -1;
>>> +}
>>> +
>>
>> Typically when we use the 'goto error' pattern, what we do is:
>>
>> int ret = -1;
>>
>> if (condition)
>> goto error;
>>
>> ret = 0;
>> error:
>> return ret;
>>
>> So there's only one 'return'
>
> When the path is taken both on error and success, 'cleanup' is
> the preferred label name: http://libvirt.org/hacking.html#goto
>
Thanks for the correction, I need to make a note about that...
- Cole
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]