Received: from eggs.gnu.org ([2001:4830:134:3::10]:43333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3m2I-000072-Ga for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:36:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3m2H-00065S-L3 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 09:36:06 -0500 From: Alberto Garcia In-Reply-To: <1447127063-4662-4-git-send-email-mreitz@redhat.com> References: <1447127063-4662-1-git-send-email-mreitz@redhat.com> <1447127063-4662-4-git-send-email-mreitz@redhat.com> Date: Tue, 01 Dec 2015 15:35:13 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org 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. */ > char *tmp_filename = g_malloc0(PATH_MAX + 1); > @@ -1354,11 +1355,15 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp) > goto out; > } > > + bdrv_ref(bs_snapshot); > bdrv_append(bs_snapshot, bs); > > + g_free(tmp_filename); > + return bs_snapshot; > + > out: > g_free(tmp_filename); > - return ret; > + return NULL; > } If I'm not wrong, now that you're not returning 'ret' anymore there's a "ret = total_size" line earlier in this function that is useless now. Other than that, Reviewed-by: Alberto Garcia Berto