qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/11] block: Fix some things about bdrv_has_zero_init()
@ 2019-07-24 17:12 Max Reitz
  2019-07-24 17:12 ` [Qemu-devel] [PATCH v2 01/11] qemu-img: Fix bdrv_has_zero_init() use in convert Max Reitz
                   ` (11 more replies)
  0 siblings, 12 replies; 34+ messages in thread
From: Max Reitz @ 2019-07-24 17:12 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, Stefano Garzarella, qemu-devel, Max Reitz

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



^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2019-08-09 19:32 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-24 17:12 [Qemu-devel] [PATCH v2 00/11] block: Fix some things about bdrv_has_zero_init() Max Reitz
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

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).