qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] block: mirror - Write zeroes for unallocated sectors if no zero init
@ 2015-09-28  3:29 Jeff Cody
  2015-09-28  3:29 ` [Qemu-devel] [PATCH 1/3] block: allow creation of detached dirty bitmaps Jeff Cody
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Jeff Cody @ 2015-09-28  3:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha, qemu-block

When doing a block mirror to a target that does not support zero init (e.g.
host device and raw format), unallocated sectors on the source may lead to a
corrupted target image.

Unallocated sectors are skipped over during block mirror (the dirty bitmap is
only loaded with allocated sectors), so whatever data is already present on
the target device in those sectors will likely still be there, leading the guest
to read invalid data.

There are 3 patches in this series:

Patch 1 allows block device dirty bitmaps to be created but not attached (i.e.
placed in the dirty_bitmaps list) to a BDS. This clears the way to having a
bitmap to be used to track unallocated sectors above the 'base' image.

Patch 2 splits out the mirror code that invokes mirror_iteration(), so that
we can in later patches run it multiple times using different bitmaps.

Patch 3 introduces a 2-pass mirror streaming approach, whereas the first
pass writes zeroes for unallocated source sectors (if appropriate for the image
type), and the second pass writes the actual source data.


Jeff Cody (3):
  block: allow creation of detached dirty bitmaps
  block: mirror - split out part of mirror_run()
  block: mirror - zero unallocated target sectors when zero init not
    present

 block.c                   |  26 +++-
 block/mirror.c            | 302 ++++++++++++++++++++++++++++------------------
 blockdev.c                |   4 +-
 include/block/block.h     |   1 +
 include/block/block_int.h |   3 +-
 migration/block.c         |   2 +-
 qapi/block-core.json      |   6 +-
 7 files changed, 214 insertions(+), 130 deletions(-)

-- 
1.9.3

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

end of thread, other threads:[~2015-10-01  8:23 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28  3:29 [Qemu-devel] [PATCH 0/3] block: mirror - Write zeroes for unallocated sectors if no zero init Jeff Cody
2015-09-28  3:29 ` [Qemu-devel] [PATCH 1/3] block: allow creation of detached dirty bitmaps Jeff Cody
2015-09-28 14:41   ` Kevin Wolf
2015-09-28 15:13   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-09-28 16:38   ` Max Reitz
2015-09-28  3:29 ` [Qemu-devel] [PATCH 2/3] block: mirror - split out part of mirror_run() Jeff Cody
2015-09-28 14:17   ` Paolo Bonzini
2015-09-28 14:47   ` Kevin Wolf
2015-09-28 16:50   ` [Qemu-devel] [Qemu-block] " Max Reitz
2015-09-28  3:29 ` [Qemu-devel] [PATCH 3/3] block: mirror - zero unallocated target sectors when zero init not present Jeff Cody
2015-09-28 14:13   ` Paolo Bonzini
2015-09-28 20:31     ` Eric Blake
2015-09-29  8:10       ` Kevin Wolf
2015-09-29  8:42         ` Paolo Bonzini
2015-09-29  9:35           ` Kevin Wolf
2015-09-29 10:52             ` Paolo Bonzini
2015-09-30 14:43               ` Jeff Cody
2015-09-30 15:16                 ` Paolo Bonzini
2015-09-30 15:26                 ` Kevin Wolf
2015-09-30 16:02                   ` Jeff Cody
2015-09-30 16:06                     ` Paolo Bonzini
2015-10-01  8:23                       ` Kevin Wolf
2015-09-28 21:32     ` Jeff Cody
2015-09-29  2:48       ` Eric Blake
2015-09-28 15:07   ` Kevin Wolf
2015-09-28 21:57     ` Jeff Cody
2015-09-29  8:28       ` Kevin Wolf
2015-09-28 15:10   ` Kevin Wolf
2015-09-28 21:58     ` Jeff Cody
2015-09-28 15:23   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-09-30 15:11     ` Jeff Cody
2015-09-30 15:28       ` Kevin Wolf
2015-09-28 17:32   ` Max Reitz
2015-09-29  8:39     ` Kevin Wolf
2015-09-29 14:47       ` [Qemu-devel] " Paolo Bonzini

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