From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWsYO-000329-GR for qemu-devel@nongnu.org; Wed, 24 Sep 2014 15:48:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWsYG-0008IR-JT for qemu-devel@nongnu.org; Wed, 24 Sep 2014 15:48:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWsYG-0008Hi-Ae for qemu-devel@nongnu.org; Wed, 24 Sep 2014 15:48:36 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8OJmTI3008826 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 24 Sep 2014 15:48:30 -0400 From: Max Reitz Date: Wed, 24 Sep 2014 21:48:23 +0200 Message-Id: <1411588107-4275-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] block: Drop BDS.filename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz The BDS filename field is generally only used when opening disk images or emitting error or warning messages, the only exception to this rule is the map command of qemu-img. However, using exact_filename there instead should not be a problem. Therefore, we can drop the filename field from the BlockDriverState and use a function instead which builds the filename from scratch when called. This is slower than reading a static char array but the problem of that static array is that it may become obsolete due to changes in any BlockDriverState or in the BDS graph. Using a function which rebuilds the filename every time it is called resolves this problem. The disadvantage of worse performance is negligible, on the other hand. After patch 2 of this series, which replaces some queries of BDS.filename by reads from somewhere else (mostly BDS.exact_filename), the filename field is only used when a disk image is opened or some message should be emitted, both of which cases do not suffer from the performance hit. Max Reitz (4): block: Change bdrv_get_encrypted_filename() block: Avoid BlockDriverState.filename block: Add bdrv_filename() block: Drop BlockDriverState.filename block.c | 90 ++++++++++++++++++++++++++++++++--------------- block/commit.c | 4 ++- block/gluster.c | 2 +- block/mirror.c | 14 +++++--- block/qapi.c | 7 ++-- block/raw-posix.c | 8 ++--- block/raw-win32.c | 4 +-- block/vhdx-log.c | 5 ++- block/vmdk.c | 22 ++++++++---- block/vpc.c | 6 ++-- blockdev.c | 21 ++++++++--- include/block/block.h | 3 +- include/block/block_int.h | 1 - monitor.c | 7 ++-- qemu-img.c | 2 +- qmp.c | 4 ++- 16 files changed, 136 insertions(+), 64 deletions(-) -- 2.1.0