From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoZjK-00056a-LA for qemu-devel@nongnu.org; Thu, 05 Dec 2013 09:16:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoZjG-0003o9-4t for qemu-devel@nongnu.org; Thu, 05 Dec 2013 09:16:38 -0500 Received: from nodalink.pck.nerim.net ([62.212.105.220]:44700 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoZjF-0003o3-QM for qemu-devel@nongnu.org; Thu, 05 Dec 2013 09:16:34 -0500 Date: Thu, 5 Dec 2013 15:16:26 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20131205141626.GC2892@irqsave.net> References: <1386077165-19577-1-git-send-email-benoit@irqsave.net> <1386077165-19577-8-git-send-email-benoit@irqsave.net> <529FC4AE.6000906@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <529FC4AE.6000906@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC V3 7/7] qmp: Allow to take external snapshots on bs graphs node. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, famz@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, stefanha@redhat.com Le Wednesday 04 Dec 2013 =E0 17:11:26 (-0700), Eric Blake a =E9crit : > On 12/03/2013 06:26 AM, Beno=EEt Canet wrote: > > Signed-off-by: Benoit Canet > > --- > > blockdev.c | 49 +++++++++++++++++++++++++++++++++++++++++-----= --- > > hmp.c | 4 +++- > > qapi-schema.json | 13 ++++++++++--- > > qmp-commands.hx | 11 ++++++++++- > > 4 files changed, 64 insertions(+), 13 deletions(-) > >=20 >=20 > >=20 > > + if (has_node_name && !has_snapshot_node_name) { > > + error_setg(errp, "New snapshot node name missing"); > > + return; > > + } >=20 > Why is it okay to omit the node name when passing a device name (which > creates an anonymous node as the new root of the device tree) but not > when passing a node name? Are you trying to guarantee that all > anonymous nodes can be reached from a device name, and that when taking > a snapshot from a node name the new node is not necessarily tied to a > device and must therefore be named? Yes bs device living just under block backend will ever be accessible via= device whereas other bs really need a node-name to be set to be manipulated. Also it avoid adding a new mandatory field for the device case which is g= ood for compatibility with previous versions. Best regards Beno=EEt >=20 > > -# @device: the name of the device to generate the snapshot from. > > +# Either @device or @node-name must be set but not both. > > +# > > +# @device: #optional the name of the device to generate the snapshot= from. > > +# > > +# @node-name: #optional graph node name to generate the snapshot fro= m (Since 1.8) > > # > > # @snapshot-file: the target of the new image. A new file will be cr= eated. > > # > > +# @snapshot-node-name: the graph node name of the new image (Since 1= .8) >=20 > 2.0, also mark this one #optional >=20 > > +# > > # @format: #optional the format of the snapshot image, default is 'q= cow2'. >=20 > Unrelated to this patch, but @format is another field worth turning int= o > an enum instead of an open-coded string. >=20 > --=20 > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >=20