From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOSn0-0002fJ-69 for qemu-devel@nongnu.org; Tue, 24 Sep 2013 09:36:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOSmr-0004Ud-4q for qemu-devel@nongnu.org; Tue, 24 Sep 2013 09:36:30 -0400 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:48794 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOSmq-0004TU-PT for qemu-devel@nongnu.org; Tue, 24 Sep 2013 09:36:21 -0400 From: Peter Lieven Date: Tue, 24 Sep 2013 15:34:54 +0200 Message-Id: <1380029714-5239-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCHv3 00/20] block: logical block provisioning enhancements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, Peter Lieven , stefanha@redhat.com, anthony@codemonkey.ws, pbonzini@redhat.com this patch adds the ability for targets to stay sparse during block migration (if the zero_blocks capability is set) and qemu-img convert even if the target does not have has_zero_init = 1. the series was especially developed for iSCSI, but it should also work with other drivers with little or no adjustments. these adjustments should be limited to providing block provisioning information through get_block_info and/or honouring BDRV_REQ_MAY_UNMAP on writing zeroes. there are also 4 patches which are fixes/enhancements for the get_block_status API discovered during development of this series. v2->v3: - fix merge conflict in block/qcow2_cluster.c - changed return type of bdrv_has_discard_zeroes and bdrv_has_discard_write_zeroes to bool. - moved alignment and limits info to a BlockLimits struct (Paolo). - added magic constanst for default maximum in bdrv_co_do_write_zeroes and bdrv_co_discard (Eric). - bdrv_co_do_write_zeroes: allocating the bounce buffer only once (Eric), fixed bounce iov_len in the fall back path. - bdrv_zeroize: added inline docu (Eric) and do not mask flags passed to bdrv_write_zeroes (Eric). - qemu-img: changed the default hint for -S (min_sparse) in the usage help to 4k. not changing the default as it is unclear why this default was set. size suffixes are already supported (Eric). v1->v2: - moved block max_discard and max_write_zeroes to BlockDriverState - added discard_alignment and write_zeroes_alignment to BlockDriverState - added bdrv_has_discard_zeroes() and bdrv_has_discard_write_zeroes() - added logic to bdrv_co_discard and bdrv_co_do_write_zeroes to honour limit and alignment info. - added support for -S 0 in qemu-img convert. Peter Lieven (20): block: make BdrvRequestFlags public block: add flags to bdrv_*_write_zeroes block: introduce BDRV_REQ_MAY_UNMAP request flag block: introduce bdrv_has_discard_zeroes and bdrv_has_discard_write_zeroes block/raw: add bdrv_has_discard_zeroes and bdrv_has_discard_write_zeroes block: add BlockLimits structure to BlockDriverState block: honour BlockLimits in bdrv_co_do_write_zeroes block: honour BlockLimits in bdrv_co_discard iscsi: simplify iscsi_co_discard iscsi: set limits in BlockDriverState iscsi: add bdrv_has_discard_zeroes and bdrv_has_discard_write_zeroes iscsi: add bdrv_co_write_zeroes block: introduce bdrv_zeroize block/get_block_status: set *pnum = 0 on error block/get_block_status: avoid segfault if there is no backing_hd block/get_block_status: avoid redundant callouts on raw devices block/get_block_status: fix BDRV_BLOCK_ZERO for unallocated blocks qemu-img: add support for fully allocated images qemu-img: conditionally zero out target on convert block/raw: copy BlockLimits on raw_open block-migration.c | 3 +- block.c | 205 +++++++++++++++++++++++++++++++++++++-------- block/backup.c | 3 +- block/iscsi.c | 152 ++++++++++++++++++++++++--------- block/qcow2-cluster.c | 2 +- block/qcow2.c | 2 +- block/qed.c | 3 +- block/raw_bsd.c | 62 ++++++++------ block/vmdk.c | 3 +- include/block/block.h | 19 ++++- include/block/block_int.h | 32 ++++++- qemu-img.c | 18 +++- qemu-io-cmds.c | 2 +- 13 files changed, 393 insertions(+), 113 deletions(-) -- 1.7.9.5