From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH v2 00/11] block: Fix some things about bdrv_has_zero_init()
Date: Wed, 24 Jul 2019 19:12:28 +0200 [thread overview]
Message-ID: <20190724171239.8764-1-mreitz@redhat.com> (raw)
Hi,
See the previous cover letter for the reason for patches 6 through 9:
https://lists.nongnu.org/archive/html/qemu-block/2019-07/msg00563.html
But no only some bdrv_has_zero_init() implementations are wrong, some
callers also use it the wrong way.
First, qemu-img and mirror use it for pre-existing images, where it
doesn’t have any meaning. Both should consider pre-existing images to
always be non-zero and not look at bdrv_has-zero_init() (patches 1, 2,
and the tests in 10 and 11).
Second, vhdx and parallels call bdrv_has_zero_init() when they do not
really care about an image’s post-create state but only about what
happens when you grow an image. That is a bit ugly, and also overly
safe when growing preallocated images without preallocating the new
areas. So this series adds a new function bdrv_has_zero_init_truncate()
that is more suited to vhdx's and parallel's needs (patches 3 through
5).
v2:
- Simplified preallocation checks in qcow2 and vhdx [Kevin]
- Added patches 1 – 5, 10, 11
git-backport-diff against v1:
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/11:[down] 'qemu-img: Fix bdrv_has_zero_init() use in convert'
002/11:[down] 'mirror: Fix bdrv_has_zero_init() use'
003/11:[down] 'block: Add bdrv_has_zero_init_truncate()'
004/11:[down] 'block: Implement .bdrv_has_zero_init_truncate()'
005/11:[down] 'block: Use bdrv_has_zero_init_truncate()'
006/11:[0077] [FC] 'qcow2: Fix .bdrv_has_zero_init()'
007/11:[----] [--] 'vdi: Fix .bdrv_has_zero_init()'
008/11:[0021] [FC] 'vhdx: Fix .bdrv_has_zero_init()'
009/11:[----] [--] 'iotests: Convert to preallocated encrypted qcow2'
010/11:[down] 'iotests: Test convert -n to pre-filled image'
011/11:[down] 'iotests: Full mirror to existing non-zero image'
Max Reitz (11):
qemu-img: Fix bdrv_has_zero_init() use in convert
mirror: Fix bdrv_has_zero_init() use
block: Add bdrv_has_zero_init_truncate()
block: Implement .bdrv_has_zero_init_truncate()
block: Use bdrv_has_zero_init_truncate()
qcow2: Fix .bdrv_has_zero_init()
vdi: Fix .bdrv_has_zero_init()
vhdx: Fix .bdrv_has_zero_init()
iotests: Convert to preallocated encrypted qcow2
iotests: Test convert -n to pre-filled image
iotests: Full mirror to existing non-zero image
include/block/block.h | 1 +
include/block/block_int.h | 9 ++++++
block.c | 21 +++++++++++++
block/file-posix.c | 1 +
block/file-win32.c | 1 +
block/gluster.c | 4 +++
block/mirror.c | 11 +++++--
block/nfs.c | 1 +
block/parallels.c | 2 +-
block/qcow2.c | 30 +++++++++++++++++-
block/qed.c | 1 +
block/raw-format.c | 6 ++++
block/rbd.c | 1 +
block/sheepdog.c | 1 +
block/ssh.c | 1 +
block/vdi.c | 13 +++++++-
block/vhdx.c | 28 +++++++++++++++--
blockdev.c | 16 ++++++++--
qemu-img.c | 11 +++++--
tests/test-block-iothread.c | 2 +-
tests/qemu-iotests/041 | 62 ++++++++++++++++++++++++++++++++++---
tests/qemu-iotests/041.out | 4 +--
tests/qemu-iotests/122 | 17 ++++++++++
tests/qemu-iotests/122.out | 8 +++++
tests/qemu-iotests/188 | 20 +++++++++++-
tests/qemu-iotests/188.out | 4 +++
26 files changed, 254 insertions(+), 22 deletions(-)
--
2.21.0
next reply other threads:[~2019-07-24 17:13 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 17:12 Max Reitz [this message]
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 01/11] qemu-img: Fix bdrv_has_zero_init() use in convert Max Reitz
2019-07-25 15:28 ` Maxim Levitsky
2019-07-26 9:36 ` Stefano Garzarella
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 02/11] mirror: Fix bdrv_has_zero_init() use Max Reitz
2019-07-25 15:28 ` Maxim Levitsky
2019-07-25 16:21 ` Max Reitz
2019-07-25 16:24 ` Max Reitz
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 03/11] block: Add bdrv_has_zero_init_truncate() Max Reitz
2019-07-25 15:28 ` Maxim Levitsky
2019-07-26 9:04 ` Stefano Garzarella
2019-07-26 10:58 ` Max Reitz
2019-07-26 12:17 ` Stefano Garzarella
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 04/11] block: Implement .bdrv_has_zero_init_truncate() Max Reitz
2019-07-25 15:29 ` Maxim Levitsky
2019-07-26 9:42 ` Stefano Garzarella
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 05/11] block: Use bdrv_has_zero_init_truncate() Max Reitz
2019-07-25 15:29 ` Maxim Levitsky
2019-07-26 9:43 ` Stefano Garzarella
2019-07-26 11:00 ` Max Reitz
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 06/11] qcow2: Fix .bdrv_has_zero_init() Max Reitz
2019-07-25 15:29 ` Maxim Levitsky
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 07/11] vdi: " Max Reitz
2019-07-25 15:29 ` Maxim Levitsky
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 08/11] vhdx: " Max Reitz
2019-07-25 15:30 ` Maxim Levitsky
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 09/11] iotests: Convert to preallocated encrypted qcow2 Max Reitz
2019-07-25 15:30 ` Maxim Levitsky
2019-07-25 16:27 ` Max Reitz
2019-08-09 19:18 ` Max Reitz
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 10/11] iotests: Test convert -n to pre-filled image Max Reitz
2019-07-25 15:30 ` Maxim Levitsky
2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 11/11] iotests: Full mirror to existing non-zero image Max Reitz
2019-08-09 19:31 ` [Qemu-devel] [PATCH v2 00/11] block: Fix some things about bdrv_has_zero_init() Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190724171239.8764-1-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).