On 12/06/2013 07:27 AM, Luiz Capitulino wrote: > On Thu, 5 Dec 2013 18:15:00 +0100 > Benoît Canet <ben...@irqsave.net> wrote:
>> -{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} } >> +{ 'command': 'block_passwd', 'data': {'*device': 'str', >> + '*node-name': 'str', 'password': >> 'str'} } > > What about: > > { 'command': 'block_passwd', 'data': {'device': 'str', > '*device-is-node': 'bool', 'password': > 'str'} } That would also work; the naming is a bit more awkward, but then you don't have the issue of mutually-exclusive optional arguments where exactly one of the two arguments is required. I'm leaning slightly towards the approach that Benoît took, if only for the naming aspect (that is, I also thought of the idea of a bool flag, but didn't suggest it because I didn't like the implications on the naming). But I can live with either approach, if anyone else has a strong opinion. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature