The function always returns 0. Remove the return value and fix callers.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
priv.event = QEMU_AGENT_EVENT_SHUTDOWN;
priv.mode = "halt";
- if (qemuMonitorTestAddHandler(test, "guest-shutdown",
- qemuAgentShutdownTestMonitorHandler,
- &priv, NULL) < 0)
- return -1;
+ qemuMonitorTestAddHandler(test, "guest-shutdown",
+ qemuAgentShutdownTestMonitorHandler,
+ &priv, NULL);
if (qemuAgentShutdown(qemuMonitorTestGetAgent(test),
QEMU_AGENT_SHUTDOWN_HALT) < 0)
priv.event = QEMU_AGENT_EVENT_SHUTDOWN;
priv.mode = "powerdown";
- if (qemuMonitorTestAddHandler(test, "guest-shutdown",
- qemuAgentShutdownTestMonitorHandler,
- &priv, NULL) < 0)
- return -1;
+ qemuMonitorTestAddHandler(test, "guest-shutdown",
+ qemuAgentShutdownTestMonitorHandler,
+ &priv, NULL);
if (qemuAgentShutdown(qemuMonitorTestGetAgent(test),
QEMU_AGENT_SHUTDOWN_POWERDOWN) < 0)
priv.event = QEMU_AGENT_EVENT_RESET;
priv.mode = "reboot";
- if (qemuMonitorTestAddHandler(test,
- "guest-shutdown",
- qemuAgentShutdownTestMonitorHandler,
- &priv, NULL) < 0)
- return -1;
+ qemuMonitorTestAddHandler(test,
+ "guest-shutdown",
+ qemuAgentShutdownTestMonitorHandler,
+ &priv, NULL);
if (qemuAgentShutdown(qemuMonitorTestGetAgent(test),
QEMU_AGENT_SHUTDOWN_REBOOT) < 0)
if (virTestGetExpensive() == 0)
return EXIT_AM_SKIP;
- if (qemuMonitorTestAddHandler(test, NULL,
- qemuAgentTimeoutTestMonitorHandler,
- NULL, NULL) < 0)
- return -1;
+ qemuMonitorTestAddHandler(test, NULL,
+ qemuAgentTimeoutTestMonitorHandler,
+ NULL, NULL);
if (qemuAgentFSFreeze(qemuMonitorTestGetAgent(test), NULL, 0) != -1) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
if (qemuMonitorTestAddAgentSyncResponse(test) < 0)
return -1;
- if (qemuMonitorTestAddHandler(test,
- NULL,
- qemuAgentTimeoutTestMonitorHandler,
- NULL, NULL) < 0)
- return -1;
+ qemuMonitorTestAddHandler(test,
+ NULL,
+ qemuAgentTimeoutTestMonitorHandler,
+ NULL, NULL);
if (qemuAgentArbitraryCommand(qemuMonitorTestGetAgent(test),
"{\"execute\":\"ble\"}",
}
-int
+void
qemuMonitorTestAddHandler(qemuMonitorTest *test,
const char *identifier,
qemuMonitorTestResponseCallback cb,
VIR_WITH_MUTEX_LOCK_GUARD(&test->lock) {
VIR_APPEND_ELEMENT(test->items, test->nitems, item);
}
-
- return 0;
}
void *
data->command_name = g_strdup(command_name);
data->response = g_strdup(response);
- return qemuMonitorTestAddHandler(test,
- command_name,
- qemuMonitorTestProcessCommandDefault,
- data, qemuMonitorTestHandlerDataFree);
+ qemuMonitorTestAddHandler(test,
+ command_name,
+ qemuMonitorTestProcessCommandDefault,
+ data, qemuMonitorTestHandlerDataFree);
+
+ return 0;
}
data->cmderr = g_strdup(cmderr);
data->command_name = g_steal_pointer(&reformatted);
- return qemuMonitorTestAddHandler(test,
- command,
- qemuMonitorTestProcessCommandVerbatim,
- data, qemuMonitorTestHandlerDataFree);
+ qemuMonitorTestAddHandler(test,
+ command,
+ qemuMonitorTestProcessCommandVerbatim,
+ data, qemuMonitorTestHandlerDataFree);
+
+ return 0;
}
return -1;
}
- return qemuMonitorTestAddHandler(test,
- "agent-sync",
- qemuMonitorTestProcessGuestAgentSync,
- NULL, NULL);
+ qemuMonitorTestAddHandler(test,
+ "agent-sync",
+ qemuMonitorTestProcessGuestAgentSync,
+ NULL, NULL);
+
+ return 0;
}
va_end(args);
- return qemuMonitorTestAddHandler(test,
- cmdname,
- qemuMonitorTestProcessCommandWithArgs,
- data, qemuMonitorTestHandlerDataFree);
+ qemuMonitorTestAddHandler(test,
+ cmdname,
+ qemuMonitorTestProcessCommandWithArgs,
+ data, qemuMonitorTestHandlerDataFree);
+
+ return 0;
error:
va_end(args);
}
}
- return qemuMonitorTestAddHandler(test,
- cmdname,
- qemuMonitorTestProcessCommandWithArgStr,
- data, qemuMonitorTestHandlerDataFree);
+ qemuMonitorTestAddHandler(test,
+ cmdname,
+ qemuMonitorTestProcessCommandWithArgStr,
+ data, qemuMonitorTestHandlerDataFree);
+
+ return 0;
}
qemuMonitorTestItem *item,
const char *message);
-int
+void
qemuMonitorTestAddHandler(qemuMonitorTest *test,
const char *identifier,
qemuMonitorTestResponseCallback cb,