qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 0/8] Mirrored block writes
@ 2012-03-05 17:33 Paolo Bonzini
  2012-03-05 17:33 ` [Qemu-devel] [PATCH v3 1/8] fix format name for backing file Paolo Bonzini
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Paolo Bonzini @ 2012-03-05 17:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, fsimonce, eblake, stefanha, lcapitulino

v3 comes with a new QMP command drive-mirror, an improved
blockdev-snapshot-sync that just reuses transaction functionality, and
a new image creation mode enum.  I also tested that the command can be
used to migrate without shared storage.

Tested with the following scenarios:

a) mirror only

1) create base.qcow2 and starat QEMU with it

2) Execute the following QMP command

{ "execute": "qmp_capabilities" }
{ "execute": "transaction", "arguments":
  {'actions': [
    { 'type': 'drive-mirror', 'data' :
      { 'device': 'ide0-hd0', 'target': '/home/pbonzini/mirror.qcow2' } } ] } }
{ "execute": "cont" }

3) hibernate the guest (this requires an IDE disk and -cpu kvm64,-kvmclock)

4) restart the guest with mirror.qcow2


b) Same as (a) with drive-mirror command.


c) streaming to new image

1) start QEMU with an existing image test.img

2) execute the following HMP commands

drive_mirror -s ide0-hd0 /home/pbonzini/mirror.qed qed
block_stream ide0-hd0

3) shut down the guest (sorry, this took a looong time and I forgot to
hibernate here)

4) move away the base image

5) restart the guest with mirror.qed


d) atomic snapshot+mirror (QMP only):

1) start QEMU with an existing image test.img

2) Execute the following QMP command

{ "execute": "qmp_capabilities" }
{ "execute": "transaction", "arguments":
  {'actions': [
    { 'type': 'blockdev-snapshot-sync', 'data' :
      { 'device': 'ide0-hd0', 'snapshot-file': '/home/pbonzini/base.qcow2' } },
    { 'type': 'drive-mirror', 'data' :
      { 'device': 'ide0-hd0', 'target': '/home/pbonzini/mirror.qcow2' } } ] } }
{ "execute": "cont" }

3) hibernate the guest (this requires an IDE disk and -cpu kvm64,-kvmclock)

4) check that mirror.qcow2 has test.img as the base

5) restart the guest with base.qcow2

6) restart the guest with mirror.qcow2


v2->v3:
        replace reuse argument with NewImageMode enum and mode argument;
        renamed all commands and actions; implemented blockdev-snapshot-sync
        in terms of group snasphots; added new drive-mirror command and
        HMP equivalent.

Marcelo Tosatti (1):
  Add blkmirror block driver

Paolo Bonzini (7):
  fix format name for backing file
  qapi: complete implementation of unions
  rename blockdev-group-snapshot-sync
  add mode field to blockdev-snapshot-sync transaction item
  qmp: convert blockdev-snapshot-sync to a wrapper around transactions
  add mirroring to transaction
  add drive-mirror command and HMP equivalent

 Makefile.objs             |    2 +-
 block/blkmirror.c         |  239 +++++++++++++++++++++++++++++++++++++++++++++
 blockdev.c                |  232 ++++++++++++++++++++++++-------------------
 hmp-commands.hx           |   31 +++++-
 hmp.c                     |   34 ++++++-
 hmp.h                     |    1 +
 qapi-schema-test.json     |   10 ++
 qapi-schema.json          |  119 ++++++++++++++++++----
 qmp-commands.hx           |  105 +++++++++++++++-----
 scripts/qapi-types.py     |    5 +
 scripts/qapi-visit.py     |   31 ++++++-
 test-qmp-input-visitor.c  |   18 ++++
 test-qmp-output-visitor.c |   34 +++++++
 13 files changed, 707 insertions(+), 154 deletions(-)
 create mode 100644 block/blkmirror.c

-- 
1.7.7.6

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

end of thread, other threads:[~2012-03-06 11:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 17:33 [Qemu-devel] [PATCH v3 0/8] Mirrored block writes Paolo Bonzini
2012-03-05 17:33 ` [Qemu-devel] [PATCH v3 1/8] fix format name for backing file Paolo Bonzini
2012-03-05 17:33 ` [Qemu-devel] [PATCH v3 2/8] qapi: complete implementation of unions Paolo Bonzini
2012-03-06  7:16   ` Mark Wu
2012-03-06  8:14     ` Paolo Bonzini
2012-03-06  8:19       ` Mark Wu
2012-03-06  8:31         ` Paolo Bonzini
2012-03-06  9:41           ` Mark Wu
2012-03-06 10:00     ` Paolo Bonzini
2012-03-05 17:33 ` [Qemu-devel] [PATCH v3 3/8] rename blockdev-group-snapshot-sync Paolo Bonzini
2012-03-05 17:33 ` [Qemu-devel] [PATCH v3 4/8] add mode field to blockdev-snapshot-sync transaction item Paolo Bonzini
2012-03-05 18:45   ` Eric Blake
2012-03-05 17:33 ` [Qemu-devel] [PATCH v3 5/8] qmp: convert blockdev-snapshot-sync to a wrapper around transactions Paolo Bonzini
2012-03-05 18:55   ` Eric Blake
2012-03-05 19:44     ` Paolo Bonzini
2012-03-05 21:16       ` Paolo Bonzini
2012-03-06 11:30       ` Luiz Capitulino
2012-03-05 17:34 ` [Qemu-devel] [PATCH v3 6/8] Add blkmirror block driver Paolo Bonzini
2012-03-05 17:34 ` [Qemu-devel] [PATCH v3 7/8] add mirroring to transaction Paolo Bonzini
2012-03-05 19:04   ` Eric Blake
2012-03-05 17:34 ` [Qemu-devel] [PATCH v3 8/8] add drive-mirror command and HMP equivalent Paolo Bonzini
2012-03-06  8:02 ` [Qemu-devel] [PATCH v3 9/8] Add the drive-reopen command Paolo Bonzini
2012-03-06  8:52 ` [Qemu-devel] [PATCH v3 10/8] use QSIMPLEQ_FOREACH_SAFE when freeing list elements 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).