From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr0iq-0003jA-Do for qemu-devel@nongnu.org; Tue, 27 Oct 2015 05:39:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr0ip-0000Ff-Gu for qemu-devel@nongnu.org; Tue, 27 Oct 2015 05:39:16 -0400 Date: Tue, 27 Oct 2015 10:39:08 +0100 From: Kevin Wolf Message-ID: <20151027093908.GA4065@noname.str.redhat.com> References: <1445280546-26226-1-git-send-email-mreitz@redhat.com> <1445280546-26226-6-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445280546-26226-6-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 5/6] block: Drop BlockDriverState.filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org Am 19.10.2015 um 20:49 hat Max Reitz geschrieben: > That field is now only used during initialization of BlockDriverStates > (opening images) and for error or warning messages. Performance is not > that much of an issue here, so we can drop the field and replace its use > by a call to bdrv_filename(). By doing so we can ensure the result > always to be recent, whereas the contents of BlockDriverState.filename > may have been obsoleted by manipulations of single BlockDriverStates or > of the BDS graph. > > The users of the BDS filename field were changed as follows: > - copying the filename into another buffer is trivially replaced by > using bdrv_filename() instead of the copy function > - strdup() on the filename is replaced by a call to > bdrv_filename(filename, NULL, 0) > - bdrv_filename(bs, bs->filename, sizeof(bs->filename)) is replaced by > bdrv_refresh_filename(bs) > (these were introduced by the patch before the previous patch) > - anywhere else bdrv_filename(..., NULL, 0) is used, any access to > BlockDriverState.filename is then replaced by the buffer returned, and > it is freed when it is no longer needed > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf