Received: from eggs.gnu.org ([2001:4830:134:3::10]:46920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMWpi-00064p-5r for qemu-devel@nongnu.org; Wed, 27 Aug 2014 02:35:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMWpX-0001a2-9h for qemu-devel@nongnu.org; Wed, 27 Aug 2014 02:35:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMWpW-0001Zo-Iw for qemu-devel@nongnu.org; Wed, 27 Aug 2014 02:35:39 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7R6Zbpo009770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 27 Aug 2014 02:35:37 -0400 From: Markus Armbruster References: <1409077076-29855-1-git-send-email-stefanha@redhat.com> <1409077076-29855-4-git-send-email-stefanha@redhat.com> Date: Wed, 27 Aug 2014 08:35:33 +0200 In-Reply-To: <1409077076-29855-4-git-send-email-stefanha@redhat.com> (Stefan Hajnoczi's message of "Tue, 26 Aug 2014 19:17:56 +0100") Message-ID: <87r402fnii.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/3] qemu-img: always goto out in img_snapshot() error paths List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Jeff Cody , jsnow@redhat.com, qemu-devel@nongnu.org Stefan Hajnoczi writes: > The out label has the qemu_progress_end() and other cleanup calls. > Always goto out in error paths so the cleanup happens. > > Note that bdrv_unref(NULL) is safe. We just need to initialize bs to > NULL at the top of the function. > > We can now remove the obsolete bs_old_backing = NULL and bs_new_backing > = NULL for safe mode. Originally it was necessary in commit 3e85c6fd > ("qemu-img rebase") but became useless in commit c2abcce ("qemu-img: > avoid calling exit(1) to release resources properly") because the > variables are already initialized during declaration. Please mention here that you fix exit code.from -1 to 1. > > Reported-by: John Snow > Signed-off-by: Stefan Hajnoczi [...]