Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 14 ++++++++++++++
src/conf/domain_conf.h | 3 +++
src/libvirt_private.syms | 1 +
3 files changed, 18 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index adf8455579..c1769f743b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31558,6 +31558,20 @@ virDomainDefHasVFIOHostdev(const virDomainDef *def)
}
+bool
+virDomainDefHasMdevHostdev(const virDomainDef *def)
+{
+ size_t i;
+
+ for (i = 0; i < def->nhostdevs; i++) {
+ if (virHostdevIsMdevDevice(def->hostdevs[i]))
+ return true;
+ }
+
+ return false;
+}
+
+
/**
* virDomainGraphicsDefHasOpenGL:
* @def: domain definition
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 53bdee22fb..bf5d1a154b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3669,6 +3669,9 @@ virDomainDefHasManagedPR(const virDomainDef *def);
bool
virDomainDefHasVFIOHostdev(const virDomainDef *def);
+bool
+virDomainDefHasMdevHostdev(const virDomainDef *def);
+
bool
virDomainGraphicsDefHasOpenGL(const virDomainDef *def);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ac37aea626..de124eb37b 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -294,6 +294,7 @@ virDomainDefGetVcpusMax;
virDomainDefGetVcpusTopology;
virDomainDefHasDeviceAddress;
virDomainDefHasManagedPR;
+virDomainDefHasMdevHostdev;
virDomainDefHasMemballoon;
virDomainDefHasMemoryHotplug;
virDomainDefHasUSB;
--
2.21.0