qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design
Date: Mon, 13 Aug 2012 19:38:12 +0200	[thread overview]
Message-ID: <50293B84.2090805@suse.de> (raw)
In-Reply-To: <5028D680.7040108@linux.vnet.ibm.com>

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	other threads:[~2012-08-13 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 10:12 [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design Wenchao Xia
2012-08-09 17:36 ` Blue Swirl
2012-08-10  8:35   ` Wenchao Xia
2012-08-10 10:48 ` Paolo Bonzini
2012-08-13 10:27   ` Wenchao Xia
2012-08-13 17:38     ` Andreas Färber [this message]
2012-08-10 11:02 ` Kevin Wolf
2012-08-13 11:20   ` Wenchao Xia
2012-08-15  8:12   ` [Qemu-devel] [RFC] libqblock-API v2, re-designed Wenchao Xia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50293B84.2090805@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=xiawenc@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).