From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0yap-0008Qw-GH for qemu-devel@nongnu.org; Mon, 13 Aug 2012 13:38:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0yan-00054m-BR for qemu-devel@nongnu.org; Mon, 13 Aug 2012 13:38:19 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46030 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0yan-00054Z-4n for qemu-devel@nongnu.org; Mon, 13 Aug 2012 13:38:17 -0400 Message-ID: <50293B84.2090805@suse.de> Date: Mon, 13 Aug 2012 19:38:12 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1344507137-11173-1-git-send-email-xiawenc@linux.vnet.ibm.com> <5024E6FD.6030507@redhat.com> <5028D680.7040108@linux.vnet.ibm.com> In-Reply-To: <5028D680.7040108@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [qemu-devel] [PATCH V2 2/3] [RFC] libqblock-API design List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: Blue Swirl , Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, Stefan Hajnoczi Am 13.08.2012 12:27, schrieb Wenchao Xia: > =E4=BA=8E 2012-8-10 18:48, Paolo Bonzini =E5=86=99=E9=81=93: >> Il 09/08/2012 12:12, Wenchao Xia ha scritto: >>> + assert(0 =3D=3D 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 =3D set_option_...(...); assert(ret =3D=3D 0); eliminating the kraxelism at the same time. ;) Then you can more safely do, e.g., #define assert(x) do {} while (0) Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg