On Thu 24 Mar 2016 04:17:12 AM CET, Wen Congyang wrote: > The monitor command 'query-block' or 'info block' will output the format > specific > information. So we can get each child's child-name after this patch. This > useful > for dynamic reconfiguration. > > Signed-off-by: Wen Congyang <we...@cn.fujitsu.com>
The patch seems correct (but see the comments below), but I'm still wondering why we need to use child_name for this at all. If I rememeber correctly the previous discussion we cannot simply use node-name because a Quorum could have several children with the same name, but I'm still unsure about how that would happen and what's the use case. > + ImageInfoSpecific *spec_info = g_new0(ImageInfoSpecific, 1); > + strList **next; > + > + *spec_info = (ImageInfoSpecific){ > + .type = IMAGE_INFO_SPECIFIC_KIND_QUORUM, > + .u = { > + .quorum.data = g_new0(ImageInfoSpecificQuorum, 1), > + }, > + }; I don't think you need to use g_new0() instead of g_new() if you're immediately doing that assignment afterwards. > ## > +# @ImageInfoSpecificQuorum: > +# > +# @child-name: List of child name > +# > +# Since: 2.7 > +## > +{ 'struct': 'ImageInfoSpecificQuorum', > + 'data': { > + 'child-name': ['str'] > + } } I think it's better in plural: 'children' or 'children-names' Berto