From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz3q-0000ME-GH for qemu-devel@nongnu.org; Thu, 13 Feb 2014 11:22:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDz3c-0000tq-O6 for qemu-devel@nongnu.org; Thu, 13 Feb 2014 11:22:50 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:49941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz3c-0000tD-Ej for qemu-devel@nongnu.org; Thu, 13 Feb 2014 11:22:36 -0500 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Thu, 13 Feb 2014 17:22:33 +0100 Message-Id: <1392308553-9886-2-git-send-email-benoit.canet@irqsave.net> In-Reply-To: <1392308553-9886-1-git-send-email-benoit.canet@irqsave.net> References: <1392308553-9886-1-git-send-email-benoit.canet@irqsave.net> Subject: [Qemu-devel] [PATCH] blockdev: Fix wrong usage of QDECREF causing snapshoted quorum to crash on close. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , Benoit Canet As bdrv_open() documentation states: "The reference to the QDict belongs to the block layer * after the call (even on failure), so if the caller intends to reuse the * dictionary, it needs to use QINCREF() before calling bdrv_open." the optional options dict will not be reused after bdrv_open() and should belong to the block layer so remove the extra QDECREF(options). Signed-off-by: Benoit Canet --- blockdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 5cd50f3..7fbce6c 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1316,8 +1316,6 @@ static void external_snapshot_prepare(BlkTransactionState *common, if (ret != 0) { error_propagate(errp, local_err); } - - QDECREF(options); } static void external_snapshot_commit(BlkTransactionState *common) -- 1.8.3.2