qemuDomainDefAddImplicitInputDevice() 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/qemu/qemu_domain.c | 31 ++++++++++++-------------------
1 file changed, 12 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 003fe7c71b..0a15f77517 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3917,22 +3917,18 @@ virXMLNamespace virQEMUDriverDomainXMLNamespace = {
};
-static int
+static void
qemuDomainDefAddImplicitInputDevice(virDomainDef *def)
{
if (ARCH_IS_X86(def->os.arch)) {
- if (virDomainDefMaybeAddInput(def,
- VIR_DOMAIN_INPUT_TYPE_MOUSE,
- VIR_DOMAIN_INPUT_BUS_PS2) < 0)
- return -1;
+ virDomainDefMaybeAddInput(def,
+ VIR_DOMAIN_INPUT_TYPE_MOUSE,
+ VIR_DOMAIN_INPUT_BUS_PS2);
- if (virDomainDefMaybeAddInput(def,
- VIR_DOMAIN_INPUT_TYPE_KBD,
- VIR_DOMAIN_INPUT_BUS_PS2) < 0)
- return -1;
+ virDomainDefMaybeAddInput(def,
+ VIR_DOMAIN_INPUT_TYPE_KBD,
+ VIR_DOMAIN_INPUT_BUS_PS2);
}
-
- return 0;
}
static int
@@ -4122,8 +4118,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
bool addITCOWatchdog = false;
/* add implicit input devices */
- if (qemuDomainDefAddImplicitInputDevice(def) < 0)
- return -1;
+ qemuDomainDefAddImplicitInputDevice(def);
/* Add implicit PCI root controller if the machine has one */
switch (def->os.arch) {
@@ -4321,18 +4316,16 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
}
if (addDefaultUSBKBD &&
- def->ngraphics > 0 &&
+ def->ngraphics > 0)
virDomainDefMaybeAddInput(def,
VIR_DOMAIN_INPUT_TYPE_KBD,
- VIR_DOMAIN_INPUT_BUS_USB) < 0)
- return -1;
+ VIR_DOMAIN_INPUT_BUS_USB);
if (addDefaultUSBMouse &&
- def->ngraphics > 0 &&
+ def->ngraphics > 0)
virDomainDefMaybeAddInput(def,
VIR_DOMAIN_INPUT_TYPE_MOUSE,
- VIR_DOMAIN_INPUT_BUS_USB) < 0)
- return -1;
+ VIR_DOMAIN_INPUT_BUS_USB);
if (addPanicDevice) {
size_t j;
--
2.34.1