Add parseOpaque parameter to virDomainDeviceDefValidate(Callback). But
don't use it for now.
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
src/conf/domain_conf.c | 10 ++++++----
src/conf/domain_conf.h | 3 ++-
src/qemu/qemu_domain.c | 3 ++-
src/vz/vz_driver.c | 3 ++-
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4f1c569b5733..5b2277defbdf 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5961,18 +5961,20 @@ virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm,
}
+/* parseOpaque: must not be NULL */
static int
virDomainDeviceDefValidate(const virDomainDeviceDef *dev,
const virDomainDef *def,
unsigned int parseFlags,
- virDomainXMLOptionPtr xmlopt)
+ virDomainXMLOptionPtr xmlopt,
+ void *parseOpaque)
{
/* validate configuration only in certain places */
if (parseFlags & VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)
return 0;
if (xmlopt->config.deviceValidateCallback &&
- xmlopt->config.deviceValidateCallback(dev, def, xmlopt->config.priv))
+ xmlopt->config.deviceValidateCallback(dev, def, xmlopt->config.priv,
parseOpaque))
return -1;
if (virDomainDeviceDefValidateInternal(dev, def) < 0)
@@ -5990,7 +5992,7 @@ virDomainDefValidateDeviceIterator(virDomainDefPtr def,
{
struct virDomainDefPostParseDeviceIteratorData *data = opaque;
return virDomainDeviceDefValidate(dev, def,
- data->parseFlags, data->xmlopt);
+ data->parseFlags, data->xmlopt,
data->parseOpaque);
}
@@ -16234,7 +16236,7 @@ virDomainDeviceDefParse(const char *xmlStr,
goto error;
/* validate the configuration */
- if (virDomainDeviceDefValidate(dev, def, flags, xmlopt) < 0)
+ if (virDomainDeviceDefValidate(dev, def, flags, xmlopt, parseOpaque) < 0)
goto error;
cleanup:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3642d5eb6cba..1dcfabf97e53 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2703,7 +2703,8 @@ typedef int (*virDomainDefValidateCallback)(const virDomainDef
*def,
* leaving the overall domain otherwise unchanged. */
typedef int (*virDomainDeviceDefValidateCallback)(const virDomainDeviceDef *dev,
const virDomainDef *def,
- void *opaque);
+ void *opaque,
+ void *parseOpaque);
typedef struct _virDomainDefParserConfig virDomainDefParserConfig;
typedef virDomainDefParserConfig *virDomainDefParserConfigPtr;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index aacb54a72f72..2096a2a39ac5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5790,7 +5790,8 @@ qemuDomainDeviceDefValidateInput(const virDomainInputDef *input,
static int
qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
const virDomainDef *def,
- void *opaque)
+ void *opaque,
+ void *parseOpaque ATTRIBUTE_UNUSED)
{
int ret = 0;
virQEMUDriverPtr driver = opaque;
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 16c44c2f2215..502e34aba43c 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -281,7 +281,8 @@ vzDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
static int
vzDomainDeviceDefValidate(const virDomainDeviceDef *dev,
const virDomainDef *def,
- void *opaque ATTRIBUTE_UNUSED)
+ void *opaque ATTRIBUTE_UNUSED,
+ void *parseOpaque ATTRIBUTE_UNUSED)
{
if (dev->type == VIR_DOMAIN_DEVICE_DISK)
return vzCheckUnsupportedDisk(def, dev->data.disk, opaque);
--
2.17.0