From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Q3m-0001xN-Kk for qemu-devel@nongnu.org; Wed, 25 May 2016 00:04:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Q3k-0000tH-Nb for qemu-devel@nongnu.org; Wed, 25 May 2016 00:04:41 -0400 References: <1464097654-12977-1-git-send-email-kwolf@redhat.com> <1464097654-12977-14-git-send-email-kwolf@redhat.com> <5745215C.8090901@cn.fujitsu.com> From: Eric Blake Message-ID: <57452450.6010100@redhat.com> Date: Tue, 24 May 2016 22:04:32 -0600 MIME-Version: 1.0 In-Reply-To: <5745215C.8090901@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gOBvhQGw50TSUsIsqblrR7scNQ4NQuejF" Subject: Re: [Qemu-devel] [PATCH v2 13/14] commit: Use BlockBackend for I/O List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Changlong Xie , Kevin Wolf , qemu-block@nongnu.org Cc: jsnow@redhat.com, jcody@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gOBvhQGw50TSUsIsqblrR7scNQ4NQuejF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/24/2016 09:51 PM, Changlong Xie wrote: > On 05/24/2016 09:47 PM, Kevin Wolf wrote: >> + s->base =3D blk_new(); > blk_new(errp); >> + blk_insert_bs(s->base, base); >> + >> + s->top =3D blk_new(); > blk_new(errp); Wrong. Even if it weren't for basing it on top of Kevin's branch which removes the Error parameter, you can't safely pass errp to two functions in a row (if both functions fail, the second will cause an assertion error for trying to set an already-set error); the correct usage when calling multiple functions that can set errors requires the use of a local Error *err =3D NULL; up front, then error_propagate(errp, err) afte= r each place where it can be set. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --gOBvhQGw50TSUsIsqblrR7scNQ4NQuejF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXRSRQAAoJEKeha0olJ0NqijcH/33JxoDpBbn1jSxseqUuNimq KruFMA8Iqxam51LgxkyeXznSxMPU+58l4NxS/0/kpVLMVFkoN2gDDsS8+233EQ90 RbNb+4ZEAmyEVTGE6uaO/QDxabmnDec/U0WzGYTZvUW8mfFkMnwSCtLUxgK2Mr2h BApv2Rej7rXFBB2kSjzX41NVhJUkMs2T6+CgfqBf64oPnIQBzpMGXmwCXYQ6yZEQ ygUhBFs+yj7881hNfXGVSw0NJDoEfkVs1GUT8gbNN0wDbDjW7FZhZv1NpB6xLAkp LJOCKl5hFbNRb6zEgYRYTsJoZce5gdBQ0jZX+Kv4Ygu4HQqwvi3NVKqEcCGOwtk= =kL5L -----END PGP SIGNATURE----- --gOBvhQGw50TSUsIsqblrR7scNQ4NQuejF--