From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V07WY-0005TB-Nw for qemu-devel@nongnu.org; Fri, 19 Jul 2013 06:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V07WX-000503-BC for qemu-devel@nongnu.org; Fri, 19 Jul 2013 06:02:54 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:35351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V07WW-0004zs-Pa for qemu-devel@nongnu.org; Fri, 19 Jul 2013 06:02:53 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Jul 2013 19:52:32 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 36CD72CE8051 for ; Fri, 19 Jul 2013 20:02:47 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6JA2ats4587906 for ; Fri, 19 Jul 2013 20:02:37 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6JA2k45014315 for ; Fri, 19 Jul 2013 20:02:46 +1000 Message-ID: <51E90EB5.1030407@linux.vnet.ibm.com> Date: Fri, 19 Jul 2013 18:02:29 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1374069835-14287-1-git-send-email-xiawenc@linux.vnet.ibm.com> <20130718054350.GE26971@stefanha-thinkpad.redhat.com> <51E900D3.30705@linux.vnet.ibm.com> <20130719091941.GE2992@dhcp-200-207.str.redhat.com> In-Reply-To: <20130719091941.GE2992@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, Stefan Hajnoczi , dietmar@proxmox.com 于 2013-7-19 17:19, Kevin Wolf 写道: > Am 19.07.2013 um 11:03 hat Wenchao Xia geschrieben: >> 于 2013-7-18 13:43, Stefan Hajnoczi 写道: >>> On Wed, Jul 17, 2013 at 10:03:51PM +0800, Wenchao Xia wrote: >>>> This series allow user to read internal snapshot's contents without qemu-img >>>> convert. Another purpose is that, when qemu is online and have taken an >>>> internal snapshot, let user invoke qemu-nbd to do any thing on it except write. >>> >>> I agree with Eric and Kevin that we cannot access image files while QEMU >>> has them open. >>> >>> A bit more detail about using the run-time NBD server to do this safely: >>> >>> Internal snapshots are not first-class block layer objects today. They >>> are not BlockDriverStates, instead you must access their data through >>> bdrv_snapshot_goto() or bdrv_snapshot_load_tmp(). >>> >> Also cc to Fam Zheng an Kevin: >> I think BlockDriverStates modification, is based on a more basic >> question: does qcow2's data structure on disk, allow multiple snapshot >> reader, while one active writer, without lock? I think the modification >> showed above, already said "yes" to this question. > > What exactly do you mean by "without lock"? > I mean read of old snapshot and write on qcow2 except snapshot operation, can happen in same time, without a mutex in qemu. > But yes, there's no fundamental problem in the format specification that > would make it impossible to write a driver that accesses multiple > snapshots at the same time from the same qemu process. (Even r/w in > theory, though we're treating snapshots as immutable traditionally.) > What about one writer process and one snapshot reader process? I think it works if manager forbid snapshot operation in writer process. It works with a rule: "only snapshot operation and * operation, would change the data on disk, which is used by reading pre-existing snapshots". I know in principle, one process owning one image, make things clear, but this can leverage internal snapshot as easy to use as external ones. > Kevin > -- Best Regards Wenchao Xia