[libvirt] [PATCHv4 1/9] conf: Add post XML parse callbacks and prepare for cleaning of virCaps

Eric Blake eblake at redhat.com
Fri Mar 29 17:08:53 UTC 2013


On 03/25/2013 02:25 PM, Laine Stump wrote:

>> +    if (xmlconf && xmlconf->config.devicesConfigCallback) {
>> +        ret = xmlconf->config.devicesConfigCallback(dev, def, caps,
>> +                                                    xmlconf->config.priv);
> 
> The implementation of these functions in the hypervisor drivers has been
> changed to xxxPostParsexxx, but you're still calling it
> devicesConfigCallback in the struct that's setup. I think this struct
> should have the members called xxxPostParsexxx as well. This is
> especially confusing because the parser is parsing a domain config (so
> we have the "config for the parser of the config" - it makes it a bit
> difficult to follow whether we're talking about the domain config or
> parser config sometimes.).
> 

>> +
>> +typedef struct _virDomainDefParserConfig virDomainDefParserConfig;
>> +typedef virDomainDefParserConfig *virDomainDefParserConfigPtr;
>> +struct _virDomainDefParserConfig {
>> +    virDomainDefPostParseCallback domainConfigCallback;
>> +    virDomainDeviceDefPostParseCallback devicesConfigCallback;
> 
> Yeah, here's the definition. I think domainConfigCallback should be
> called domainPostParseCallback and devicesConfigCallback should be
> called devicesPostParseCallback. That would help quite a lot to
> un-confuse me.
> 

> (an aside - I'm still trying to think of something that's less confusing
> than "conf" for xmlconf and virDomainXMLConfPtr - this dual usage (for
> both domain config that we're parsing, and the parser config) requires
> too much concentration from my brain :-). I haven't come up with a
> better idea yet, though...)

Maybe virDomainXMLOptionPtr.  Leave 'conf' for items related to parsing
a user's libvirtd.conf and qemu.conf files, and 'xmlopt' instead of
'xmlconf' for items related to options that the driver passed in for
impacting xml parsing/validation.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130329/1b8d7747/attachment-0001.sig>


More information about the libvir-list mailing list