All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] qemu-img: Fix preallocation with -S 0 for convert
@ 2016-02-20 17:39 Max Reitz
  2016-02-20 17:39 ` [Qemu-devel] [PATCH 1/4] " Max Reitz
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Max Reitz @ 2016-02-20 17:39 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, Fam Zheng, qemu-devel, Max Reitz

Using -S 0 is supposed to allocate everything in the output image; or at
least it is supposed to always explicitly write zeros even if the area
in question is known to only contain zeros. That doesn't always work
right now, so this series fixes it (patch 1, to be specific).

I only noticed after I had written the test added by patch 4 that we
already had an -S 0 test case which is included in the iotest 122.
However, the test added here works for all image formats and is maybe
more of a direct test (instead of querying the format whether it thinks
it allocated all of the data we directly ask du whether everything has
been allocated) so maybe it reflects better what users expect -S 0 to
do. Maybe.

Patches 2 and 3 are required for the test. I could have written the test
without doing a convert with null-co as the source, but that would have
been boring, so I did not.

If you want to argue that in light of the existence of test 122 the new
test added here is unnecessary and we therefore do not need patches 2, 3
and 4, please go ahead. I won't put up too much of a fight.


Max Reitz (4):
  qemu-img: Fix preallocation with -S 0 for convert
  block/null-{co,aio}: Return zeros when read
  block/null-{co,aio}: Implement get_block_status()
  iotests: Test qemu-img convert -S 0 behavior

 block/null.c               |  19 ++++++++
 qemu-img.c                 |  37 ++++++++++------
 tests/qemu-iotests/122.out |   6 +--
 tests/qemu-iotests/146     | 105 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/146.out |  14 ++++++
 tests/qemu-iotests/group   |   1 +
 6 files changed, 165 insertions(+), 17 deletions(-)
 create mode 100755 tests/qemu-iotests/146
 create mode 100644 tests/qemu-iotests/146.out

-- 
2.7.1

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

end of thread, other threads:[~2016-02-22 17:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-20 17:39 [Qemu-devel] [PATCH 0/4] qemu-img: Fix preallocation with -S 0 for convert Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 1/4] " Max Reitz
2016-02-22 12:50   ` Kevin Wolf
2016-02-22 16:43     ` Max Reitz
2016-02-22 17:24       ` Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 2/4] block/null-{co, aio}: Return zeros when read Max Reitz
2016-02-22 16:31   ` Eric Blake
2016-02-22 16:45     ` Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 3/4] block/null-{co, aio}: Implement get_block_status() Max Reitz
2016-02-20 17:39 ` [Qemu-devel] [PATCH 4/4] iotests: Test qemu-img convert -S 0 behavior Max Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.