All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] block/mirror: Fix target backing BDS
@ 2016-06-06 14:42 Max Reitz
  2016-06-06 14:42 ` [Qemu-devel] [PATCH v2 1/3] block: Allow replacement of a BDS by its overlay Max Reitz
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Max Reitz @ 2016-06-06 14:42 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, Max Reitz, Kevin Wolf, Fam Zheng

Issue #1: Sometimes we can have a wrong backing BDS for the target after
a mirror block job. In "existing" mode with drive-mirror, or when using
blockdev-mirror, it's generally the user's fault. In "absolute-paths"
mode this only means that after a sync=full drive-mirror, the target may
have a backing file, but this will not change its visible data, so it's
"fine".

Still, it's ugly.

Issue #2: Currently the backing chain of the target is basically opened
using bdrv_open_backing_file() (except for sometimes™). This results in
multiple BDSs for a single physical file, which is bad. In most use
cases, this is only temporary, but it still is bad.

We can just reuse the existing backing chain of the source, so we should
do so.


Patch 2 fixes the issue. Patch 1 allows change_parent_backing_link() to
replace a BDS by its immediate overlay (which is necessary so that patch
2 can set the source BDS as the backing BDS of the target (sync=none) in
mirror_complete(), i.e. before bdrv_replace_in_backing_chain() is called
in mirror_exit()).

Patch 3 adds a test.


v2:
- Move the whole logic to mirror_complete(). This has the benefit of
  resolving the bdrv_open_backing_file() issue with multiple BDSs being
  open for a single physical file (which is a very real issue when it
  comes to image locking).
- However, this also has the drawback of requiring patch 1. So it needed
  to be added.


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/3:[down] 'block: Allow replacement of a BDS by its overlay'
002/3:[0030] [FC] 'block/mirror: Fix target backing BDS'
003/3:[----] [--] 'iotests: Add test for post-mirror backing chains'


Max Reitz (3):
  block: Allow replacement of a BDS by its overlay
  block/mirror: Fix target backing BDS
  iotests: Add test for post-mirror backing chains

 block.c                    |  23 +++--
 block/mirror.c             |  21 +++--
 tests/qemu-iotests/155     | 218 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/155.out |   5 ++
 tests/qemu-iotests/group   |   1 +
 5 files changed, 251 insertions(+), 17 deletions(-)
 create mode 100755 tests/qemu-iotests/155
 create mode 100644 tests/qemu-iotests/155.out

-- 
2.8.3

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

end of thread, other threads:[~2016-06-09 11:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-06 14:42 [Qemu-devel] [PATCH v2 0/3] block/mirror: Fix target backing BDS Max Reitz
2016-06-06 14:42 ` [Qemu-devel] [PATCH v2 1/3] block: Allow replacement of a BDS by its overlay Max Reitz
2016-06-08  8:58   ` Kevin Wolf
2016-06-08 14:21     ` Max Reitz
2016-06-06 14:42 ` [Qemu-devel] [PATCH v2 2/3] block/mirror: Fix target backing BDS Max Reitz
2016-06-08  9:32   ` Kevin Wolf
2016-06-08 11:28     ` Paolo Bonzini
2016-06-08 11:47       ` Kevin Wolf
2016-06-08 14:40       ` Max Reitz
2016-06-08 14:42         ` Max Reitz
2016-06-08 14:38     ` Max Reitz
2016-06-08 16:54       ` Max Reitz
2016-06-08 15:39     ` Nir Soffer
2016-06-09  8:58       ` Kevin Wolf
2016-06-09 11:16         ` Nir Soffer
2016-06-06 14:42 ` [Qemu-devel] [PATCH v2 3/3] iotests: Add test for post-mirror backing chains 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.