All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] block/drive-mirror: Check for NULL backing_hd
@ 2013-11-05  0:35 Max Reitz
  2013-11-05  0:35 ` [Qemu-devel] [PATCH v2 1/2] " Max Reitz
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Max Reitz @ 2013-11-05  0:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi, Max Reitz

It should be possible to execute the QMP "drive-mirror" command in
"none" sync mode and "absolute-paths" mode even for block devices
lacking a backing file.

"absolute-paths" does in fact not require a backing file to be present,
as can be seen from the "top" sync mode code path. "top" basically
states that the device should indeed have a backing file - however, the
current code catches the case if it doesn't and then simply treats it as
"full" sync mode, creating a target image without a backing file (in
"absolute-paths" mode). Thus, "absolute-paths" does not imply the target
file must indeed have a backing file.

Therefore, the target file may be left unbacked in case of "none" sync
mode as well, if the specified device is not backed either. Currently,
qemu will crash trying to dereference the backing file pointer since it
assumes that it will always be non-NULL in that case ("none" with
"absolute-paths").

The first patch in this series adds a check whether the specified block
device is backed or not (creating an unbacked target image, if required);
the second patch adds a test case for mirroring unbacked block devices.


Max Reitz (2):
  block/drive-mirror: Check for NULL backing_hd
  qemu-iotests: Add test for unbacked mirroring

 blockdev.c                 |  4 +-
 tests/qemu-iotests/070     | 91 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/070.out | 33 +++++++++++++++++
 tests/qemu-iotests/group   |  1 +
 4 files changed, 127 insertions(+), 2 deletions(-)
 create mode 100755 tests/qemu-iotests/070
 create mode 100644 tests/qemu-iotests/070.out

-- 
1.8.4.2

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

end of thread, other threads:[~2013-11-05 19:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-05  0:35 [Qemu-devel] [PATCH v2 0/2] block/drive-mirror: Check for NULL backing_hd Max Reitz
2013-11-05  0:35 ` [Qemu-devel] [PATCH v2 1/2] " Max Reitz
2013-11-05  3:32   ` Fam Zheng
2013-11-05 19:06     ` Max Reitz
2013-11-05  0:35 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: Add test for unbacked mirroring Max Reitz
2013-11-05  9:00   ` Wenchao Xia
2013-11-05 19:08     ` Max Reitz
2013-11-05 10:53 ` [Qemu-devel] [PATCH v2 0/2] block/drive-mirror: Check for NULL backing_hd Paolo Bonzini

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.