virDomainGraphicsListenAppendAddress() return value
is invariant, so change it type and remove all dependent
checks.
Fixes: 592517636f ("util: alloc: Reimplement VIR_APPEND_ELEMENT_COPY using
virAppendElement")
Signed-off-by: Artem Chernyshev <artem.chernyshev(a)red-soft.ru>
---
src/conf/domain_conf.c | 4 +---
src/conf/domain_conf.h | 2 +-
src/libxl/xen_common.c | 7 ++-----
src/libxl/xen_xl.c | 3 +--
src/vbox/vbox_common.c | 4 +---
src/vmx/vmx.c | 3 +--
6 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3ea70fc051..1ab1caba58 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -29092,7 +29092,7 @@ virDomainGraphicsGetListen(virDomainGraphicsDef *def, size_t i)
}
-int
+void
virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def,
const char *address)
{
@@ -29103,8 +29103,6 @@ virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def,
glisten.address = g_strdup(address);
VIR_APPEND_ELEMENT_COPY(def->listens, def->nListens, glisten);
-
- return 0;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 6152d464f3..ffa9f74a72 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3910,7 +3910,7 @@ int virDomainHostdevMatch(virDomainHostdevDef *a,
virDomainGraphicsListenDef *
virDomainGraphicsGetListen(virDomainGraphicsDef *def, size_t i);
-int virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def,
+void virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def,
const char *address)
ATTRIBUTE_NONNULL(1);
int virDomainGraphicsListenAppendSocket(virDomainGraphicsDef *def,
diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c
index d5a0399613..c7bc51b926 100644
--- a/src/libxl/xen_common.c
+++ b/src/libxl/xen_common.c
@@ -673,8 +673,7 @@ xenParseVfb(virConf *conf, virDomainDef *def)
if (xenConfigCopyStringOpt(conf, "vnclisten", &listenAddr) <
0)
goto cleanup;
- if (virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0)
- goto cleanup;
+ virDomainGraphicsListenAppendAddress(graphics, listenAddr);
VIR_FREE(listenAddr);
if (xenConfigCopyStringOpt(conf, "vncpasswd",
&graphics->data.vnc.auth.passwd) < 0)
@@ -766,9 +765,7 @@ xenParseVfb(virConf *conf, virDomainDef *def)
key = nextkey;
}
if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
- if (virDomainGraphicsListenAppendAddress(graphics,
- listenAddr) < 0)
- goto cleanup;
+ virDomainGraphicsListenAppendAddress(graphics, listenAddr);
VIR_FREE(listenAddr);
}
def->graphics = g_new0(virDomainGraphicsDef *, 1);
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
index f175359307..553aa77896 100644
--- a/src/libxl/xen_xl.c
+++ b/src/libxl/xen_xl.c
@@ -341,8 +341,7 @@ xenParseXLSpice(virConf *conf, virDomainDef *def)
graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_SPICE;
if (xenConfigCopyStringOpt(conf, "spicehost", &listenAddr) <
0)
goto cleanup;
- if (virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0)
- goto cleanup;
+ virDomainGraphicsListenAppendAddress(graphics, listenAddr);
if (xenConfigGetULong(conf, "spicetls_port", &port, 0) < 0)
goto cleanup;
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index de3c9989a5..9f6612ad61 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3625,8 +3625,7 @@ vboxDumpDisplay(virDomainDef *def, struct _vboxDriver *data,
IMachine *machine)
if (netAddressUtf8 && STREQ(netAddressUtf8, ""))
VBOX_UTF8_FREE(netAddressUtf8);
- if (virDomainGraphicsListenAppendAddress(graphics, netAddressUtf8) < 0)
- goto cleanup;
+ virDomainGraphicsListenAppendAddress(graphics, netAddressUtf8);
gVBoxAPI.UIVRDEServer.GetAllowMultiConnection(VRDEServer,
&allowMultiConnection);
if (allowMultiConnection)
@@ -3641,7 +3640,6 @@ vboxDumpDisplay(virDomainDef *def, struct _vboxDriver *data,
IMachine *machine)
ret = 0;
- cleanup:
VBOX_RELEASE(VRDEServer);
VBOX_UTF8_FREE(valueTypeUtf8);
VBOX_UTF8_FREE(netAddressUtf8);
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 26b89776e1..e746ff213b 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2017,8 +2017,7 @@ virVMXParseVNC(virConf *conf, virDomainGraphicsDef **def)
goto failure;
}
- if (virDomainGraphicsListenAppendAddress(*def, listenAddr) < 0)
- goto failure;
+ virDomainGraphicsListenAppendAddress(*def, listenAddr);
VIR_FREE(listenAddr);
if (port < 0) {
--
2.43.0