From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwlB7-0004Dy-00 for qemu-devel@nongnu.org; Thu, 12 Nov 2015 01:16:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwlB6-000765-2v for qemu-devel@nongnu.org; Thu, 12 Nov 2015 01:16:12 -0500 Date: Thu, 12 Nov 2015 14:16:02 +0800 From: Fam Zheng Message-ID: <20151112061602.GB4082@ad.usersys.redhat.com> References: <1447108773-6836-1-git-send-email-mreitz@redhat.com> <1447108773-6836-3-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447108773-6836-3-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 02/24] blockjob: Call bdrv_unref() on creation error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , John Snow On Mon, 11/09 23:39, Max Reitz wrote: > If block_job_create() fails, it should release its reference to the > job's BDS. Normally, this is done in the callback provided by the > caller, but that callback will not be invoked if the block job failed to > be created. > > Signed-off-by: Max Reitz > Reviewed-by: Alberto Garcia > Reviewed-by: Kevin Wolf > --- > blockjob.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/blockjob.c b/blockjob.c > index c02fe59..0886a4a 100644 > --- a/blockjob.c > +++ b/blockjob.c > @@ -70,6 +70,7 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs, > if (local_err) { > block_job_release(bs); > error_propagate(errp, local_err); > + bdrv_unref(bs); > return NULL; > } > } > -- > 2.6.2 > > Reviewed-by: Fam Zheng