From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5c9R-0004r3-7z for qemu-devel@nongnu.org; Tue, 21 Jan 2014 09:18:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5c9M-00086f-2T for qemu-devel@nongnu.org; Tue, 21 Jan 2014 09:18:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5c9L-00086Q-PW for qemu-devel@nongnu.org; Tue, 21 Jan 2014 09:17:55 -0500 Date: Tue, 21 Jan 2014 15:17:52 +0100 From: Kevin Wolf Message-ID: <20140121141752.GK3307@dhcp-200-207.str.redhat.com> References: <1386862440-8003-1-git-send-email-benoit@irqsave.net> <1386862440-8003-5-git-send-email-benoit@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1386862440-8003-5-git-send-email-benoit@irqsave.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V5 4/7] qmp: Allow to change password on named block driver states. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Beno=EEt?= Canet Cc: famz@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, stefanha@redhat.com Am 12.12.2013 um 16:33 hat Beno=EEt Canet geschrieben: > There was two candidate ways to implement named node manipulation: >=20 > 1) > { 'command': 'block_passwd', 'data': {'*device': 'str', > '*node-name': 'str', 'password': = 'str'} > } >=20 > 2) >=20 > { 'command': 'block_passwd', 'data': {'device': 'str', > '*device-is-node': 'bool', > 'password': 'str'} } >=20 > Luiz proposed 1 and says 2 was an abuse of the QMP interface and propos= ed to > rewrite the QMP block interface for 2.0. >=20 > Luiz does not like in 1 the fact that 2 fields are optional but one of = them must > be specified leading to an abuse of the QMP semantic. >=20 > Kevin argumented that 2 what a clear abuse of the device field and woul= d not be > practical when reading fast some log file because the user would read "= device" > and think that a device is manipulated when it's in fact a node name. > Documentation of 1 make it pretty clear what to do for the user. >=20 > Kevin argued that all bs are node including devices ones so 2 does not = make > sense. >=20 > Kevin also argued that rewriting the QMP block interface would not make= disapear > the current one. >=20 > Kevin pushed the argument that making the QAPI generator compatible wit= h the > semantic of the operation would need a rewrite that no one has done yet. >=20 > A vote has been done on the list to elect the version to use and 1 won. >=20 > For reference the complete thread is: > "[Qemu-devel] [PATCH V4 4/7] qmp: Allow to change password on names blo= ck driver > states." >=20 > Signed-off-by: Benoit Canet > --- > block.c | 32 ++++++++++++++++++++++++++++++++ > blockdev.c | 13 +++++++++---- > hmp.c | 2 +- > include/block/block.h | 3 +++ > qapi-schema.json | 9 +++++++-- > qmp-commands.hx | 3 ++- > 6 files changed, 54 insertions(+), 8 deletions(-) >=20 > diff --git a/block.c b/block.c > index 78d13e5..22190a4 100644 > --- a/block.c > +++ b/block.c > @@ -3207,6 +3207,38 @@ BlockDeviceInfoList *bdrv_named_nodes_list(void) > return list; > } > =20 > +BlockDriverState *bdrv_lookup_bs(bool has_device, const char *device, > + bool has_node_name, const char *node_= name, > + Error **errp) This is a normal function without generated callers, so can we get rid of has_device/has_node_name and just switch to passing NULL if it's not present? That would make it more convenient to use this function in other places. Kevin