Received: from eggs.gnu.org ([2001:4830:134:3::10]:55962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3iE2-00043u-PE for qemu-devel@nongnu.org; Tue, 01 Dec 2015 05:32:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3iDy-00065I-T2 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 05:31:58 -0500 From: Alberto Garcia In-Reply-To: <1447127063-4662-3-git-send-email-mreitz@redhat.com> References: <1447127063-4662-1-git-send-email-mreitz@redhat.com> <1447127063-4662-3-git-send-email-mreitz@redhat.com> Date: Tue, 01 Dec 2015 11:31:43 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 2/8] block: Drop useless bdrv_new() calls 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:17 AM CET, Max Reitz wrote: > bdrv_append_temp_snapshot() uses bdrv_new() to create an empty BDS > before invoking bdrv_open() on that BDS. This is probably a relict from > when it used to do some modifications on that empty BDS, but now that is > unnecessary, so we can just set bs_snapshot to NULL and let bdrv_open() > do the rest. > > The same applies to bdrv_open_backing_file(). There is even a bit more > cruft here: The assert() was intended for the BDS which is indirectly > passed as the first bdrv_open() argument, so we can now drop it, too. > > Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Berto