Make virDomainControllerFindUnusedIndex() a global function so that it
can be used outside domain_conf.c (as well as higher up in
domain_conf.c itself)/ Also make its DomainDef arg a const* so that
functions which only have a const* to the domain can use it.
---
Change from V1: made the function global so it can be called from
qemuDomainAttachControllerDevice()
src/conf/domain_conf.c | 4 ++--
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index fb05bf7..408b59f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13716,8 +13716,8 @@ virDomainControllerFind(const virDomainDef *def,
}
-static int
-virDomainControllerFindUnusedIndex(virDomainDefPtr def, int type)
+int
+virDomainControllerFindUnusedIndex(virDomainDef const *def, int type)
{
int idx = 0;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5809d8d..5e4dc3f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2754,6 +2754,7 @@ int virDomainControllerFind(const virDomainDef *def, int type, int
idx);
int virDomainControllerFindByType(virDomainDefPtr def, int type);
int virDomainControllerFindByPCIAddress(virDomainDefPtr def,
virPCIDeviceAddressPtr addr);
+int virDomainControllerFindUnusedIndex(virDomainDef const *def, int type);
virDomainControllerDefPtr virDomainControllerRemove(virDomainDefPtr def, size_t i);
const char *virDomainControllerAliasFind(const virDomainDef *def,
int type, int idx)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index fb5b419..e325168 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -189,6 +189,7 @@ virDomainControllerDefFree;
virDomainControllerDefNew;
virDomainControllerFind;
virDomainControllerFindByType;
+virDomainControllerFindUnusedIndex;
virDomainControllerInsert;
virDomainControllerInsertPreAlloced;
virDomainControllerModelPCITypeToString;
--
2.5.5