Those are the last two places that uses the getter functions. Use a
direct access instead and remove those getters.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/conf/domain_conf.c | 58 ++----------------------------------------------
src/conf/domain_conf.h | 8 -------
src/libvirt_private.syms | 3 ---
3 files changed, 2 insertions(+), 67 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a5da4b3..befbd4f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -21347,7 +21347,7 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
VIR_DOMAIN_DEF_FORMAT_MIGRATABLE))
continue;
- if ((listenAddr = virDomainGraphicsListenGetAddress(def, i)))
+ if ((listenAddr = def->listens[i].address))
break;
}
@@ -21460,8 +21460,7 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
}
for (i = 0; i < def->nListens; i++) {
- if (virDomainGraphicsListenGetType(def, i)
- == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE)
+ if (def->listens[i].type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE)
continue;
if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE &&
def->listens[i].fromConfig)
@@ -23756,46 +23755,6 @@ virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t
i)
}
-/* Access functions for the fields in a virDomainGraphicsDef's
- * "listens" array.
- *
- * NB: For simple backward compatibility with existing code, any of
- * the "Set" functions will auto-create listens[0] to store the new
- * setting, when necessary. Auto-creation beyond the first item is not
- * supported.
- *
- * Return values: All "Get" functions return the requested item, or
- * 0/NULL. (in the case of returned const char *, the caller should
- * make a copy if they want to keep it around). All "Set" functions
- * return 0 on success, -1 on failure. */
-
-int
-virDomainGraphicsListenGetType(virDomainGraphicsDefPtr def, size_t i)
-{
- virDomainGraphicsListenDefPtr listenInfo
- = virDomainGraphicsGetListen(def, i);
-
- if (!listenInfo)
- return VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE;
- return listenInfo->type;
-}
-
-
-const char *
-virDomainGraphicsListenGetAddress(virDomainGraphicsDefPtr def, size_t i)
-{
- virDomainGraphicsListenDefPtr listenInfo
- = virDomainGraphicsGetListen(def, i);
-
- /* even a network can have a listen address */
- if (!listenInfo ||
- !(listenInfo->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS ||
- listenInfo->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK))
- return NULL;
- return listenInfo->address;
-}
-
-
int
virDomainGraphicsListenAddAddress(virDomainGraphicsDefPtr def,
int pos,
@@ -23820,19 +23779,6 @@ virDomainGraphicsListenAddAddress(virDomainGraphicsDefPtr def,
}
-const char *
-virDomainGraphicsListenGetNetwork(virDomainGraphicsDefPtr def, size_t i)
-{
- virDomainGraphicsListenDefPtr listenInfo
- = virDomainGraphicsGetListen(def, i);
-
- if (!listenInfo ||
- (listenInfo->type != VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK))
- return NULL;
- return listenInfo->network;
-}
-
-
int
virDomainGraphicsListenAddNetwork(virDomainGraphicsDefPtr def,
int pos,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 672d8dc..a96a130 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2813,18 +2813,10 @@ int virDomainHostdevFind(virDomainDefPtr def,
virDomainHostdevDefPtr match,
virDomainGraphicsListenDefPtr
virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t i);
-int virDomainGraphicsListenGetType(virDomainGraphicsDefPtr def, size_t i)
- ATTRIBUTE_NONNULL(1);
-const char *virDomainGraphicsListenGetAddress(virDomainGraphicsDefPtr def,
- size_t i)
- ATTRIBUTE_NONNULL(1);
int virDomainGraphicsListenAddAddress(virDomainGraphicsDefPtr def,
int pos,
const char *address)
ATTRIBUTE_NONNULL(1);
-const char *virDomainGraphicsListenGetNetwork(virDomainGraphicsDefPtr def,
- size_t i)
- ATTRIBUTE_NONNULL(1);
int virDomainGraphicsListenAddNetwork(virDomainGraphicsDefPtr def,
int pos,
const char *network)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b8a8ddc..f864f78 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -303,9 +303,6 @@ virDomainGraphicsDefFree;
virDomainGraphicsGetListen;
virDomainGraphicsListenAddAddress;
virDomainGraphicsListenAddNetwork;
-virDomainGraphicsListenGetAddress;
-virDomainGraphicsListenGetNetwork;
-virDomainGraphicsListenGetType;
virDomainGraphicsSpiceChannelModeTypeFromString;
virDomainGraphicsSpiceChannelModeTypeToString;
virDomainGraphicsSpiceChannelNameTypeFromString;
--
2.7.4