virDomainGraphicsListenAppendAddress() returns nothing except 0. Changing
return type to void.
Found by Linux Verification Center (
linuxtesting.org) with SVACE.
Signed-off-by: Dmitry Frolov <frolov(a)swemel.ru>
---
src/conf/domain_conf.c | 4 +---
src/conf/domain_conf.h | 2 +-
src/libxl/xen_common.c | 8 +++-----
src/libxl/xen_xl.c | 3 +--
src/vbox/vbox_common.c | 9 ++-------
src/vmx/vmx.c | 3 +--
6 files changed, 9 insertions(+), 20 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e232d635bb..bd8d941f34 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -29153,7 +29153,7 @@ virDomainGraphicsGetListen(virDomainGraphicsDef *def, size_t i)
}
-int
+void
virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def,
const char *address)
{
@@ -29164,8 +29164,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 89257d33fc..6b70a599f1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3912,7 +3912,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 ba2a322016..8f4add7f30 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,8 @@ 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..59e7a91081 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3549,7 +3549,6 @@ vboxDumpDisplay(virDomainDef *def, struct _vboxDriver *data,
IMachine *machine)
IVRDEServer *VRDEServer = NULL;
PRBool VRDxEnabled = PR_FALSE;
virDomainGraphicsDef *graphics = NULL;
- int ret = -1;
def->ngraphics = 0;
@@ -3625,8 +3624,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)
@@ -3639,14 +3637,11 @@ vboxDumpDisplay(virDomainDef *def, struct _vboxDriver *data,
IMachine *machine)
VIR_APPEND_ELEMENT(def->graphics, def->ngraphics, graphics);
}
- ret = 0;
-
- cleanup:
VBOX_RELEASE(VRDEServer);
VBOX_UTF8_FREE(valueTypeUtf8);
VBOX_UTF8_FREE(netAddressUtf8);
virDomainGraphicsDefFree(graphics);
- return ret;
+ return 0;
}
static int
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.34.1