We will use this in upcoming patches --- src/conf/domain_conf.c | 31 +++++++++++++++++++++---------- src/conf/domain_conf.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 61dc650..52dd293 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4187,12 +4187,10 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED, return virDomainDeviceDefPostParse(dev, data->def, data->caps, data->xmlopt); } - int -virDomainDefPostParse(virDomainDefPtr def, - virCapsPtr caps, - unsigned int parseFlags, - virDomainXMLOptionPtr xmlopt) +virDomainDefPostParseDevices(virDomainDefPtr def, + virCapsPtr caps, + virDomainXMLOptionPtr xmlopt) { int ret; struct virDomainDefPostParseDeviceIteratorData data = { @@ -4201,6 +4199,23 @@ virDomainDefPostParse(virDomainDefPtr def, .xmlopt = xmlopt, }; + if ((ret = virDomainDeviceInfoIterateInternal(def, + virDomainDefPostParseDeviceIterator, + true, + &data)) < 0) + return ret; + + return 0; +} + +int +virDomainDefPostParse(virDomainDefPtr def, + virCapsPtr caps, + unsigned int parseFlags, + virDomainXMLOptionPtr xmlopt) +{ + int ret; + /* call the domain config callback */ if (xmlopt->config.domainPostParseCallback) { ret = xmlopt->config.domainPostParseCallback(def, caps, @@ -4210,13 +4225,9 @@ virDomainDefPostParse(virDomainDefPtr def, } /* iterate the devices */ - if ((ret = virDomainDeviceInfoIterateInternal(def, - virDomainDefPostParseDeviceIterator, - true, - &data)) < 0) + if ((ret = virDomainDefPostParseDevices(def, caps, xmlopt)) < 0) return ret; - if ((ret = virDomainDefPostParseInternal(def, caps, parseFlags)) < 0) return ret; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4a91f24..2bba554 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2497,6 +2497,10 @@ virDomainDefPostParse(virDomainDefPtr def, virCapsPtr caps, unsigned int parseFlags, virDomainXMLOptionPtr xmlopt); +int +virDomainDefPostParseDevices(virDomainDefPtr def, + virCapsPtr caps, + virDomainXMLOptionPtr xmlopt); static inline bool virDomainObjIsActive(virDomainObjPtr dom) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 0f2f66c..58f2d22 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -230,6 +230,7 @@ virDomainDefParseFile; virDomainDefParseNode; virDomainDefParseString; virDomainDefPostParse; +virDomainDefPostParseDevices; virDomainDefSetMemoryInitial; virDomainDefSetMemoryTotal; virDomainDefSetVcpus; -- 2.5.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list