blockdev: add sync mode to drive-backup QMP command

Enterprise / Virtualization / QEMU - Stefan Hajnoczi [redhat.com] - 15 July 2013 02:49 UTC

The drive-backup command is similar to the drive-mirror command, except no guest data written after the command executes gets copied. Add a sync mode argument which determines whether the entire disk is copied, just allocated clusters, or only clusters being written to by the guest.

Currently only sync mode 'full' is supported - it copies the entire disk. For read-only point-in-time snapshots we may only need sync mode 'none' since the target can be a qcow2 file using the guest's disk as its backing file (no need to copy the entire disk). Finally, sync mode 'top' is useful if we wish to preserve the backing chain.

Note that this patch just adds the sync mode argument to drive-backup. It does not implement sync modes 'top' or 'none'. This patch is necessary so we can add a drive-backup HMP command that behaves like the existing drive-mirror HMP command and takes a sync mode.

b53169e blockdev: add sync mode to drive-backup QMP command
blockdev.c | 6 ++++++
qapi-schema.json | 7 ++++++-
qmp-commands.hx | 6 +++++-
tests/qemu-iotests/055 | 36 +++++++++++++++++++++---------------
4 files changed, 38 insertions(+), 17 deletions(-)

Upstream: git.qemu.org


  • Share