From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4BAy-0001wu-8Y for qemu-devel@nongnu.org; Wed, 02 Dec 2015 12:26:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4BAv-00045R-7F for qemu-devel@nongnu.org; Wed, 02 Dec 2015 12:26:44 -0500 References: <1447127063-4662-1-git-send-email-mreitz@redhat.com> <1447127063-4662-4-git-send-email-mreitz@redhat.com> From: Max Reitz Message-ID: <565F29C3.6000004@redhat.com> Date: Wed, 2 Dec 2015 18:26:27 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wMApm3ifGwsV1L1C2Luj7QOfVTMs750Of" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit() return the snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wMApm3ifGwsV1L1C2Luj7QOfVTMs750Of Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 01.12.2015 15:35, Alberto Garcia wrote: > On Tue 10 Nov 2015 04:44:18 AM CET, Max Reitz wrote: >> -int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error = **errp) >> +static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *= bs, >> + int flags, Error *= *errp) >> { >> /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows= =2E */ >> char *tmp_filename =3D g_malloc0(PATH_MAX + 1); >> @@ -1354,11 +1355,15 @@ int bdrv_append_temp_snapshot(BlockDriverState= *bs, int flags, Error **errp) >> goto out; >> } >> =20 >> + bdrv_ref(bs_snapshot); >> bdrv_append(bs_snapshot, bs); >> =20 >> + g_free(tmp_filename); >> + return bs_snapshot; >> + >> out: >> g_free(tmp_filename); >> - return ret; >> + return NULL; >> } >=20 > If I'm not wrong, now that you're not returning 'ret' anymore there's a= > "ret =3D total_size" line earlier in this function that is useless now.= Yes, indeed, thanks for finding that. Will fix. Max > Other than that, >=20 > Reviewed-by: Alberto Garcia >=20 > Berto >=20 --wMApm3ifGwsV1L1C2Luj7QOfVTMs750Of 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 iQEcBAEBCAAGBQJWXynDAAoJEDuxQgLoOKyt/WsH/i0aj7glgeMG43pxQLMDaz8x AK+8iuPEew0uLAsU5C6nbyNiD3+mgWPG1jmvYK9UdKZ6XwGYv0hcH3WomZHLGBri BeWrdK//OY3Q+otzYPDXCQi4J0T2Ar2SnsV9XTjrnue4PlOMaK7BAUC2/b/F9ZiB GU8OUYartNo1BJehzIxMqcfYOOQMfvRynXJsCAsI6Dj0VjRX1XKMYBIYfX/T2Cfk FI5Cpb2kBwrCKATpdcPsDBOSYj8VSdjlvj+CDRrEDUtXRL6+S0qk80dJnlxJMAKn hhXy7egOtCFG/HAV3bqpFunYW0avU4BAr9e9rOauoC5ZMNgRYAbprgdH2bHBXdE= =8BpB -----END PGP SIGNATURE----- --wMApm3ifGwsV1L1C2Luj7QOfVTMs750Of--