From: Peter Krempa <pkrempa@redhat.com>
Convert the rest of the code to the new prevailing coding style. Commit
6e6a11bc0ac did the same for the header file.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_monitor_json.c | 373 +++++++++++++++++++++++------------
1 file changed, 246 insertions(+), 127 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index b459a2f036..2dbaa7a798 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -133,6 +133,7 @@ static qemuEventHandler eventHandlers[] = {
/* We use bsearch, so keep this list sorted. */
};
+
static int
qemuMonitorEventCompare(const void *key, const void *elt)
{
@@ -141,6 +142,7 @@ qemuMonitorEventCompare(const void *key, const void *elt)
return strcmp(type, handler->type);
}
+
static int
qemuMonitorJSONIOProcessEvent(qemuMonitor *mon,
virJSONValue *obj)
@@ -183,6 +185,7 @@ qemuMonitorJSONIOProcessEvent(qemuMonitor *mon,
return 0;
}
+
int
qemuMonitorJSONIOProcessLine(qemuMonitor *mon,
const char *line,
@@ -227,10 +230,12 @@ qemuMonitorJSONIOProcessLine(qemuMonitor *mon,
return -1;
}
-int qemuMonitorJSONIOProcess(qemuMonitor *mon,
- const char *data,
- size_t len,
- qemuMonitorMessage *msg)
+
+int
+qemuMonitorJSONIOProcess(qemuMonitor *mon,
+ const char *data,
+ size_t len,
+ qemuMonitorMessage *msg)
{
int used = 0;
/*VIR_DEBUG("Data %d bytes [%s]", len, data);*/
@@ -254,6 +259,7 @@ int qemuMonitorJSONIOProcess(qemuMonitor *mon,
return used;
}
+
static int
qemuMonitorJSONCommandWithFd(qemuMonitor *mon,
virJSONValue *cmd,
@@ -308,6 +314,7 @@ qemuMonitorJSONCommand(qemuMonitor *mon,
return qemuMonitorJSONCommandWithFd(mon, cmd, -1, reply);
}
+
/* Ignoring OOM in this method, since we're already reporting
* a more important error
*
@@ -332,6 +339,7 @@ qemuMonitorJSONStringifyError(virJSONValue *error)
return detail;
}
+
static const char *
qemuMonitorJSONCommandName(virJSONValue *cmd)
{
@@ -342,6 +350,7 @@ qemuMonitorJSONCommandName(virJSONValue *cmd)
return "<unknown>";
}
+
static int
qemuMonitorJSONCheckErrorFull(virJSONValue *cmd,
virJSONValue *reply,
@@ -545,7 +554,9 @@ qemuMonitorJSONMakeCommand(const char *cmdname,
}
-static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *data)
+static void
+qemuMonitorJSONHandleShutdown(qemuMonitor *mon,
+ virJSONValue *data)
{
bool guest = false;
const char *reason = NULL;
@@ -560,17 +571,24 @@ static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *data)
qemuMonitorEmitShutdown(mon, guest_initiated, reason);
}
-static void qemuMonitorJSONHandleReset(qemuMonitor *mon, virJSONValue *data G_GNUC_UNUSED)
+
+static void qemuMonitorJSONHandleReset(qemuMonitor *mon,
+ virJSONValue *data G_GNUC_UNUSED)
{
qemuMonitorEmitReset(mon);
}
-static void qemuMonitorJSONHandleStop(qemuMonitor *mon, virJSONValue *data G_GNUC_UNUSED)
+
+static void
+qemuMonitorJSONHandleStop(qemuMonitor *mon,
+ virJSONValue *data G_GNUC_UNUSED)
{
qemuMonitorEmitStop(mon);
}
-static void qemuMonitorJSONHandleResume(qemuMonitor *mon, virJSONValue *data G_GNUC_UNUSED)
+static void
+qemuMonitorJSONHandleResume(qemuMonitor *mon,
+ virJSONValue *data G_GNUC_UNUSED)
{
qemuMonitorEmitResume(mon);
}
@@ -596,6 +614,7 @@ qemuMonitorJSONGuestPanicExtractInfoHyperv(virJSONValue *data)
return g_steal_pointer(&ret);
}
+
static qemuMonitorEventPanicInfo *
qemuMonitorJSONGuestPanicExtractInfoS390(virJSONValue *data)
{
@@ -625,6 +644,7 @@ qemuMonitorJSONGuestPanicExtractInfoS390(virJSONValue *data)
return g_steal_pointer(&ret);
}
+
static qemuMonitorEventPanicInfo *
qemuMonitorJSONGuestPanicExtractInfoTDX(virJSONValue *data)
{
@@ -655,6 +675,7 @@ qemuMonitorJSONGuestPanicExtractInfoTDX(virJSONValue *data)
return g_steal_pointer(&ret);
}
+
static qemuMonitorEventPanicInfo *
qemuMonitorJSONGuestPanicExtractInfo(virJSONValue *data)
{
@@ -687,7 +708,9 @@ qemuMonitorJSONHandleGuestPanic(qemuMonitor *mon,
}
-static void qemuMonitorJSONHandleRTCChange(qemuMonitor *mon, virJSONValue *data)
+static void
+qemuMonitorJSONHandleRTCChange(qemuMonitor *mon,
+ virJSONValue *data)
{
long long offset = 0;
if (virJSONValueObjectGetNumberLong(data, "offset", &offset) < 0) {
@@ -697,13 +720,17 @@ static void qemuMonitorJSONHandleRTCChange(qemuMonitor *mon, virJSONValue *data)
qemuMonitorEmitRTCChange(mon, offset);
}
+
VIR_ENUM_DECL(qemuMonitorWatchdogAction);
VIR_ENUM_IMPL(qemuMonitorWatchdogAction,
VIR_DOMAIN_EVENT_WATCHDOG_LAST,
"none", "pause", "reset", "poweroff", "shutdown", "debug", "inject-nmi",
);
-static void qemuMonitorJSONHandleWatchdog(qemuMonitor *mon, virJSONValue *data)
+
+static void
+qemuMonitorJSONHandleWatchdog(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *action;
int actionID;
@@ -720,6 +747,7 @@ static void qemuMonitorJSONHandleWatchdog(qemuMonitor *mon, virJSONValue *data)
qemuMonitorEmitWatchdog(mon, actionID);
}
+
VIR_ENUM_DECL(qemuMonitorIOErrorAction);
VIR_ENUM_IMPL(qemuMonitorIOErrorAction,
VIR_DOMAIN_EVENT_IO_ERROR_LAST,
@@ -728,7 +756,8 @@ VIR_ENUM_IMPL(qemuMonitorIOErrorAction,
static void
-qemuMonitorJSONHandleIOError(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleIOError(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *device;
const char *qompath;
@@ -778,6 +807,7 @@ VIR_ENUM_IMPL(qemuMonitorGraphicsAddressFamily,
"ipv4", "ipv6", "unix",
);
+
static void
qemuMonitorJSONHandleGraphicsVNC(qemuMonitor *mon,
virJSONValue *data,
@@ -849,19 +879,26 @@ qemuMonitorJSONHandleGraphicsVNC(qemuMonitor *mon,
authScheme, x509dname, saslUsername);
}
-static void qemuMonitorJSONHandleVNCConnect(qemuMonitor *mon, virJSONValue *data)
+
+static void
+qemuMonitorJSONHandleVNCConnect(qemuMonitor *mon,
+ virJSONValue *data)
{
qemuMonitorJSONHandleGraphicsVNC(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_CONNECT);
}
-static void qemuMonitorJSONHandleVNCInitialize(qemuMonitor *mon, virJSONValue *data)
+static void
+qemuMonitorJSONHandleVNCInitialize(qemuMonitor *mon,
+ virJSONValue *data)
{
qemuMonitorJSONHandleGraphicsVNC(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE);
}
-static void qemuMonitorJSONHandleVNCDisconnect(qemuMonitor *mon, virJSONValue *data)
+static void
+qemuMonitorJSONHandleVNCDisconnect(qemuMonitor *mon,
+ virJSONValue *data)
{
qemuMonitorJSONHandleGraphicsVNC(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT);
}
@@ -931,23 +968,30 @@ qemuMonitorJSONHandleGraphicsSPICE(qemuMonitor *mon,
}
-static void qemuMonitorJSONHandleSPICEConnect(qemuMonitor *mon, virJSONValue *data)
+static void
+qemuMonitorJSONHandleSPICEConnect(qemuMonitor *mon,
+ virJSONValue *data)
{
qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_CONNECT);
}
-static void qemuMonitorJSONHandleSPICEInitialize(qemuMonitor *mon, virJSONValue *data)
+static void
+qemuMonitorJSONHandleSPICEInitialize(qemuMonitor *mon,
+ virJSONValue *data)
{
qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE);
}
-static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon, virJSONValue *data)
+static void
+qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon,
+ virJSONValue *data)
{
qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT);
}
+
static void
qemuMonitorJSONHandleJobStatusChange(qemuMonitor *mon,
virJSONValue *data)
@@ -1002,6 +1046,7 @@ qemuMonitorJSONHandleTrayChange(qemuMonitor *mon,
qemuMonitorEmitTrayChange(mon, devAlias, devid, reason);
}
+
static void
qemuMonitorJSONHandlePMWakeup(qemuMonitor *mon,
virJSONValue *data G_GNUC_UNUSED)
@@ -1009,6 +1054,7 @@ qemuMonitorJSONHandlePMWakeup(qemuMonitor *mon,
qemuMonitorEmitPMWakeup(mon);
}
+
static void
qemuMonitorJSONHandlePMSuspend(qemuMonitor *mon,
virJSONValue *data G_GNUC_UNUSED)
@@ -1030,6 +1076,7 @@ qemuMonitorJSONHandleBalloonChange(qemuMonitor *mon,
qemuMonitorEmitBalloonChange(mon, actual);
}
+
static void
qemuMonitorJSONHandlePMSuspendDisk(qemuMonitor *mon,
virJSONValue *data G_GNUC_UNUSED)
@@ -1037,8 +1084,10 @@ qemuMonitorJSONHandlePMSuspendDisk(qemuMonitor *mon,
qemuMonitorEmitPMSuspendDisk(mon);
}
+
static void
-qemuMonitorJSONHandleDeviceDeleted(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleDeviceDeleted(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *device;
@@ -1052,7 +1101,8 @@ qemuMonitorJSONHandleDeviceDeleted(qemuMonitor *mon, virJSONValue *data)
static void
-qemuMonitorJSONHandleDeviceUnplugErr(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleDeviceUnplugErr(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *device;
const char *path;
@@ -1069,7 +1119,8 @@ qemuMonitorJSONHandleDeviceUnplugErr(qemuMonitor *mon, virJSONValue *data)
static void
-qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *name;
@@ -1083,7 +1134,8 @@ qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMonitor *mon, virJSONValue *da
static void
-qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *name;
@@ -1097,7 +1149,8 @@ qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemuMonitor *mon, virJSONValue
static void
-qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *name;
@@ -1245,7 +1298,8 @@ qemuMonitorJSONHandleMigrationPass(qemuMonitor *mon,
static void
-qemuMonitorJSONHandleAcpiOstInfo(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleAcpiOstInfo(qemuMonitor *mon,
+ virJSONValue *data)
{
virJSONValue *info;
const char *alias;
@@ -1282,7 +1336,8 @@ qemuMonitorJSONHandleAcpiOstInfo(qemuMonitor *mon, virJSONValue *data)
static void
-qemuMonitorJSONHandleBlockThreshold(qemuMonitor *mon, virJSONValue *data)
+qemuMonitorJSONHandleBlockThreshold(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *nodename;
unsigned long long threshold;
@@ -1363,8 +1418,9 @@ qemuMonitorJSONHandleDumpCompleted(qemuMonitor *mon,
}
-static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitor *mon,
- virJSONValue *data)
+static void
+qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *name;
bool connected;
@@ -1384,8 +1440,9 @@ static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitor *mon,
}
-static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitor *mon,
- virJSONValue *data)
+static void
+qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitor *mon,
+ virJSONValue *data)
{
const char *netdev;
bool gid_status;
@@ -1576,7 +1633,8 @@ qemuMonitorJSONGetStatus(qemuMonitor *mon,
}
-int qemuMonitorJSONSystemPowerdown(qemuMonitor *mon)
+int
+qemuMonitorJSONSystemPowerdown(qemuMonitor *mon)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("system_powerdown", NULL);
g_autoptr(virJSONValue) reply = NULL;
@@ -1593,9 +1651,11 @@ int qemuMonitorJSONSystemPowerdown(qemuMonitor *mon)
return 0;
}
-int qemuMonitorJSONSetLink(qemuMonitor *mon,
- const char *name,
- virDomainNetInterfaceLinkState state)
+
+int
+qemuMonitorJSONSetLink(qemuMonitor *mon,
+ const char *name,
+ virDomainNetInterfaceLinkState state)
{
g_autoptr(virJSONValue) reply = NULL;
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("set_link",
@@ -1615,7 +1675,9 @@ int qemuMonitorJSONSetLink(qemuMonitor *mon,
return 0;
}
-int qemuMonitorJSONSystemReset(qemuMonitor *mon)
+
+int
+qemuMonitorJSONSystemReset(qemuMonitor *mon)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("system_reset", NULL);
g_autoptr(virJSONValue) reply = NULL;
@@ -2250,8 +2312,9 @@ qemuMonitorJSONBlockInfoAdd(GHashTable *table,
}
-int qemuMonitorJSONGetBlockInfo(qemuMonitor *mon,
- GHashTable *table)
+int
+qemuMonitorJSONGetBlockInfo(qemuMonitor *mon,
+ GHashTable *table)
{
size_t i;
g_autoptr(virJSONValue) devices = NULL;
@@ -2823,10 +2886,11 @@ qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon)
}
-int qemuMonitorJSONBlockResize(qemuMonitor *mon,
- const char *device,
- const char *nodename,
- unsigned long long size)
+int
+qemuMonitorJSONBlockResize(qemuMonitor *mon,
+ const char *device,
+ const char *nodename,
+ unsigned long long size)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -2849,10 +2913,11 @@ int qemuMonitorJSONBlockResize(qemuMonitor *mon,
}
-int qemuMonitorJSONSetPassword(qemuMonitor *mon,
- const char *protocol,
- const char *password,
- const char *action_if_connected)
+int
+qemuMonitorJSONSetPassword(qemuMonitor *mon,
+ const char *protocol,
+ const char *password,
+ const char *action_if_connected)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("set_password",
"s:protocol", protocol,
@@ -2873,9 +2938,11 @@ int qemuMonitorJSONSetPassword(qemuMonitor *mon,
return 0;
}
-int qemuMonitorJSONExpirePassword(qemuMonitor *mon,
- const char *protocol,
- const char *expire_time)
+
+int
+qemuMonitorJSONExpirePassword(qemuMonitor *mon,
+ const char *protocol,
+ const char *expire_time)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("expire_password",
"s:protocol", protocol,
@@ -2926,11 +2993,12 @@ qemuMonitorJSONSetBalloon(qemuMonitor *mon,
}
-static int qemuMonitorJSONSaveMemory(qemuMonitor *mon,
- const char *cmdtype,
- unsigned long long offset,
- unsigned long long length,
- const char *path)
+static int
+qemuMonitorJSONSaveMemory(qemuMonitor *mon,
+ const char *cmdtype,
+ unsigned long long offset,
+ unsigned long long length,
+ const char *path)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand(cmdtype,
"U:val", offset,
@@ -2994,6 +3062,7 @@ qemuMonitorJSONGetMigrationParams(qemuMonitor *mon,
return 0;
}
+
int
qemuMonitorJSONSetMigrationParams(qemuMonitor *mon,
virJSONValue **params)
@@ -3225,9 +3294,10 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
}
-int qemuMonitorJSONGetMigrationStats(qemuMonitor *mon,
- qemuMonitorMigrationStats *stats,
- char **error)
+int
+qemuMonitorJSONGetMigrationStats(qemuMonitor *mon,
+ qemuMonitorMigrationStats *stats,
+ char **error)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("query-migrate",
NULL);
@@ -3251,9 +3321,10 @@ int qemuMonitorJSONGetMigrationStats(qemuMonitor *mon,
}
-int qemuMonitorJSONMigrate(qemuMonitor *mon,
- unsigned int flags,
- const char *uri)
+int
+qemuMonitorJSONMigrate(qemuMonitor *mon,
+ unsigned int flags,
+ const char *uri)
{
bool resume = !!(flags & QEMU_MONITOR_MIGRATE_RESUME);
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("migrate",
@@ -3318,7 +3389,8 @@ qemuMonitorJSONGetMigrationBlockers(qemuMonitor *mon,
}
-int qemuMonitorJSONMigrateCancel(qemuMonitor *mon)
+int
+qemuMonitorJSONMigrateCancel(qemuMonitor *mon)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("migrate_cancel", NULL);
g_autoptr(virJSONValue) reply = NULL;
@@ -3426,6 +3498,7 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitor *mon,
return 0;
}
+
int
qemuMonitorJSONDump(qemuMonitor *mon,
const char *protocol,
@@ -3452,12 +3525,14 @@ qemuMonitorJSONDump(qemuMonitor *mon,
return 0;
}
-int qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon,
- int type,
- const char *hostname,
- int port,
- int tlsPort,
- const char *tlsSubject)
+
+int
+qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon,
+ int type,
+ const char *hostname,
+ int port,
+ int tlsPort,
+ const char *tlsSubject)
{
const char *protocol = "vnc";
g_autoptr(virJSONValue) cmd = NULL;
@@ -3577,8 +3652,9 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg,
}
-int qemuMonitorJSONQueryFdsets(qemuMonitor *mon,
- qemuMonitorFdsets **fdsets)
+int
+qemuMonitorJSONQueryFdsets(qemuMonitor *mon,
+ qemuMonitorFdsets **fdsets)
{
g_autoptr(virJSONValue) reply = NULL;
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("query-fdsets",
@@ -3600,8 +3676,9 @@ int qemuMonitorJSONQueryFdsets(qemuMonitor *mon,
}
-int qemuMonitorJSONRemoveFdset(qemuMonitor *mon,
- unsigned int fdset)
+int
+qemuMonitorJSONRemoveFdset(qemuMonitor *mon,
+ unsigned int fdset)
{
g_autoptr(virJSONValue) reply = NULL;
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("remove-fd",
@@ -3621,9 +3698,10 @@ int qemuMonitorJSONRemoveFdset(qemuMonitor *mon,
}
-int qemuMonitorJSONSendFileHandle(qemuMonitor *mon,
- const char *fdname,
- int fd)
+int
+qemuMonitorJSONSendFileHandle(qemuMonitor *mon,
+ const char *fdname,
+ int fd)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("getfd",
"s:fdname", fdname,
@@ -3643,8 +3721,9 @@ int qemuMonitorJSONSendFileHandle(qemuMonitor *mon,
}
-int qemuMonitorJSONCloseFileHandle(qemuMonitor *mon,
- const char *fdname)
+int
+qemuMonitorJSONCloseFileHandle(qemuMonitor *mon,
+ const char *fdname)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("closefd",
"s:fdname", fdname,
@@ -3860,7 +3939,8 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValue *msg,
int
-qemuMonitorJSONQueryRxFilter(qemuMonitor *mon, const char *alias,
+qemuMonitorJSONQueryRxFilter(qemuMonitor *mon,
+ const char *alias,
virNetDevRxFilter **filter)
{
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("query-rx-filter",
@@ -3985,8 +4065,9 @@ qemuMonitorJSONGetChardevInfo(qemuMonitor *mon,
}
-int qemuMonitorJSONDelDevice(qemuMonitor *mon,
- const char *devalias)
+int
+qemuMonitorJSONDelDevice(qemuMonitor *mon,
+ const char *devalias)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4126,7 +4207,8 @@ qemuMonitorJSONBlockdevMirror(qemuMonitor *mon,
int
-qemuMonitorJSONTransaction(qemuMonitor *mon, virJSONValue **actions)
+qemuMonitorJSONTransaction(qemuMonitor *mon,
+ virJSONValue **actions)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4190,10 +4272,12 @@ qemuMonitorJSONBlockCommit(qemuMonitor *mon,
return 0;
}
-int qemuMonitorJSONArbitraryCommand(qemuMonitor *mon,
- const char *cmd_str,
- int fd,
- char **reply_str)
+
+int
+qemuMonitorJSONArbitraryCommand(qemuMonitor *mon,
+ const char *cmd_str,
+ int fd,
+ char **reply_str)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4210,7 +4294,9 @@ int qemuMonitorJSONArbitraryCommand(qemuMonitor *mon,
return 0;
}
-int qemuMonitorJSONInjectNMI(qemuMonitor *mon)
+
+int
+qemuMonitorJSONInjectNMI(qemuMonitor *mon)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4228,10 +4314,12 @@ int qemuMonitorJSONInjectNMI(qemuMonitor *mon)
return 0;
}
-int qemuMonitorJSONSendKey(qemuMonitor *mon,
- unsigned int holdtime,
- unsigned int *keycodes,
- unsigned int nkeycodes)
+
+int
+qemuMonitorJSONSendKey(qemuMonitor *mon,
+ unsigned int holdtime,
+ unsigned int *keycodes,
+ unsigned int nkeycodes)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4281,11 +4369,13 @@ int qemuMonitorJSONSendKey(qemuMonitor *mon,
return 0;
}
-int qemuMonitorJSONScreendump(qemuMonitor *mon,
- const char *device,
- unsigned int head,
- const char *format,
- const char *file)
+
+int
+qemuMonitorJSONScreendump(qemuMonitor *mon,
+ const char *device,
+ unsigned int head,
+ const char *format,
+ const char *file)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4375,6 +4465,7 @@ qemuMonitorJSONParseBlockJobInfo(GHashTable *blockJobs,
return 0;
}
+
GHashTable *
qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon,
bool rawjobname)
@@ -4587,10 +4678,11 @@ qemuMonitorJSONJobComplete(qemuMonitor *mon,
}
-int qemuMonitorJSONOpenGraphics(qemuMonitor *mon,
- const char *protocol,
- const char *fdname,
- bool skipauth)
+int
+qemuMonitorJSONOpenGraphics(qemuMonitor *mon,
+ const char *protocol,
+ const char *fdname,
+ bool skipauth)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4706,9 +4798,11 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
#undef GET_THROTTLE_STATS
#undef GET_THROTTLE_STATS_OPTIONAL
-int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon,
- const char *qomid,
- virDomainBlockIoTuneInfo *info)
+
+int
+qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon,
+ const char *qomid,
+ virDomainBlockIoTuneInfo *info)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) result = NULL;
@@ -4747,9 +4841,11 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon,
return 0;
}
-int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
- const char *qdevid,
- virDomainBlockIoTuneInfo *reply)
+
+int
+qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
+ const char *qdevid,
+ virDomainBlockIoTuneInfo *reply)
{
g_autoptr(virJSONValue) devices = NULL;
@@ -4820,7 +4916,8 @@ qemuMonitorJSONUpdateThrottleGroup(qemuMonitor *mon,
}
-int qemuMonitorJSONSystemWakeup(qemuMonitor *mon)
+int
+qemuMonitorJSONSystemWakeup(qemuMonitor *mon)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4838,11 +4935,13 @@ int qemuMonitorJSONSystemWakeup(qemuMonitor *mon)
return 0;
}
-int qemuMonitorJSONGetVersion(qemuMonitor *mon,
- int *major,
- int *minor,
- int *micro,
- char **package)
+
+int
+qemuMonitorJSONGetVersion(qemuMonitor *mon,
+ int *major,
+ int *minor,
+ int *micro,
+ char **package)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -4898,8 +4997,9 @@ int qemuMonitorJSONGetVersion(qemuMonitor *mon,
}
-int qemuMonitorJSONGetMachines(qemuMonitor *mon,
- qemuMonitorMachineInfo ***machines)
+int
+qemuMonitorJSONGetMachines(qemuMonitor *mon,
+ qemuMonitorMachineInfo ***machines)
{
int ret = -1;
g_autoptr(virJSONValue) cmd = NULL;
@@ -5523,9 +5623,10 @@ qemuMonitorJSONGetCommandLineOptions(qemuMonitor *mon)
}
-int qemuMonitorJSONGetKVMState(qemuMonitor *mon,
- bool *enabled,
- bool *present)
+int
+qemuMonitorJSONGetKVMState(qemuMonitor *mon,
+ bool *enabled,
+ bool *present)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -5599,9 +5700,10 @@ qemuMonitorJSONGetObjectTypes(qemuMonitor *mon,
}
-int qemuMonitorJSONGetObjectListPaths(qemuMonitor *mon,
- const char *path,
- qemuMonitorJSONListPath ***paths)
+int
+qemuMonitorJSONGetObjectListPaths(qemuMonitor *mon,
+ const char *path,
+ qemuMonitorJSONListPath ***paths)
{
int ret = -1;
g_autoptr(virJSONValue) cmd = NULL;
@@ -5668,7 +5770,9 @@ int qemuMonitorJSONGetObjectListPaths(qemuMonitor *mon,
return ret;
}
-void qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths)
+
+void
+qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths)
{
if (!paths)
return;
@@ -5678,10 +5782,11 @@ void qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths)
}
-int qemuMonitorJSONGetObjectProperty(qemuMonitor *mon,
- const char *path,
- const char *property,
- qemuMonitorJSONObjectProperty *prop)
+int
+qemuMonitorJSONGetObjectProperty(qemuMonitor *mon,
+ const char *path,
+ const char *property,
+ qemuMonitorJSONObjectProperty *prop)
{
int ret = -1;
g_autoptr(virJSONValue) cmd = NULL;
@@ -5786,10 +5891,11 @@ qemuMonitorJSONGetStringListProperty(qemuMonitor *mon,
"s:property", property, \
STRING, VALUE, \
NULL)
-int qemuMonitorJSONSetObjectProperty(qemuMonitor *mon,
- const char *path,
- const char *property,
- qemuMonitorJSONObjectProperty *prop)
+int
+qemuMonitorJSONSetObjectProperty(qemuMonitor *mon,
+ const char *path,
+ const char *property,
+ qemuMonitorJSONObjectProperty *prop)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
@@ -6394,6 +6500,7 @@ qemuMonitorJSONBuildInetSocketAddress(const char *host,
return g_steal_pointer(&addr);
}
+
static virJSONValue *
qemuMonitorJSONBuildUnixSocketAddress(const char *path)
{
@@ -6475,6 +6582,7 @@ qemuMonitorJSONNBDServerStart(qemuMonitor *mon,
return 0;
}
+
int
qemuMonitorJSONNBDServerStop(qemuMonitor *mon)
{
@@ -6604,6 +6712,7 @@ struct _qemuMonitorJSONCPUPropsFilterData {
virJSONValue *unavailableFeatures;
};
+
static int
qemuMonitorJSONCPUPropsFilter(const char *name,
virJSONValue *propData,
@@ -6827,6 +6936,7 @@ qemuMonitorJSONRTCResetReinjection(qemuMonitor *mon)
return 0;
}
+
/**
* Query and parse returned array of data such as:
*
@@ -8158,6 +8268,7 @@ qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValue *actions,
NULL);
}
+
VIR_ENUM_DECL(qemuMonitorTransactionBackupSyncMode);
VIR_ENUM_IMPL(qemuMonitorTransactionBackupSyncMode,
QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_LAST,
@@ -8165,6 +8276,7 @@ VIR_ENUM_IMPL(qemuMonitorTransactionBackupSyncMode,
"incremental",
"full");
+
int
qemuMonitorJSONTransactionBackup(virJSONValue *actions,
const char *device,
@@ -8311,6 +8423,7 @@ qemuMonitorJSONStartDirtyRateCalc(qemuMonitor *mon,
return 0;
}
+
VIR_ENUM_DECL(qemuMonitorDirtyRateStatus);
VIR_ENUM_IMPL(qemuMonitorDirtyRateStatus,
VIR_DOMAIN_DIRTYRATE_LAST,
@@ -8318,6 +8431,7 @@ VIR_ENUM_IMPL(qemuMonitorDirtyRateStatus,
"measuring",
"measured");
+
static int
qemuMonitorJSONExtractVcpuDirtyRate(virJSONValue *data,
qemuMonitorDirtyRateInfo *info)
@@ -8349,6 +8463,7 @@ qemuMonitorJSONExtractVcpuDirtyRate(virJSONValue *data,
return 0;
}
+
static int
qemuMonitorJSONExtractDirtyRateInfo(virJSONValue *data,
qemuMonitorDirtyRateInfo *info)
@@ -8556,6 +8671,7 @@ qemuMonitorJSONMigrateRecover(qemuMonitor *mon,
return qemuMonitorJSONCheckError(cmd, reply);
}
+
static GHashTable *
qemuMonitorJSONExtractQueryStatsSchema(virJSONValue *json)
{
@@ -8628,6 +8744,7 @@ qemuMonitorJSONExtractQueryStatsSchema(virJSONValue *json)
return g_steal_pointer(&schema);
}
+
GHashTable *
qemuMonitorJSONQueryStatsSchema(qemuMonitor *mon,
qemuMonitorQueryStatsProviderType provider_type)
@@ -8734,9 +8851,11 @@ qemuMonitorJSONQueryStats(qemuMonitor *mon,
return virJSONValueObjectStealArray(reply, "return");
}
-int qemuMonitorJSONDisplayReload(qemuMonitor *mon,
- const char *type,
- bool tlsCerts)
+
+int
+qemuMonitorJSONDisplayReload(qemuMonitor *mon,
+ const char *type,
+ bool tlsCerts)
{
g_autoptr(virJSONValue) reply = NULL;
g_autoptr(virJSONValue) cmd = NULL;
--
2.51.0
© 2016 - 2025 Red Hat, Inc.