From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3DGl-00041K-FO for qemu-devel@nongnu.org; Thu, 01 Mar 2012 16:10:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3DGY-00028i-0N for qemu-devel@nongnu.org; Thu, 01 Mar 2012 16:10:35 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:63600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3DGX-00028R-QG for qemu-devel@nongnu.org; Thu, 01 Mar 2012 16:10:21 -0500 Received: by pbcuo5 with SMTP id uo5so225650pbc.4 for ; Thu, 01 Mar 2012 13:10:19 -0800 (PST) Message-ID: <4F4FE5B7.2080306@codemonkey.ws> Date: Thu, 01 Mar 2012 15:10:15 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1330600908-16202-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1330600908-16202-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/6] Mirrored writes using blockdev-transaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com, jcody@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, fsimonce@redhat.com, eblake@redhat.com On 03/01/2012 05:21 AM, Paolo Bonzini wrote: > 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" } We don't have schema introspection today. How would one determine when new transaction types are available? I think we need some sort of introspection method too in order for clients to figure out when the command is extended. Regards, Anthony Liguori > > 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 > > v1->v2: > Removed wrong assertions in patches 3 and 6 > Move new_image_file and other variables inside the while loop (Federico) > Rename new_source_file to new_source (Federico) > Fix image name in error message (Federico) > Fixed documentation in qapi-schema.json (Federico) > Fixed documentation and example in qmp-commands.hx (Eric) > Added back AIO (Stefan), with fixes to cancellation > > > 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 | 239 +++++++++++++++++++++++++++++++++++++++++++++ > blockdev.c | 114 ++++++++++++++-------- > qapi-schema-test.json | 10 ++ > qapi-schema.json | 51 ++++++++-- > qmp-commands.hx | 68 +++++++++---- > scripts/qapi-types.py | 5 + > scripts/qapi-visit.py | 31 ++++++- > test-qmp-input-visitor.c | 18 ++++ > test-qmp-output-visitor.c | 34 +++++++ > 10 files changed, 496 insertions(+), 76 deletions(-) > create mode 100644 block/blkmirror.c >