From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2jj4-0003p5-KZ for qemu-devel@nongnu.org; Wed, 29 Feb 2012 08:38:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2jiy-00009R-8q for qemu-devel@nongnu.org; Wed, 29 Feb 2012 08:37:50 -0500 Received: from mail-pz0-f45.google.com ([209.85.210.45]:46520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2jix-000094-Vp for qemu-devel@nongnu.org; Wed, 29 Feb 2012 08:37:44 -0500 Received: by dadp14 with SMTP id p14so9255511dad.4 for ; Wed, 29 Feb 2012 05:37:41 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 29 Feb 2012 14:37:24 +0100 Message-Id: <1330522650-15357-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 0/6] Mirrored writes using blockdev-transaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, fsimonce@redhat.com, eblake@redhat.com, stefanha@linux.vnet.ibm.com, jcody@redhat.com This implements all ingredients to establish mirrored writes. The drive-reopen command that is used to terminate mirrored writes is not included in this series. Tested with the following scenarios: a) mirror only 1) create base.qcow2 and start QEMU with it 2) Execute the following QMP command { "execute": "qmp_capabilities" } { "execute": "blockdev-transaction", "arguments": {'actions': [ { 'type': '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) atomic snapshot+mirror 1) start QEMU with an existing image test.img 2) Execute the following QMP command { "execute": "qmp_capabilities" } { "execute": "blockdev-transaction", "arguments": {'actions': [ { 'type': 'snapshot', 'data' : { 'device': 'ide0-hd0', 'snapshot-file': '/home/pbonzini/base.qcow2' } }, { 'type': '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 Marcelo Tosatti (1): Add blkmirror block driver Paolo Bonzini (5): fix format name for backing file qapi: complete implementation of unions rename blockdev-group-snapshot-sync add reuse field add mirroring to blockdev-transaction Makefile.objs | 2 +- block/blkmirror.c | 153 +++++++++++++++++++++++++++++++++++++++++++++ blockdev.c | 111 +++++++++++++++++++++----------- docs/blkmirror.txt | 16 +++++ qapi-schema-test.json | 10 +++ qapi-schema.json | 51 ++++++++++++--- qmp-commands.hx | 66 +++++++++++++------- scripts/qapi-types.py | 5 ++ scripts/qapi-visit.py | 31 +++++++++- test-qmp-input-visitor.c | 19 ++++++ test-qmp-output-visitor.c | 35 ++++++++++ 11 files changed, 426 insertions(+), 73 deletions(-) create mode 100644 block/blkmirror.c create mode 100644 docs/blkmirror.txt -- 1.7.7.6