On Thu, Aug 28, 2014 at 03:18:48PM +0900, Hitoshi Mitake wrote: > At Wed, 27 Aug 2014 06:43:49 -0600, > Eric Blake wrote: > > > > [1 <text/plain; UTF-8 (quoted-printable)>] > > On 08/26/2014 11:34 PM, Hitoshi Mitake wrote: > > Actually, if you use a type-safe qapi definition, you may not even need > > to do raw qdict operations, but can just directly use the C struct that > > gets generated as a result of the qapi. > > > > > > > > > > I also like the detailed specification. But, there are bunch of event > > > names (the event_names array of block/blkdebug.c). In addition, the > > > rule of blkdebug can be extended. So I think defining it in two palces > > > (qapi-schema.json and block/blkdebug.c) is hard to maintain. Parsing > > > qdict in blkdebug.c would be simpler. How do you think? > > > > No, don't do duplication. Instead, fix blkdebug.c to USE the enum > > generated by the .json, and you only have to maintain the list in one > > place - the .json file. > > > > OK, I understand your opinion. But it requires amount of change in > existing blkdebug implementation. So I want to hear opinions from the > maintainers. How do you think about this idea (maintaining blkdebug > events in .json format for avoiding duplication), Stefan and Kevin?
It would be nice to specify the rule syntax using qapi JSON. I'm not sure if we can eliminate the QemuOptsList but it's probably possible to avoid qdict or ini file parsing and instead use qapi visitors to convert input to C structs. It's worth a try. Stefan
pgpDjNcKI2HmP.pgp
Description: PGP signature