From nobody Tue Oct 28 17:47:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1760023236; cv=none; d=zohomail.com; s=zohoarc; b=UPDfyj8pNTtUMR/rx0hPoxrOLDIh//ESod5pv8TRWPm69e14lGq8jxurIbSil6YM05DpGHZqA7LEqMjT+UmLZWN3/DyTLkxfXgK1jCxmVpsnUbqVZOHZEzdD5GaSF6ObsB72paB/AFDNPe6sbKbxQloYmdae5uFQ9aaloY4CyXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1760023236; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=/Jq38UlbPgnxDOMX7OCgoXI/Ed4e11FIhCIw+4bNm2o=; b=nN0gEDqa2X0zE2w2mYHOI5azxiPQwSJRyxbm1Gp5/eo8VDNi8CTyy0i8kcdIJ52BDYJO5VLG9cBO6QyBn5fPcRdXl/PZ/5DU2YCjjrYIFN3h3aGtCbBvlJSvANMzFKDVxabpxp/OuK6zLE1xrh027BWSYgoTL4FmR5MlMlRNVbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 176002323674932.87546510889774; Thu, 9 Oct 2025 08:20:36 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id C10EC44021; Thu, 9 Oct 2025 11:20:33 -0400 (EDT) Received: from [172.19.199.20] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 10C7544381; Thu, 9 Oct 2025 11:16:54 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E2C2443E48; Thu, 9 Oct 2025 11:16:27 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 26E3D43E48 for ; Thu, 9 Oct 2025 11:16:26 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-360-gfcuptvoMEmCxDii9DM3dg-1; Thu, 09 Oct 2025 11:16:22 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B04961956096 for ; Thu, 9 Oct 2025 15:16:21 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.22.12]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A514A1955F22 for ; Thu, 9 Oct 2025 15:16:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760022985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Jq38UlbPgnxDOMX7OCgoXI/Ed4e11FIhCIw+4bNm2o=; b=eM2rbkfw0ZXnxefpTHZ0li+oWjNPEmhL6C46Mso2S8z4yqn1WymfKbsnjNge8tnkWcHeY2 0BykwboPH7j+YfMAA4r8R9XTjdzJYm978zOiJqdwHLWLYanOu3n3UlwukoLkOflls7Be/y cUgyaCi2aPAX5OuIKPIjHGg21pdF0pw= X-MC-Unique: gfcuptvoMEmCxDii9DM3dg-1 X-Mimecast-MFC-AGG-ID: gfcuptvoMEmCxDii9DM3dg_1760022981 To: devel@lists.libvirt.org Subject: [RFC PATCH 02/16] qemu_monitor_json.c: Use consistent function hader coding style Date: Thu, 9 Oct 2025 17:16:02 +0200 Message-ID: <4316d0246768784c1debbea5a1ccb5cbaeaa0250.1760022633.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6lkvO6L1er7qX4e7e1X3M6nldTFizYILsbkXZNaAEKE_1760022981 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7OCV3TUJPHS3G5TDRYABP65TTI6IJTUM X-Message-ID-Hash: 7OCV3TUJPHS3G5TDRYABP65TTI6IJTUM X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1760023239167116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa 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 --- 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[] =3D { /* 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 *el= t) 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 =3D 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 =3D false; const char *reason =3D NULL; @@ -560,17 +571,24 @@ static void qemuMonitorJSONHandleShutdown(qemuMonitor= *mon, virJSONValue *data) qemuMonitorEmitShutdown(mon, guest_initiated, reason); } -static void qemuMonitorJSONHandleReset(qemuMonitor *mon, virJSONValue *dat= a 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 *da= ta 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 *d= ata) 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 =3D 0; if (virJSONValueObjectGetNumberLong(data, "offset", &offset) < 0) { @@ -697,13 +720,17 @@ static void qemuMonitorJSONHandleRTCChange(qemuMonito= r *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, virJSONVa= lue *data) +static void +qemuMonitorJSONHandleVNCInitialize(qemuMonitor *mon, + virJSONValue *data) { qemuMonitorJSONHandleGraphicsVNC(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_= INITIALIZE); } -static void qemuMonitorJSONHandleVNCDisconnect(qemuMonitor *mon, virJSONVa= lue *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, virJSONVal= ue *data) +static void +qemuMonitorJSONHandleSPICEConnect(qemuMonitor *mon, + virJSONValue *data) { qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHIC= S_CONNECT); } -static void qemuMonitorJSONHandleSPICEInitialize(qemuMonitor *mon, virJSON= Value *data) +static void +qemuMonitorJSONHandleSPICEInitialize(qemuMonitor *mon, + virJSONValue *data) { qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHIC= S_INITIALIZE); } -static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon, virJSON= Value *data) +static void +qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon, + virJSONValue *data) { qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHIC= S_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, virJSONVal= ue *data) +qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMonitor *mon, + virJSONValue *data) { const char *name; @@ -1083,7 +1134,8 @@ qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMon= itor *mon, virJSONValue *da static void -qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemuMonitor *mon, virJSON= Value *data) +qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemuMonitor *mon, + virJSONValue *data) { const char *name; @@ -1097,7 +1149,8 @@ qemuMonitorJSONHandleNetdevVhostUserDisconnected(qemu= Monitor *mon, virJSONValue static void -qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitor *mon, virJSONValue *da= ta) +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, vi= rJSONValue *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 qemuMonitorJSONHandlePRManagerStatusChang= ed(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 =3D qemuMonitorJSONMakeCommand("system_pow= erdown", NULL); g_autoptr(virJSONValue) reply =3D 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 =3D NULL; g_autoptr(virJSONValue) cmd =3D 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 =3D qemuMonitorJSONMakeCommand("system_res= et", NULL); g_autoptr(virJSONValue) reply =3D 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 =3D NULL; @@ -2823,10 +2886,11 @@ qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *m= on) } -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 =3D NULL; g_autoptr(virJSONValue) reply =3D 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 =3D qemuMonitorJSONMakeCommand("set_passwo= rd", "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 =3D qemuMonitorJSONMakeCommand("expire_pas= sword", "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 =3D qemuMonitorJSONMakeCommand(cmdtype, "U:val", offs= et, @@ -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 =3D qemuMonitorJSONMakeCommand("query-migr= ate", NULL); @@ -3251,9 +3321,10 @@ int qemuMonitorJSONGetMigrationStats(qemuMonitor *mo= n, } -int qemuMonitorJSONMigrate(qemuMonitor *mon, - unsigned int flags, - const char *uri) +int +qemuMonitorJSONMigrate(qemuMonitor *mon, + unsigned int flags, + const char *uri) { bool resume =3D !!(flags & QEMU_MONITOR_MIGRATE_RESUME); g_autoptr(virJSONValue) cmd =3D qemuMonitorJSONMakeCommand("migrate", @@ -3318,7 +3389,8 @@ qemuMonitorJSONGetMigrationBlockers(qemuMonitor *mon, } -int qemuMonitorJSONMigrateCancel(qemuMonitor *mon) +int +qemuMonitorJSONMigrateCancel(qemuMonitor *mon) { g_autoptr(virJSONValue) cmd =3D qemuMonitorJSONMakeCommand("migrate_ca= ncel", NULL); g_autoptr(virJSONValue) reply =3D NULL; @@ -3426,6 +3498,7 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonit= or *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 =3D "vnc"; g_autoptr(virJSONValue) cmd =3D NULL; @@ -3577,8 +3652,9 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg, } -int qemuMonitorJSONQueryFdsets(qemuMonitor *mon, - qemuMonitorFdsets **fdsets) +int +qemuMonitorJSONQueryFdsets(qemuMonitor *mon, + qemuMonitorFdsets **fdsets) { g_autoptr(virJSONValue) reply =3D NULL; g_autoptr(virJSONValue) cmd =3D qemuMonitorJSONMakeCommand("query-fdse= ts", @@ -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 =3D NULL; g_autoptr(virJSONValue) cmd =3D 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 =3D qemuMonitorJSONMakeCommand("getfd", "s:fdname", f= dname, @@ -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 =3D qemuMonitorJSONMakeCommand("closefd", "s:fdname", f= dname, @@ -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 =3D qemuMonitorJSONMakeCommand("query-rx-f= ilter", @@ -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 =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; @@ -4126,7 +4207,8 @@ qemuMonitorJSONBlockdevMirror(qemuMonitor *mon, int -qemuMonitorJSONTransaction(qemuMonitor *mon, virJSONValue **actions) +qemuMonitorJSONTransaction(qemuMonitor *mon, + virJSONValue **actions) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D 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 =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; @@ -4210,7 +4294,9 @@ int qemuMonitorJSONArbitraryCommand(qemuMonitor *mon, return 0; } -int qemuMonitorJSONInjectNMI(qemuMonitor *mon) + +int +qemuMonitorJSONInjectNMI(qemuMonitor *mon) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D 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 =3D NULL; g_autoptr(virJSONValue) reply =3D 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 =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; @@ -4375,6 +4465,7 @@ qemuMonitorJSONParseBlockJobInfo(GHashTable *blockJob= s, 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 =3D NULL; g_autoptr(virJSONValue) reply =3D 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 =3D NULL; g_autoptr(virJSONValue) result =3D NULL; @@ -4747,9 +4841,11 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *m= on, return 0; } -int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, - const char *qdevid, - virDomainBlockIoTuneInfo *reply) + +int +qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, + const char *qdevid, + virDomainBlockIoTuneInfo *reply) { g_autoptr(virJSONValue) devices =3D NULL; @@ -4820,7 +4916,8 @@ qemuMonitorJSONUpdateThrottleGroup(qemuMonitor *mon, } -int qemuMonitorJSONSystemWakeup(qemuMonitor *mon) +int +qemuMonitorJSONSystemWakeup(qemuMonitor *mon) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D 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 =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; @@ -4898,8 +4997,9 @@ int qemuMonitorJSONGetVersion(qemuMonitor *mon, } -int qemuMonitorJSONGetMachines(qemuMonitor *mon, - qemuMonitorMachineInfo ***machines) +int +qemuMonitorJSONGetMachines(qemuMonitor *mon, + qemuMonitorMachineInfo ***machines) { int ret =3D -1; g_autoptr(virJSONValue) cmd =3D NULL; @@ -5523,9 +5623,10 @@ qemuMonitorJSONGetCommandLineOptions(qemuMonitor *mo= n) } -int qemuMonitorJSONGetKVMState(qemuMonitor *mon, - bool *enabled, - bool *present) +int +qemuMonitorJSONGetKVMState(qemuMonitor *mon, + bool *enabled, + bool *present) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D 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 =3D -1; g_autoptr(virJSONValue) cmd =3D NULL; @@ -5668,7 +5770,9 @@ int qemuMonitorJSONGetObjectListPaths(qemuMonitor *mo= n, return ret; } -void qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths) + +void +qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths) { if (!paths) return; @@ -5678,10 +5782,11 @@ void qemuMonitorJSONListPathFree(qemuMonitorJSONLis= tPath *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 =3D -1; g_autoptr(virJSONValue) cmd =3D NULL; @@ -5786,10 +5891,11 @@ qemuMonitorJSONGetStringListProperty(qemuMonitor *m= on, "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 =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; @@ -6394,6 +6500,7 @@ qemuMonitorJSONBuildInetSocketAddress(const char *hos= t, 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(virJSONVal= ue *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 *dat= a, 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 =3D NULL; g_autoptr(virJSONValue) cmd =3D NULL; --=20 2.51.0