From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMJI9-0003To-57 for qemu-devel@nongnu.org; Wed, 18 Sep 2013 11:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMJI3-0004Dv-06 for qemu-devel@nongnu.org; Wed, 18 Sep 2013 11:03:45 -0400 Received: from nodalink.pck.nerim.net ([62.212.105.220]:36765 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMJI2-0004D6-H1 for qemu-devel@nongnu.org; Wed, 18 Sep 2013 11:03:38 -0400 Date: Wed, 18 Sep 2013 17:05:27 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20130918150527.GA5025@irqsave.net> References: <20130917124413.GA822@stefanha-thinkpad.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20130917124413.GA822@stefanha-thinkpad.str.redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Merging the quorum block driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org Le Tuesday 17 Sep 2013 =E0 14:44:13 (+0200), Stefan Hajnoczi a =E9crit : > Hi Benoit, > Kevin and I had a chance to chat face-to-face and we discussed what > concrete changes are necessary to merge quorum (without solving all the > other block layers problems at once). >=20 > I think quorum could be merged relatively quickly (and without massive > BlockFilter investments) by changing the following: >=20 > 1. Defining children on the command-line >=20 > Existing "filter" drivers use the protocol filename to embed their > children, for example the blkverify driver. This is a big hack because > we have no proper syntax or escaping for the embedded drive definitions > in the file=3D option. >=20 > This was one of the main arguments against merging quorum. Now that > Kevin has implemented driver-specific open options (see > block/qcow2.c:qcow2_runtime_opts), it is possible for the quorum driver > to open children specific on the command-line: >=20 > -drive if=3Dnone,file.driver=3Dquorum,format=3Draw,\ > file.children0.file=3D/nfs1/test.qcow2,\ > file.children1.file=3D/nfs2/test.qcow2,\ > file.children2.file=3D/nfs3/test.qcow2 Hello Stefan, I started writing the code. How would the quorum treshold be specified with this command line style ? Best regards Beno=EEt >=20 > Here is pseudo-code for quorum_open(). It extracts the children from > the command-line and opens BlockDriverStates for them: >=20 > def quorum_open(qdict): > for key in qdict: > # Parse out child index > match =3D key.match('^children(\d+)\.') > if not match: > continue > idx =3D match.group(0) >=20 > # block.c:extract_subqdict() already lets you extract a new > # qdict with the fields starting with a prefix. You could make > # this function common. > child_dict =3D extract_subqdict(qdict, 'children%d.' % idx) >=20 > # Finally open the child with its specific options > children[idx] =3D bdrv_open(child_dict) >=20 > After doing this we no longer need to embed the children into the file=3D > option as a string and driver-specific options can be used for the > children. >=20 > 2. Prevent external snapshots >=20 > The user may wish to snapshot above or below the quorum BDS. There is > no syntax to express the BDS tree node where snapshotting should happen= . > Implementing this fully is a distraction and requires additional work. >=20 > For quorum it is simplest to add a BDS interface so block drivers can > forbid snapshots. This is called recursively on the whole BDS tree, so > quorum can veto the snapshot operation. An error is returned saying th= e > device does not support snapshots. >=20 > In the future this limitation can be lifted but for the near-term this > is a simple step to make quorum mergable. >=20 > With these changes quorum should be mergable. Implementing full > BlockFilter support is not necessary yet but we can discuss it in > separate thread, if you want. >=20 > Stefan