mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
domain: Add virDomainDefAssignAddressesCallback
This will be called at the end of virDomainDefPostParse to allow hypervisor drivers to fill in device addresses.
This commit is contained in:
parent
919d0b368e
commit
f891390fa7
@ -4440,6 +4440,13 @@ virDomainDefPostParse(virDomainDefPtr def,
|
||||
if ((ret = virDomainDefPostParseInternal(def, &data)) < 0)
|
||||
return ret;
|
||||
|
||||
if (xmlopt->config.assignAddressesCallback) {
|
||||
ret = xmlopt->config.assignAddressesCallback(def, caps, parseFlags,
|
||||
xmlopt->config.priv);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (virDomainDefPostParseCheckFeatures(def, xmlopt) < 0)
|
||||
return -1;
|
||||
|
||||
|
@ -2475,6 +2475,13 @@ typedef int (*virDomainDeviceDefPostParseCallback)(virDomainDeviceDefPtr dev,
|
||||
virCapsPtr caps,
|
||||
unsigned int parseFlags,
|
||||
void *opaque);
|
||||
/* Drive callback for assigning device addresses, called at the end
|
||||
* of parsing, after all defaults and implicit devices have been added. */
|
||||
typedef int (*virDomainDefAssignAddressesCallback)(virDomainDef *def,
|
||||
virCapsPtr caps,
|
||||
unsigned int parseFlags,
|
||||
void *opaque);
|
||||
|
||||
|
||||
typedef struct _virDomainDefParserConfig virDomainDefParserConfig;
|
||||
typedef virDomainDefParserConfig *virDomainDefParserConfigPtr;
|
||||
@ -2482,6 +2489,7 @@ struct _virDomainDefParserConfig {
|
||||
/* driver domain definition callbacks */
|
||||
virDomainDefPostParseCallback domainPostParseCallback;
|
||||
virDomainDeviceDefPostParseCallback devicesPostParseCallback;
|
||||
virDomainDefAssignAddressesCallback assignAddressesCallback;
|
||||
|
||||
/* private data for the callbacks */
|
||||
void *priv;
|
||||
|
Loading…
Reference in New Issue
Block a user