From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
Ian Main <imain@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
dietmar@proxmox.com
Subject: [Qemu-devel] [PATCH 0/3] block: block-backup live backup command
Date: Tue, 23 Apr 2013 18:25:05 +0200 [thread overview]
Message-ID: <1366734308-11724-1-git-send-email-stefanha@redhat.com> (raw)
This series adds a new QMP command, block-backup, which takes a point-in-time
snapshot of a block device. The snapshot is copied out to a target block
device. A simple example is:
block-backup device=virtio0 format=qcow2 target=backup-20130401.qcow2
The original block-backup blockjob was written by Dietmar Maurer
<dietmar@proxmox.com>. He is currently busy but I feel the feature is worth
pushing into QEMU since there has been interest. This is my version of his
patch, plus the QMP command and qemu-iotests test case.
How is this different from block-stream and drive-mirror?
---------------------------------------------------------
Both block-stream and drive-mirror do not provide immediate point-in-time
snapshots. Instead they copy data into a new file and then switch to it. In
other words, the point at which the "snapshot" is taken cannot be controlled
directly.
block-backup intercepts guest writes and saves data into the target block
device before it is overwritten. The target block device can be a raw image
file, backing files are not used to implement this feature.
How can block-backup be used?
-----------------------------
The simplest use-case is to copy a point-in-time snapshot to a local file.
More advanced users may wish to make the target an NBD URL. The NBD server
listening on the other side can process the backup writes any way it wishes. I
previously posted an RFC series with a backup server that streamed Dietmar's
VMA backup archive format.
What's next for block-backup?
-----------------------------
The following enhancements are left for future patches:
1. QMP 'transaction' support. It is handy to atomically snapshot multiple
block devices. We need qmp_transaction() support for this. Wenchao Xia is
currently making qmp_transaction() extensible so new action types, like
block-backup, can be added.
2. Sync modes like drive-mirror (top, full, none). This makes it possible to
preserve the backing file chain.
Dietmar Maurer (1):
block: add basic backup support to block driver
Stefan Hajnoczi (2):
block: add block_backup QMP command
qemu-iotests: add 054 block-backup test case
block.c | 69 ++++++++++++-
block/Makefile.objs | 1 +
block/backup.c | 252 +++++++++++++++++++++++++++++++++++++++++++++
blockdev.c | 92 +++++++++++++++++
include/block/block.h | 2 +
include/block/block_int.h | 16 +++
include/block/blockjob.h | 10 ++
qapi-schema.json | 28 +++++
qmp-commands.hx | 6 ++
tests/qemu-iotests/054 | 230 +++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/054.out | 5 +
tests/qemu-iotests/group | 1 +
12 files changed, 707 insertions(+), 5 deletions(-)
create mode 100644 block/backup.c
create mode 100755 tests/qemu-iotests/054
create mode 100644 tests/qemu-iotests/054.out
--
1.8.1.4
next reply other threads:[~2013-04-23 16:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 16:25 Stefan Hajnoczi [this message]
2013-04-23 16:25 ` [Qemu-devel] [PATCH 1/3] block: add basic backup support to block driver Stefan Hajnoczi
2013-04-23 16:25 ` [Qemu-devel] [PATCH 2/3] block: add block_backup QMP command Stefan Hajnoczi
2013-04-26 22:52 ` Eric Blake
2013-04-26 22:53 ` Eric Blake
2013-04-26 22:58 ` Eric Blake
2013-04-29 7:21 ` Stefan Hajnoczi
2013-04-29 9:27 ` Paolo Bonzini
2013-04-29 15:51 ` Eric Blake
2013-05-01 11:55 ` Stefan Hajnoczi
2013-04-23 16:25 ` [Qemu-devel] [PATCH 3/3] qemu-iotests: add 054 block-backup test case Stefan Hajnoczi
2013-04-23 16:49 ` [Qemu-devel] [PATCH 0/3] block: block-backup live backup command Eric Blake
2013-04-23 16:57 ` Paolo Bonzini
2013-04-24 7:41 ` Stefan Hajnoczi
2013-04-24 12:44 ` Eric Blake
2013-04-27 5:37 ` Wenchao Xia
2013-04-29 7:22 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366734308-11724-1-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=dietmar@proxmox.com \
--cc=famz@redhat.com \
--cc=imain@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).