mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
conf: Add 'basic' post parse callback
Add yet another post parse callback, which is executed prior the real one without @parseOpaque. This is meant to set basics before @parseOpaque (in case of the qemu driver qemuCaps) can be allocated. This callback will allow to optimize passing of custom parseOpaque through the callbacks.
This commit is contained in:
parent
7a5f68a1f2
commit
2f19c9325e
@ -4828,6 +4828,15 @@ virDomainDefPostParse(virDomainDefPtr def,
|
|||||||
.parseOpaque = parseOpaque,
|
.parseOpaque = parseOpaque,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* call the basic post parse callback */
|
||||||
|
if (xmlopt->config.domainPostParseBasicCallback) {
|
||||||
|
ret = xmlopt->config.domainPostParseBasicCallback(def, caps,
|
||||||
|
xmlopt->config.priv);
|
||||||
|
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* this must be done before the hypervisor-specific callback,
|
/* this must be done before the hypervisor-specific callback,
|
||||||
* in case presence of a controller at a specific index is checked
|
* in case presence of a controller at a specific index is checked
|
||||||
*/
|
*/
|
||||||
|
@ -2497,6 +2497,15 @@ typedef enum {
|
|||||||
typedef struct _virDomainXMLOption virDomainXMLOption;
|
typedef struct _virDomainXMLOption virDomainXMLOption;
|
||||||
typedef virDomainXMLOption *virDomainXMLOptionPtr;
|
typedef virDomainXMLOption *virDomainXMLOptionPtr;
|
||||||
|
|
||||||
|
|
||||||
|
/* Called after everything else has been parsed, for adjusting basics.
|
||||||
|
* This has similar semantics to virDomainDefPostParseCallback, but no
|
||||||
|
* parseOpaque is used. This callback is run prior to
|
||||||
|
* virDomainDefPostParseCallback. */
|
||||||
|
typedef int (*virDomainDefPostParseBasicCallback)(virDomainDefPtr def,
|
||||||
|
virCapsPtr caps,
|
||||||
|
void *opaque);
|
||||||
|
|
||||||
/* Called once after everything else has been parsed, for adjusting
|
/* Called once after everything else has been parsed, for adjusting
|
||||||
* overall domain defaults.
|
* overall domain defaults.
|
||||||
* @parseOpaque is opaque data passed by virDomainDefParse* caller,
|
* @parseOpaque is opaque data passed by virDomainDefParse* caller,
|
||||||
@ -2546,6 +2555,7 @@ typedef struct _virDomainDefParserConfig virDomainDefParserConfig;
|
|||||||
typedef virDomainDefParserConfig *virDomainDefParserConfigPtr;
|
typedef virDomainDefParserConfig *virDomainDefParserConfigPtr;
|
||||||
struct _virDomainDefParserConfig {
|
struct _virDomainDefParserConfig {
|
||||||
/* driver domain definition callbacks */
|
/* driver domain definition callbacks */
|
||||||
|
virDomainDefPostParseBasicCallback domainPostParseBasicCallback;
|
||||||
virDomainDefPostParseCallback domainPostParseCallback;
|
virDomainDefPostParseCallback domainPostParseCallback;
|
||||||
virDomainDeviceDefPostParseCallback devicesPostParseCallback;
|
virDomainDeviceDefPostParseCallback devicesPostParseCallback;
|
||||||
virDomainDefAssignAddressesCallback assignAddressesCallback;
|
virDomainDefAssignAddressesCallback assignAddressesCallback;
|
||||||
|
Loading…
Reference in New Issue
Block a user