qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 RFC] block/vxhs: Initial commit to add Verita


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 RFC] block/vxhs: Initial commit to add Veritas HyperScale VxHS block device support
Date: Wed, 17 Aug 2016 13:22:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


On 15/08/2016 18:29, ashish mittal wrote:
>>> +/*
>>> + * Convert the json formatted command line into qapi.
>>> +*/
>>> +
>>> +static int vxhs_parse_json(BlockdevOptionsVxHS *conf,
>>> +                                  QDict *options, Error **errp)
>>> +{
> ...
>>> +    errno = EINVAL;
>>> +    return -errno;
>>> +}
>>
>> Ewww this is really horrible code. It is open-coding a special purpose
>> conversion of QemuOpts -> QDict -> QAPI scheme. We should really put
>> my qdict_crumple() API impl as a pre-requisite of this, so you can then
>> use qdict_crumple + qmp_input_visitor to do this conversion in a generic
>> manner removing all this code.
>>
>>   https://lists.gnu.org/archive/html/qemu-devel/2016-07/msg03118.html
>>
> 
> Thanks for the suggestions. I will try to incorporate them in the next
> version. Actually, I used block/gluster.c for reference (as advised).
> This is exactly how it parses json CLI options. It also implements the
> *parse_uri() in a similar way.

I think I pointed you to block/nbd.c instead, which works as Kevin
suggested.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]