To allow easy implementation of a callback check this patch adds empty post parse callbacks to drivers that were missing them. --- src/bhyve/bhyve_domain.c | 10 ++++++++++ src/parallels/parallels_driver.c | 21 +++++++++++++++++++++ src/phyp/phyp_driver.c | 29 ++++++++++++++++++++++++++++- src/uml/uml_driver.c | 10 ++++++++++ src/vbox/vbox_common.c | 19 +++++++++++++++++++ src/vmware/vmware_driver.c | 24 +++++++++++++++++++++++- src/vmx/vmx.c | 18 ++++++++++++++++++ src/xenapi/xenapi_driver.c | 10 ++++++++++ 8 files changed, 139 insertions(+), 2 deletions(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 7c7bec3..ecb1758 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -70,6 +70,16 @@ bhyveDomainDefPostParse(virDomainDefPtr def, return 0; } +static int +bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, + const virDomainDef *def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = { + .devicesPostParseCallback = bhyveDomainDeviceDefPostParse, .domainPostParseCallback = bhyveDomainDefPostParse, }; diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index 516a296..04c4bb3 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -915,8 +915,29 @@ parallelsLoadDomains(parallelsConnPtr privconn, const char *domain_name) } +static int +parallelsDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + + +static int +parallelsDomainDeviceDefPostParse(virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, + const virDomainDef *def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + + virDomainDefParserConfig parallelsDomainDefParserConfig = { .macPrefix = {0x42, 0x1C, 0x00}, + .devicesPostParseCallback = parallelsDomainDeviceDefPostParse, + .domainPostParseCallback = parallelsDomainDefPostParse, }; diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 25f7f2d..6a5a560 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1054,6 +1054,32 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth, return session; } + +static int +phypDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + + +static int +phypDomainDeviceDefPostParse(virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, + const virDomainDef *def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + + +virDomainDefParserConfig virPhypDriverDomainDefParserConfig = { + .devicesPostParseCallback = phypDomainDeviceDefPostParse, + .domainPostParseCallback = phypDomainDefPostParse, +}; + + static virDrvOpenStatus phypConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) @@ -1131,7 +1157,8 @@ phypConnectOpen(virConnectPtr conn, if ((phyp_driver->caps = phypCapsInit()) == NULL) goto failure; - if (!(phyp_driver->xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL))) + if (!(phyp_driver->xmlopt = virDomainXMLOptionNew(&virPhypDriverDomainDefParserConfig, + NULL, NULL))) goto failure; conn->privateData = phyp_driver; diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 2a40149..7e25861 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -444,8 +444,18 @@ umlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, } +static int +umlDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + + virDomainDefParserConfig umlDriverDomainDefParserConfig = { .devicesPostParseCallback = umlDomainDeviceDefPostParse, + .domainPostParseCallback = umlDomainDefPostParse, }; diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 44270ff..2170dc1 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -314,8 +314,27 @@ static char *vboxGenerateMediumName(PRUint32 storageBus, return name; } +static int +vboxDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + +static int +vboxDomainDeviceDefPostParse(virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, + const virDomainDef *def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + static virDomainDefParserConfig vboxDomainDefParserConfig = { .macPrefix = { 0x08, 0x00, 0x27 }, + .devicesPostParseCallback = vboxDomainDeviceDefPostParse, + .domainPostParseCallback = vboxDomainDefPostParse, }; static virDomainXMLOptionPtr diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 6edc0bc..22ce3a3 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -82,13 +82,35 @@ vmwareDataFreeFunc(void *data) VIR_FREE(dom); } +static int +vmwareDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + +static int +vmwareDomainDeviceDefPostParse(virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, + const virDomainDef *def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + +virDomainDefParserConfig vmwareDomainDefParserConfig = { + .devicesPostParseCallback = vmwareDomainDeviceDefPostParse, + .domainPostParseCallback = vmwareDomainDefPostParse, +}; + static virDomainXMLOptionPtr vmwareDomainXMLConfigInit(void) { virDomainXMLPrivateDataCallbacks priv = { .alloc = vmwareDataAllocFunc, .free = vmwareDataFreeFunc }; - return virDomainXMLOptionNew(NULL, &priv, NULL); + return virDomainXMLOptionNew(&vmwareDomainDefParserConfig, &priv, NULL); } static virDrvOpenStatus diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index cd6c51e..389a012 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -523,10 +523,28 @@ VIR_ENUM_IMPL(virVMXControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST, /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Helpers */ +static int +vmxDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + +static int +vmxDomainDeviceDefPostParse(virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, + const virDomainDef *def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} virDomainDefParserConfig virVMXDomainDefParserConfig = { .hasWideSCSIBus = true, .macPrefix = {0x00, 0x0c, 0x29}, + .devicesPostParseCallback = vmxDomainDeviceDefPostParse, + .domainPostParseCallback = vmxDomainDefPostParse, }; diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index e4fa7cd..a448347 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -69,8 +69,18 @@ xenapiDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, } +static int +xenapiDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED, + virCapsPtr caps ATTRIBUTE_UNUSED, + void *opaque ATTRIBUTE_UNUSED) +{ + return 0; +} + + virDomainDefParserConfig xenapiDomainDefParserConfig = { .devicesPostParseCallback = xenapiDomainDeviceDefPostParse, + .domainPostParseCallback = xenapiDomainDefPostParse, }; -- 2.1.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list