Received: from eggs.gnu.org ([2001:4830:134:3::10]:53540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHtcl-00056V-Ft for qemu-devel@nongnu.org; Fri, 06 Sep 2013 06:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHtcf-0006Jy-39 for qemu-devel@nongnu.org; Fri, 06 Sep 2013 06:50:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15987) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHtce-0006Ji-QL for qemu-devel@nongnu.org; Fri, 06 Sep 2013 06:50:40 -0400 Date: Fri, 6 Sep 2013 18:50:35 +0800 From: Fam Zheng Message-ID: <20130906105035.GC22552@T430s.nay.redhat.com> References: <20130903162449.GF5285@irqsave.net> <20130906075606.GD4814@T430s.nay.redhat.com> <20130906084513.GE2588@dhcp-200-207.str.redhat.com> <20130906091820.GA24154@T430s.nay.redhat.com> <20130906095538.GF2588@dhcp-200-207.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20130906095538.GF2588@dhcp-200-207.str.redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Block Filters Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: =?iso-8859-1?Q?Beno=EEt?= Canet , jcody@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, mreitz@redhat.com On Fri, 09/06 11:55, Kevin Wolf wrote: > Am 06.09.2013 um 11:18 hat Fam Zheng geschrieben: > > On Fri, 09/06 10:45, Kevin Wolf wrote: > > > Am 06.09.2013 um 09:56 hat Fam Zheng geschrieben: > > > > Since BlockDriver.bdrv_snapshot_create() is an optional operation= , blockdev.c > > > > can navigate down the tree from top node, until hitting some laye= r where the op > > > > is implemented (the QCow2 bs), so we get rid of this top_node_bel= ow_filter > > > > pointer. > > >=20 > > > Is it even inherent to a block driver (like a filter), if a snapsho= t is > > > to be taken at its level? Or is it rather a policy decision that sh= ould > > > be made by the user? > > >=20 > > OK, getting the point that user should have full flexibility and fine= operation > > granularity. It also stands against block_backend->top_node_below_fil= ter. Do we > > really have the assumption that all the filters are on top of the tre= e and linear? > > Shouldn't this be possible? > >=20 > > Block Backend > > | > > | > > Quodrum BDS > > / | \ > > iot filter | \ > > / | \ > > qcow2 qcow2 qcow2 > >=20 > > So we throttle only a particular image, not the whole device. But thi= s will > > make a top_node_below_filter pointer impossible. >=20 > I was assuming that Beno=EEt's model works for the special case of > snapshotting in one predefined way, but this is actually a very good > example of why it doesn't. >=20 > The approach relies on snapshotting siblings together, and in this case > the siblings would be iot/qcow2/qcow2, while iot is still a filter. Thi= s > would mean that either iot needs to be top_node_below_filter and > throttling doesn't stay on top, or the left qcow2 is > top_node_below_filter and the other Quorum images aren't snapshotted. >=20 I think that user must look at what is there first, rather than do it bli= ndly on the Block Backend, which is only an entry to the tree behind. Because wheather snapshot is supported, depends on what's in the backend. If the = tree is merely a single raw image, nothing can be done. So, Block Backend does= n't hide things: I think we split it from BDS for putting device related stat= es in a right place. Users still operates on the BDS for data operations (backu= p, snapshot, throttle, etc...), much the same as they currently do. The poin= t of this design here is that we are able to assemble them to get flexible and sophisticated configurations. IMO, snapshotting Quodrum childrens, doesn't sound much different from snapshotting guest's rg0-disk0, rg0-disk1, rg0-disk2, it requires the kno= wledge that they are bound to work together. It's just that the knowledge is fro= m guest raid configuration, or from Quodrum driver. If Quodrum requires all= the children's snapshot be taken at the same time, like a transactional snaps= hot on rg0-disk{0,1,2} must triggered from QMP by user, Quodrum driver must impl= ement its ->bdrv_snapshot_create() and ensure it. > > > In our example, the quorum driver, it's not at all clear to me that= you > > > want to snapshot all children. In order to roll back to a previous > > > state, one snapshot is enough, you don't need multiple copies of th= e > > > same one. Perhaps you want two so that we can still compare them fo= r > > > verification. Or all of them because you can afford the disk space = and > > > want ultimate safety. I don't think qemu can know which one is true. > > >=20 > > Only if quorum ever knows about and operates on snapshots, it should = be > > considered specifically, but no. So we need to achieve this in the ge= neral > > design: allow user to take snapshot, or set throttle limits on partic= ular > > BDSes, as above graph. > >=20 > > > In the same way, in a typical case you may want to keep I/O throttl= ing > > > for the whole drive, including the new snapshot. But what if the > > > throttling was used in order to not overload the network where the = image > > > is stored, and you're now doing a local snapshot, to which you want= to > > > stream the image? The I/O throttling should apply only to the backi= ng > > > file, not the new snapshot. > > >=20 > > Yes, and OTOH, throttling really suits to be a filter only if it can = be a non > > top one, otherwise it's no better than what we have now. >=20 > Well, it would be a cleaner architecture in any case, but having it in > the middle of the stack feels useful indeed, so we should support it. >=20 > > > So perhaps what we really need is a more flexible snapshot/BDS tree > > > manipulation command that describes in detail which structure you w= ant > > > to have in the end. >=20 > Designing the corresponding QMP command is the hard part, I guess. >=20 Another concern is that we may do all this with substantial duplication w= ork of QOM. Fam