From: Peter Krempa Date: Wed, 1 Oct 2025 11:50:38 +0000 (+0200) Subject: qemu_monitor_json.c: Use consistent function hader coding style X-Git-Tag: v11.9.0-rc1~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6773f77dad371106f01868ec7b58d630bfb6f774;p=thirdparty%2Flibvirt.git qemu_monitor_json.c: Use consistent function hader coding style 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 Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 175d02ebfc..f198e517f3 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 ""; } + 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; @@ -2828,10 +2891,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; @@ -2854,10 +2918,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, @@ -2878,9 +2943,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, @@ -2931,11 +2998,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, @@ -2999,6 +3067,7 @@ qemuMonitorJSONGetMigrationParams(qemuMonitor *mon, return 0; } + int qemuMonitorJSONSetMigrationParams(qemuMonitor *mon, virJSONValue **params) @@ -3230,9 +3299,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); @@ -3256,9 +3326,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", @@ -3323,7 +3394,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; @@ -3431,6 +3503,7 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitor *mon, return 0; } + int qemuMonitorJSONDump(qemuMonitor *mon, const char *protocol, @@ -3457,12 +3530,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; @@ -3582,8 +3657,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", @@ -3605,8 +3681,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", @@ -3626,9 +3703,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, @@ -3648,8 +3726,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, @@ -3865,7 +3944,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", @@ -3990,8 +4070,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; @@ -4131,7 +4212,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; @@ -4195,10 +4277,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; @@ -4215,7 +4299,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; @@ -4233,10 +4319,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; @@ -4286,11 +4374,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; @@ -4380,6 +4470,7 @@ qemuMonitorJSONParseBlockJobInfo(GHashTable *blockJobs, return 0; } + GHashTable * qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon, bool rawjobname) @@ -4592,10 +4683,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; @@ -4711,9 +4803,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; @@ -4752,9 +4846,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; @@ -4825,7 +4921,8 @@ qemuMonitorJSONUpdateThrottleGroup(qemuMonitor *mon, } -int qemuMonitorJSONSystemWakeup(qemuMonitor *mon) +int +qemuMonitorJSONSystemWakeup(qemuMonitor *mon) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -4843,11 +4940,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; @@ -4903,8 +5002,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; @@ -5528,9 +5628,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; @@ -5604,9 +5705,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; @@ -5673,7 +5775,9 @@ int qemuMonitorJSONGetObjectListPaths(qemuMonitor *mon, return ret; } -void qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths) + +void +qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths) { if (!paths) return; @@ -5683,10 +5787,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; @@ -5791,10 +5896,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; @@ -6399,6 +6505,7 @@ qemuMonitorJSONBuildInetSocketAddress(const char *host, return g_steal_pointer(&addr); } + static virJSONValue * qemuMonitorJSONBuildUnixSocketAddress(const char *path) { @@ -6480,6 +6587,7 @@ qemuMonitorJSONNBDServerStart(qemuMonitor *mon, return 0; } + int qemuMonitorJSONNBDServerStop(qemuMonitor *mon) { @@ -6609,6 +6717,7 @@ struct _qemuMonitorJSONCPUPropsFilterData { virJSONValue *unavailableFeatures; }; + static int qemuMonitorJSONCPUPropsFilter(const char *name, virJSONValue *propData, @@ -6832,6 +6941,7 @@ qemuMonitorJSONRTCResetReinjection(qemuMonitor *mon) return 0; } + /** * Query and parse returned array of data such as: * @@ -8163,6 +8273,7 @@ qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValue *actions, NULL); } + VIR_ENUM_DECL(qemuMonitorTransactionBackupSyncMode); VIR_ENUM_IMPL(qemuMonitorTransactionBackupSyncMode, QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_LAST, @@ -8170,6 +8281,7 @@ VIR_ENUM_IMPL(qemuMonitorTransactionBackupSyncMode, "incremental", "full"); + int qemuMonitorJSONTransactionBackup(virJSONValue *actions, const char *device, @@ -8316,6 +8428,7 @@ qemuMonitorJSONStartDirtyRateCalc(qemuMonitor *mon, return 0; } + VIR_ENUM_DECL(qemuMonitorDirtyRateStatus); VIR_ENUM_IMPL(qemuMonitorDirtyRateStatus, VIR_DOMAIN_DIRTYRATE_LAST, @@ -8323,6 +8436,7 @@ VIR_ENUM_IMPL(qemuMonitorDirtyRateStatus, "measuring", "measured"); + static int qemuMonitorJSONExtractVcpuDirtyRate(virJSONValue *data, qemuMonitorDirtyRateInfo *info) @@ -8354,6 +8468,7 @@ qemuMonitorJSONExtractVcpuDirtyRate(virJSONValue *data, return 0; } + static int qemuMonitorJSONExtractDirtyRateInfo(virJSONValue *data, qemuMonitorDirtyRateInfo *info) @@ -8561,6 +8676,7 @@ qemuMonitorJSONMigrateRecover(qemuMonitor *mon, return qemuMonitorJSONCheckError(cmd, reply); } + static GHashTable * qemuMonitorJSONExtractQueryStatsSchema(virJSONValue *json) { @@ -8633,6 +8749,7 @@ qemuMonitorJSONExtractQueryStatsSchema(virJSONValue *json) return g_steal_pointer(&schema); } + GHashTable * qemuMonitorJSONQueryStatsSchema(qemuMonitor *mon, qemuMonitorQueryStatsProviderType provider_type) @@ -8739,9 +8856,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;