qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design


From: Andreas Färber
Subject: Re: [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design
Date: Mon, 13 Aug 2012 19:38:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0

Am 13.08.2012 12:27, schrieb Wenchao Xia:
> 于 2012-8-10 18:48, Paolo Bonzini 写道:
>> Il 09/08/2012 12:12, Wenchao Xia ha scritto:
>>> +        assert(0 == set_option_parameter_int(param,
>>> +                                BLOCK_OPT_SIZE, o_cow->virt_size));
>>
>> Assertions should not have side effects.
>>
>    what side effects would this line have?

It sets some BLOCK_OPT_SIZE parameter. :)

What Paolo probably meant is to extract that part from the assert():
ret = set_option_...(...);
assert(ret == 0);
eliminating the kraxelism at the same time. ;)
Then you can more safely do, e.g., #define assert(x) do {} while (0)

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]