libxlMakeDomainCapabilities() 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/libxl/libxl_capabilities.c | 4 +---
src/libxl/libxl_capabilities.h | 2 +-
src/libxl/libxl_driver.c | 5 ++---
tests/domaincapstest.c | 3 +--
4 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c
index 159d923fc3..e6ed9ef29f 100644
--- a/src/libxl/libxl_capabilities.c
+++ b/src/libxl/libxl_capabilities.c
@@ -652,7 +652,7 @@ libxlMakeCapabilities(libxl_ctx *ctx)
#define HVM_MAX_VCPUS 128
#define PV_MAX_VCPUS 512
-int
+void
libxlMakeDomainCapabilities(virDomainCaps *domCaps,
virFirmware **firmwares,
size_t nfirmwares)
@@ -680,8 +680,6 @@ libxlMakeDomainCapabilities(virDomainCaps *domCaps,
domCaps->features[VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO] = VIR_TRISTATE_BOOL_NO;
domCaps->features[VIR_DOMAIN_CAPS_FEATURE_GENID] = VIR_TRISTATE_BOOL_NO;
domCaps->gic.supported = VIR_TRISTATE_BOOL_NO;
-
- return 0;
}
#define LIBXL_QEMU_DM_STR "Options specific to the Xen version:"
diff --git a/src/libxl/libxl_capabilities.h b/src/libxl/libxl_capabilities.h
index fd6332b63e..16ac3ed034 100644
--- a/src/libxl/libxl_capabilities.h
+++ b/src/libxl/libxl_capabilities.h
@@ -40,7 +40,7 @@
virCaps *
libxlMakeCapabilities(libxl_ctx *ctx);
-int
+void
libxlMakeDomainCapabilities(virDomainCaps *domCaps,
virFirmware **firmwares,
size_t nfirmwares);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 68aecaef8c..658d7d4005 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -6416,9 +6416,8 @@ libxlConnectGetDomainCapabilities(virConnectPtr conn,
if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, virttype)))
goto cleanup;
- if (libxlMakeDomainCapabilities(domCaps, cfg->firmwares,
- cfg->nfirmwares) < 0)
- goto cleanup;
+ libxlMakeDomainCapabilities(domCaps, cfg->firmwares,
+ cfg->nfirmwares);
ret = virDomainCapsFormat(domCaps);
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 97b306f652..ceeaf08b9f 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -143,8 +143,7 @@ fillXenCaps(virDomainCaps *domCaps)
firmwares[0]->name = g_strdup("/usr/lib/xen/boot/hvmloader");
firmwares[1]->name = g_strdup("/usr/lib/xen/boot/ovmf.bin");
- if (libxlMakeDomainCapabilities(domCaps, firmwares, 2) < 0)
- return -1;
+ libxlMakeDomainCapabilities(domCaps, firmwares, 2);
return 0;
}
--
2.34.1