From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqT2Z-0003ZF-Rl for qemu-devel@nongnu.org; Thu, 26 Jan 2012 12:23:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqT2Y-0003JU-7U for qemu-devel@nongnu.org; Thu, 26 Jan 2012 12:23:15 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:60416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqT2X-0003D7-VH for qemu-devel@nongnu.org; Thu, 26 Jan 2012 12:23:14 -0500 Received: by mail-iy0-f173.google.com with SMTP id k25so1227300iah.4 for ; Thu, 26 Jan 2012 09:23:13 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 26 Jan 2012 18:22:36 +0100 Message-Id: <1327598569-5199-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1327598569-5199-1-git-send-email-pbonzini@redhat.com> References: <1327598569-5199-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v2 05/18] block: remove enable_write_cache List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com This duplicates a bit in open_flags, we do not need it. Signed-off-by: Paolo Bonzini --- block.c | 3 +-- block_int.h | 3 --- 2 files changed, 1 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index 5055975..afc327e 100644 --- a/block.c +++ b/block.c @@ -607,7 +607,6 @@ static int bdrv_open_common(BlockDriverState *bs, const char *filename, bs->drv = drv; bs->opaque = g_malloc0(drv->instance_size); - bs->enable_write_cache = !!(flags & BDRV_O_CACHE_WB); bs->keep_read_only = bs->read_only = !(bs->open_flags & BDRV_O_RDWR); /* Open the image, either directly or using a protocol */ @@ -2040,7 +2039,7 @@ int bdrv_is_sg(BlockDriverState *bs) int bdrv_enable_write_cache(BlockDriverState *bs) { - return bs->enable_write_cache; + return !!(bs->open_flags & BDRV_O_CACHE_WB); } int bdrv_is_encrypted(BlockDriverState *bs) diff --git a/block_int.h b/block_int.h index 7be2988..0bbebe4 100644 --- a/block_int.h +++ b/block_int.h @@ -277,9 +277,6 @@ struct BlockDriverState { /* the memory alignment required for the buffers handled by this driver */ int buffer_alignment; - /* do we need to tell the quest if we have a volatile write cache? */ - int enable_write_cache; - /* NOTE: the following infos are only hints for real hardware drivers. They are not used by the block driver */ int cyls, heads, secs, translation; -- 1.7.7.6