From nobody Sat Feb 7 15:12:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583331384; cv=none; d=zohomail.com; s=zohoarc; b=TPmHAub84BXPcbmIwJQ0nGHrNPvCCJ0gD6fFlU3NEtjNgma2depEJVpv4NmZ/kaN+uaBhFbpHetrMDcCjX+ERsB30NLwzrEK7GwbE5lApzYPkzmKSwUjn6LWv2aHULd91wknizpNngACPenDqvol72RjXBwF9/93Me8fvg6E9Q4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583331384; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y/e4jytnM4Avs2/OWe3v2apP5ob3qcjrHrYPrh3VRnk=; b=TLwpZd0SRUkaUIzW7HaZdScRkvczET58IhXuLxpnDpG8qvTwyXw6RA4kOORIkE6YBqnaTBkoXE5BMcizulGqLp8Gs4ZqLUlGKWROBgwuAV3lyxGrKEpccuFqwPjx0cLWZIHFlriSK/eetAeiDe2HMngcQG7tcGaqqJTkGVacEuQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1583331384409389.74581625644885; Wed, 4 Mar 2020 06:16:24 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-2qaeM7xDPL-ww0F6buKLVg-1; Wed, 04 Mar 2020 09:16:21 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B85E6800D4E; Wed, 4 Mar 2020 14:16:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D1465C1D4; Wed, 4 Mar 2020 14:16:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2ABC086A06; Wed, 4 Mar 2020 14:16:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 024EGCbP012730 for ; Wed, 4 Mar 2020 09:16:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id C5B8D5DA7D; Wed, 4 Mar 2020 14:16:12 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 245345DA7B for ; Wed, 4 Mar 2020 14:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583331383; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Y/e4jytnM4Avs2/OWe3v2apP5ob3qcjrHrYPrh3VRnk=; b=gs8bMfxTf1xRRdgwLXY0wPCkIQiNCrIlv54hiMPUBEoC+QZv/kv5s+tDxtSvKbI5i/y7jJ v1tHGDZCOljiYfRGvVq3p7LC5+7ug9+Mrf030v3OWEmhp65nazhBE4GHhCTeXNFIXID5xL djg49QWPLLwlcQKteE4i5StKWPqVAtg= X-MC-Unique: 2qaeM7xDPL-ww0F6buKLVg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/3] util: json: Convert virJSONValueNewObject() to g_new0 Date: Wed, 4 Mar 2020 15:16:05 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Make it obvious that the function always returns a valid pointer and fix all callers. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/admin/admin_server_dispatch.c | 3 --- src/locking/lock_daemon.c | 8 +------- src/logging/log_daemon.c | 8 +------- src/logging/log_handler.c | 5 ----- src/qemu/qemu_agent.c | 8 ++------ src/qemu/qemu_command.c | 3 +-- src/qemu/qemu_firmware.c | 20 ++++---------------- src/qemu/qemu_migration_params.c | 8 ++------ src/qemu/qemu_monitor_json.c | 30 +++++++----------------------- src/qemu/qemu_vhost_user.c | 3 +-- src/rpc/virnetdaemon.c | 10 ++-------- src/rpc/virnetserver.c | 5 +---- src/rpc/virnetserverclient.c | 3 --- src/rpc/virnetserverservice.c | 3 --- src/rpc/virnetsocket.c | 3 +-- src/util/virjson.c | 21 ++++----------------- src/util/virlease.c | 6 +----- src/util/virlockspace.c | 6 ------ src/util/virmacmap.c | 5 +---- src/util/virnetdev.c | 3 +-- tests/qemumonitortestutils.c | 8 ++------ 21 files changed, 32 insertions(+), 137 deletions(-) diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dis= patch.c index 7b3bd697f3..b3da577995 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin/admin_server_dispatch.c @@ -119,9 +119,6 @@ virJSONValuePtr remoteAdmClientPreExecRestart(virNetSer= verClientPtr client G_GNU { virJSONValuePtr object =3D virJSONValueNewObject(); - if (!object) - return NULL; - /* No content to add at this time - just need empty object */ return object; diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 5e5a0c1089..245155206a 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -774,9 +774,6 @@ virLockDaemonClientPreExecRestart(virNetServerClientPtr= client G_GNUC_UNUSED, virJSONValuePtr object =3D virJSONValueNewObject(); char uuidstr[VIR_UUID_STRING_BUFLEN]; - if (!object) - return NULL; - if (virJSONValueObjectAppendBoolean(object, "restricted", priv->restri= cted) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Cannot set restricted data in JSON document")); @@ -923,16 +920,13 @@ virLockDaemonPreExecRestart(const char *state_file, virJSONValuePtr child; char *state =3D NULL; int ret =3D -1; - virJSONValuePtr object; + virJSONValuePtr object =3D virJSONValueNewObject(); char *magic; virHashKeyValuePairPtr pairs =3D NULL, tmp; virJSONValuePtr lockspaces; VIR_DEBUG("Running pre-restart exec"); - if (!(object =3D virJSONValueNewObject())) - goto cleanup; - if (!(child =3D virNetDaemonPreExecRestart(dmn))) goto cleanup; diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 772bbb805b..47377deb4f 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -597,9 +597,6 @@ virLogDaemonClientPreExecRestart(virNetServerClientPtr = client G_GNUC_UNUSED, { virJSONValuePtr object =3D virJSONValueNewObject(); - if (!object) - return NULL; - return object; } @@ -718,15 +715,12 @@ virLogDaemonPreExecRestart(const char *state_file, virJSONValuePtr child; char *state =3D NULL; int ret =3D -1; - virJSONValuePtr object; + virJSONValuePtr object =3D virJSONValueNewObject(); char *magic; virHashKeyValuePairPtr pairs =3D NULL; VIR_DEBUG("Running pre-restart exec"); - if (!(object =3D virJSONValueNewObject())) - goto cleanup; - if (!(child =3D virNetDaemonPreExecRestart(dmn))) goto cleanup; diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 576d0d6921..87748d96d1 100644 --- a/src/logging/log_handler.c +++ b/src/logging/log_handler.c @@ -615,9 +615,6 @@ virLogHandlerPreExecRestart(virLogHandlerPtr handler) size_t i; char domuuid[VIR_UUID_STRING_BUFLEN]; - if (!ret) - return NULL; - files =3D virJSONValueNewArray(); if (virJSONValueObjectAppend(ret, "files", files) < 0) { @@ -627,8 +624,6 @@ virLogHandlerPreExecRestart(virLogHandlerPtr handler) for (i =3D 0; i < handler->nfiles; i++) { virJSONValuePtr file =3D virJSONValueNewObject(); - if (!file) - goto error; if (virJSONValueArrayAppend(files, file) < 0) { virJSONValueFree(file); diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 23a775034f..cd25ef6cd3 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -1166,15 +1166,12 @@ static virJSONValuePtr G_GNUC_NULL_TERMINATED qemuAgentMakeCommand(const char *cmdname, ...) { - virJSONValuePtr obj; + virJSONValuePtr obj =3D virJSONValueNewObject(); virJSONValuePtr jargs =3D NULL; va_list args; va_start(args, cmdname); - if (!(obj =3D virJSONValueNewObject())) - goto error; - if (virJSONValueObjectAppendString(obj, "execute", cmdname) < 0) goto error; @@ -1544,8 +1541,7 @@ qemuAgentSetVCPUsCommand(qemuAgentPtr mon, (*nmodified)++; /* create single cpu object */ - if (!(cpu =3D virJSONValueNewObject())) - goto cleanup; + cpu =3D virJSONValueNewObject(); if (virJSONValueObjectAppendNumberInt(cpu, "logical-id", in->id) <= 0) goto cleanup; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9d215e5e06..9e0334a3e7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3442,8 +3442,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, return -1; } - if (!(props =3D virJSONValueNewObject())) - return -1; + props =3D virJSONValueNewObject(); if (def->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_MEMFD) { backendType =3D "memory-backend-memfd"; diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 68e2c6b40f..bd251c05fc 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -672,12 +672,9 @@ qemuFirmwareInterfaceFormat(virJSONValuePtr doc, static virJSONValuePtr qemuFirmwareFlashFileFormat(qemuFirmwareFlashFile flash) { - g_autoptr(virJSONValue) json =3D NULL; + g_autoptr(virJSONValue) json =3D virJSONValueNewObject(); virJSONValuePtr ret; - if (!(json =3D virJSONValueNewObject())) - return NULL; - if (virJSONValueObjectAppendString(json, "filename", flash.filename) < 0) @@ -754,10 +751,7 @@ static int qemuFirmwareMappingFormat(virJSONValuePtr doc, qemuFirmwarePtr fw) { - g_autoptr(virJSONValue) mapping =3D NULL; - - if (!(mapping =3D virJSONValueNewObject())) - return -1; + g_autoptr(virJSONValue) mapping =3D virJSONValueNewObject(); if (virJSONValueObjectAppendString(mapping, "device", @@ -802,13 +796,10 @@ qemuFirmwareTargetFormat(virJSONValuePtr doc, for (i =3D 0; i < fw->ntargets; i++) { qemuFirmwareTargetPtr t =3D fw->targets[i]; - g_autoptr(virJSONValue) target =3D NULL; + g_autoptr(virJSONValue) target =3D virJSONValueNewObject(); g_autoptr(virJSONValue) machines =3D NULL; size_t j; - if (!(target =3D virJSONValueNewObject())) - return -1; - if (virJSONValueObjectAppendString(target, "architecture", virQEMUCapsArchToString(t->arch= itecture)) < 0) @@ -869,14 +860,11 @@ qemuFirmwareFeatureFormat(virJSONValuePtr doc, char * qemuFirmwareFormat(qemuFirmwarePtr fw) { - g_autoptr(virJSONValue) doc =3D NULL; + g_autoptr(virJSONValue) doc =3D virJSONValueNewObject(); if (!fw) return NULL; - if (!(doc =3D virJSONValueNewObject())) - return NULL; - if (qemuFirmwareInterfaceFormat(doc, fw) < 0) return NULL; diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index dd1ad9349b..a92bb2fa2b 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -729,15 +729,12 @@ qemuMigrationParamsFromJSON(virJSONValuePtr params) virJSONValuePtr qemuMigrationParamsToJSON(qemuMigrationParamsPtr migParams) { - virJSONValuePtr params =3D NULL; + virJSONValuePtr params =3D virJSONValueNewObject(); qemuMigrationParamValuePtr pv; const char *name; size_t i; int rc; - if (!(params =3D virJSONValueNewObject())) - return NULL; - for (i =3D 0; i < QEMU_MIGRATION_PARAM_LAST; i++) { name =3D qemuMigrationParamTypeToString(i); pv =3D &migParams->params[i]; @@ -797,8 +794,7 @@ qemuMigrationCapsToJSON(virBitmapPtr caps, ignore_value(virBitmapGetBit(states, bit, &state)); - if (!(cap =3D virJSONValueNewObject())) - goto error; + cap =3D virJSONValueNewObject(); name =3D qemuMigrationCapabilityTypeToString(bit); if (virJSONValueObjectAppendString(cap, "capability", name) < 0) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 451e1afef5..5f0185d10b 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -690,15 +690,12 @@ qemuMonitorJSONParseKeywords(const char *str, static virJSONValuePtr qemuMonitorJSONKeywordStringToJSON(const char *str, const char *firstkeywo= rd) { - virJSONValuePtr ret =3D NULL; + virJSONValuePtr ret =3D virJSONValueNewObject(); char **keywords =3D NULL; char **values =3D NULL; int nkeywords =3D 0; size_t i; - if (!(ret =3D virJSONValueNewObject())) - return NULL; - if (qemuMonitorJSONParseKeywords(str, &keywords, &values, &nkeywords, = 1) < 0) goto error; @@ -3444,12 +3441,9 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, virJSONValuePtr params) { int ret =3D -1; - virJSONValuePtr cmd =3D NULL; + virJSONValuePtr cmd =3D virJSONValueNewObject(); virJSONValuePtr reply =3D NULL; - if (!(cmd =3D virJSONValueNewObject())) - goto cleanup; - if (virJSONValueObjectAppendString(cmd, "execute", "migrate-set-parameters") < 0) goto cleanup; @@ -4823,8 +4817,7 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, } /* create single key object */ - if (!(key =3D virJSONValueNewObject())) - goto cleanup; + key =3D virJSONValueNewObject(); /* Union KeyValue has two types, use the generic one */ if (virJSONValueObjectAppendString(key, "type", "number") < 0) @@ -5817,19 +5810,15 @@ static virJSONValuePtr qemuMonitorJSONMakeCPUModel(virCPUDefPtr cpu, bool migratable) { - virJSONValuePtr model =3D NULL; + virJSONValuePtr model =3D virJSONValueNewObject(); virJSONValuePtr props =3D NULL; size_t i; - if (!(model =3D virJSONValueNewObject())) - goto error; - if (virJSONValueObjectAppendString(model, "name", cpu->model) < 0) goto error; if (cpu->nfeatures || !migratable) { - if (!(props =3D virJSONValueNewObject())) - goto error; + props =3D virJSONValueNewObject(); for (i =3D 0; i < cpu->nfeatures; i++) { char *name =3D cpu->features[i].name; @@ -7382,8 +7371,8 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID, const virDomainChrSourceDef *chr) { virJSONValuePtr ret =3D NULL; - virJSONValuePtr backend =3D NULL; - virJSONValuePtr data =3D NULL; + virJSONValuePtr backend =3D virJSONValueNewObject(); + virJSONValuePtr data =3D virJSONValueNewObject(); virJSONValuePtr addr =3D NULL; const char *backend_type =3D NULL; const char *host; @@ -7391,11 +7380,6 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrI= D, char *tlsalias =3D NULL; bool telnet; - if (!(backend =3D virJSONValueNewObject()) || - !(data =3D virJSONValueNewObject())) { - goto cleanup; - } - switch ((virDomainChrType)chr->type) { case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_VC: diff --git a/src/qemu/qemu_vhost_user.c b/src/qemu/qemu_vhost_user.c index aee18c9670..be7c3dd5b8 100644 --- a/src/qemu/qemu_vhost_user.c +++ b/src/qemu/qemu_vhost_user.c @@ -217,8 +217,7 @@ qemuVhostUserFormat(qemuVhostUserPtr vu) if (!vu) return NULL; - if (!(doc =3D virJSONValueNewObject())) - return NULL; + doc =3D virJSONValueNewObject(); if (virJSONValueObjectAppendString(doc, "type", qemuVhostUserTypeTypeToString(vu->t= ype)) < 0) diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 7f2226b086..bb81a43d43 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -382,18 +382,12 @@ virJSONValuePtr virNetDaemonPreExecRestart(virNetDaemonPtr dmn) { size_t i =3D 0; - virJSONValuePtr object =3D NULL; - virJSONValuePtr srvObj =3D NULL; + virJSONValuePtr object =3D virJSONValueNewObject(); + virJSONValuePtr srvObj =3D virJSONValueNewObject(); virHashKeyValuePairPtr srvArray =3D NULL; virObjectLock(dmn); - if (!(object =3D virJSONValueNewObject())) - goto error; - - if (!(srvObj =3D virJSONValueNewObject())) - goto error; - if (virJSONValueObjectAppend(object, "servers", srvObj) < 0) { virJSONValueFree(srvObj); goto error; diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index c87dade1a8..a5998801de 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -546,16 +546,13 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSO= NValuePtr object, virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv) { - virJSONValuePtr object; + virJSONValuePtr object =3D virJSONValueNewObject(); virJSONValuePtr clients; virJSONValuePtr services; size_t i; virObjectLock(srv); - if (!(object =3D virJSONValueNewObject())) - goto error; - if (virJSONValueObjectAppendNumberUint(object, "min_workers", virThreadPoolGetMinWorkers(srv-= >workers)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 67b3bf9531..4d85ee25d7 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -593,9 +593,6 @@ virJSONValuePtr virNetServerClientPreExecRestart(virNet= ServerClientPtr client) virJSONValuePtr object =3D virJSONValueNewObject(); virJSONValuePtr child; - if (!object) - return NULL; - virObjectLock(client); if (virJSONValueObjectAppendNumberUlong(object, "id", diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c index 0a003e5814..9d5df456a8 100644 --- a/src/rpc/virnetserverservice.c +++ b/src/rpc/virnetserverservice.c @@ -343,9 +343,6 @@ virJSONValuePtr virNetServerServicePreExecRestart(virNe= tServerServicePtr svc) virJSONValuePtr socks; size_t i; - if (!object) - return NULL; - if (virJSONValueObjectAppendNumberInt(object, "auth", svc->auth) < 0) goto error; if (virJSONValueObjectAppendBoolean(object, "readonly", svc->readonly)= < 0) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index a217404fa6..360711acb6 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -1283,8 +1283,7 @@ virJSONValuePtr virNetSocketPreExecRestart(virNetSock= etPtr sock) goto error; } - if (!(object =3D virJSONValueNewObject())) - goto error; + object =3D virJSONValueNewObject(); if (virJSONValueObjectAppendNumberInt(object, "fd", sock->fd) < 0) goto error; diff --git a/src/util/virjson.c b/src/util/virjson.c index ca57df816f..2d7368b0b6 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -362,8 +362,7 @@ virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, { int ret; - if (!(*obj =3D virJSONValueNewObject())) - return -1; + *obj =3D virJSONValueNewObject(); /* free the object on error, or if no value objects were added */ if ((ret =3D virJSONValueObjectAddVArgs(*obj, args)) <=3D 0) { @@ -572,10 +571,7 @@ virJSONValueNewArray(void) virJSONValuePtr virJSONValueNewObject(void) { - virJSONValuePtr val; - - if (VIR_ALLOC(val) < 0) - return NULL; + virJSONValuePtr val =3D g_new0(virJSONValue, 1); val->type =3D VIR_JSON_TYPE_OBJECT; @@ -1503,8 +1499,6 @@ virJSONValueCopy(const virJSONValue *in) switch ((virJSONType) in->type) { case VIR_JSON_TYPE_OBJECT: out =3D virJSONValueNewObject(); - if (!out) - return NULL; for (i =3D 0; i < in->data.object.npairs; i++) { virJSONValuePtr val =3D NULL; if (!(val =3D virJSONValueCopy(in->data.object.pairs[i].value)= )) @@ -1724,9 +1718,6 @@ virJSONParserHandleStartMap(void *ctx) VIR_DEBUG("parser=3D%p", parser); - if (!value) - return 0; - if (virJSONParserInsertValue(parser, value) < 0) { virJSONValueFree(value); return 0; @@ -2103,8 +2094,7 @@ virJSONValueObjectDeflattenWorker(const char *key, } if (!(existobj =3D virJSONValueObjectGet(retobj, tokens[0]))) { - if (!(existobj =3D virJSONValueNewObject())) - goto cleanup; + existobj =3D virJSONValueNewObject(); if (virJSONValueObjectAppend(retobj, tokens[0], existobj) < 0) goto cleanup; @@ -2143,10 +2133,7 @@ virJSONValueObjectDeflattenWorker(const char *key, virJSONValuePtr virJSONValueObjectDeflatten(virJSONValuePtr json) { - g_autoptr(virJSONValue) deflattened =3D NULL; - - if (!(deflattened =3D virJSONValueNewObject())) - return NULL; + g_autoptr(virJSONValue) deflattened =3D virJSONValueNewObject(); if (virJSONValueObjectForeachKeyValue(json, virJSONValueObjectDeflattenWorke= r, diff --git a/src/util/virlease.c b/src/util/virlease.c index e0f81539be..1cb9540d80 100644 --- a/src/util/virlease.c +++ b/src/util/virlease.c @@ -238,11 +238,7 @@ virLeaseNew(virJSONValuePtr *lease_ret, } /* Create new lease */ - if (!(lease_new =3D virJSONValueNewObject())) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to create json")); - return -1; - } + lease_new =3D virJSONValueNewObject(); if (iaid && virJSONValueObjectAppendString(lease_new, "iaid", iaid) < = 0) return -1; diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c index a44377f89e..05517f8b40 100644 --- a/src/util/virlockspace.c +++ b/src/util/virlockspace.c @@ -434,9 +434,6 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpace= Ptr lockspace) virJSONValuePtr resources; virHashKeyValuePairPtr pairs =3D NULL, tmp; - if (!object) - return NULL; - virMutexLock(&lockspace->lock); if (lockspace->dir && @@ -457,9 +454,6 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpace= Ptr lockspace) virJSONValuePtr owners =3D NULL; size_t i; - if (!child) - goto error; - if (virJSONValueArrayAppend(resources, child) < 0) { virJSONValueFree(child); goto error; diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c index ec589334ea..0c0ba90def 100644 --- a/src/util/virmacmap.c +++ b/src/util/virmacmap.c @@ -200,15 +200,12 @@ virMACMapHashDumper(void *payload, const void *name, void *data) { - virJSONValuePtr obj =3D NULL; + virJSONValuePtr obj =3D virJSONValueNewObject(); virJSONValuePtr arr =3D NULL; const char **macs =3D payload; size_t i; int ret =3D -1; - if (!(obj =3D virJSONValueNewObject())) - goto cleanup; - arr =3D virJSONValueNewArray(); for (i =3D 0; macs[i]; i++) { diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 094d1ac09b..b465bdac2e 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1874,8 +1874,7 @@ virNetDevSaveNetConfig(const char *linkdev, int vf, } } - if (!(configJSON =3D virJSONValueNewObject())) - goto cleanup; + configJSON =3D virJSONValueNewObject(); /* if there is a PF, it's now in pfDevName, and linkdev is either * the VF's name, or NULL (if the VF isn't bound to a net driver diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index b29e5d8cd2..00f5b49439 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -529,12 +529,8 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonit= orTestPtr test, return -1; } - if (!args) { - if (!(emptyargs =3D virJSONValueNewObject())) - return -1; - - args =3D emptyargs; - } + if (!args) + args =3D emptyargs =3D virJSONValueNewObject(); if (testQEMUSchemaValidate(args, schemaroot, test->qapischema, &debug)= < 0) { if (qemuMonitorReportError(test, --=20 2.24.1 From nobody Sat Feb 7 15:12:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583331384; cv=none; d=zohomail.com; s=zohoarc; b=aVt9xeTusXUvk608fX78PsgX5TKljXGUYQGNt2zcsILWCfI5GillBUOyEUzgL6R50TuOngetd/QnkyGjJht2BXmr2hbG1wVe0YVZaqESeeyDEs6aoFPo8phiaccUdJkHSy6zOBjC8AVvZd45KE0WGxTvWjX7ugIOK7iD7Y306lY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583331384; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5LxeS+oLAeozSy40Frzwdg9xeuJKCnwqQHMsf9SElbY=; b=LVGp//0ESYqR2zO/p4R0WiitIgPooA5/b8Fr4o4PXKw0NV4nUOzj0tR8NQ+dxSOQlPvOeoi+MHQSc87KugT1baWVbFjwVcRj5SGKc+yLm4u1YlE1aAhgui12hYo7z/kSFtSL59gzSZsdiabfIQ3Nne0zNEgTxBEvQwPBvP+Bklk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1583331384157705.4092213558414; Wed, 4 Mar 2020 06:16:24 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-351-Fx0_B9RBM8GmkjEIfL9itw-1; Wed, 04 Mar 2020 09:16:21 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CE80DB61; Wed, 4 Mar 2020 14:16:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED37427186; Wed, 4 Mar 2020 14:16:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 914D986A0A; Wed, 4 Mar 2020 14:16:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 024EGDof012738 for ; Wed, 4 Mar 2020 09:16:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 99A1A5DA7D; Wed, 4 Mar 2020 14:16:13 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 202195DA7B for ; Wed, 4 Mar 2020 14:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583331383; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5LxeS+oLAeozSy40Frzwdg9xeuJKCnwqQHMsf9SElbY=; b=dE19J7E2jMdCtg8mzmEA8mEHlFmNrUX36H6wFSevFeYFu00zyoDwZDaFB9Y5CaWLttAAdZ uhmOs9Bx82lwnGPnzxfTCMqX/2R0dK4msp1Z9JBXUBVetPXfk5rj2old/oyjMb1/wcEwxp 9aA1ZIrChtun6/u9cR48kQ6qn18+jbs= X-MC-Unique: Fx0_B9RBM8GmkjEIfL9itw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/3] qemuMonitorJSONSetMigrationParams: Refactor command construction and cleanup Date: Wed, 4 Mar 2020 15:16:06 +0100 Message-Id: <10ef2ec7de352fd332ae7dd8099a6ceb807ca96f.1583331259.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" qemuMonitorJSONMakeCommandInternal does the full command construction if you pass in what would become the value of the 'arguments' key. Refactor the open-coded implementation to use the helper and use modern cleanup helpers at the same time. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_monitor_json.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 5f0185d10b..3eac80c060 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3440,30 +3440,19 @@ int qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, virJSONValuePtr params) { - int ret =3D -1; - virJSONValuePtr cmd =3D virJSONValueNewObject(); - virJSONValuePtr reply =3D NULL; - - if (virJSONValueObjectAppendString(cmd, "execute", - "migrate-set-parameters") < 0) - goto cleanup; + g_autoptr(virJSONValue) cmd =3D NULL; + g_autoptr(virJSONValue) reply =3D NULL; - if (virJSONValueObjectAppend(cmd, "arguments", params) < 0) - goto cleanup; - params =3D NULL; + if (!(cmd =3D qemuMonitorJSONMakeCommandInternal("migrate-set-paramete= rs", params))) + return -1; if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; + return -1; if (qemuMonitorJSONCheckError(cmd, reply) < 0) - goto cleanup; + return -1; - ret =3D 0; - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(params); - virJSONValueFree(reply); - return ret; + return 0; } --=20 2.24.1 From nobody Sat Feb 7 15:12:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583331390; cv=none; d=zohomail.com; s=zohoarc; b=aBIXbbMEpSJC0CyBLTkYVfDJ2ldqEm/XnMZ1nqFmM4OBu+DONr22b1bMqSnsrnB9aKG3jnvVBdgH8OiBvBatfcvfxamy1HX1LO7x/yGqdzRyrI6Asfdxw8x70KBcUzvK43dP0alUR7wc6SOb3suqzb7K9Czpo5E+KORILOxmypw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583331390; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7lDSTObmhUHLIu1snSixb4bda60/R/goIk5EWB2pqhU=; b=Ugt1uiohrccvCXxd34cNlR2gyJzRbnLB2NBaSc5zHGgoutWGvfj01gEO+y62+z4CVNWYKRNAM1h/1rFmZuQyHnLawq2GoBkxX5wJca48N/oFYmjAF8WTOmb4wxTGXQ9nmhq0FCobUWIbsCw8ZlTMoGW6c5RJRrE2wu2gqWPugi0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1583331390697799.3834502647786; Wed, 4 Mar 2020 06:16:30 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-eWXTbvFqOOC8euUeZOKa6Q-1; Wed, 04 Mar 2020 09:16:25 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 191EE1084450; Wed, 4 Mar 2020 14:16:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D363210013A1; Wed, 4 Mar 2020 14:16:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D5A886A0D; Wed, 4 Mar 2020 14:16:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 024EGEEN012755 for ; Wed, 4 Mar 2020 09:16:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 95BAF5DA81; Wed, 4 Mar 2020 14:16:14 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id E93A15DA7B for ; Wed, 4 Mar 2020 14:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583331389; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7lDSTObmhUHLIu1snSixb4bda60/R/goIk5EWB2pqhU=; b=I9YZ71mYz1xgZrrcLbvVUX0v6ajWI0mMppaBYAzTymrckAsRGobSQGb4XXAfg46TZZNTFF M84YLF7IE/v2as7hjq08jyR/6rjaZvbocELSXuWkBHZM3RZKKBg5XzemVlT6AfoeUZyg3+ GWQx86rcsuivxIf6NxM+Hh4zqwr0PtI= X-MC-Unique: eWXTbvFqOOC8euUeZOKa6Q-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/3] qemuhotplugtestcpus: Always use 'query-cpus-fast' Date: Wed, 4 Mar 2020 15:16:07 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Use the new command in the test suite by asserting the capability and adjusting test data to the correct field names as they changed compared to 'query-cpus'. Signed-off-by: Peter Krempa Reviewed-by: Daniel Henrique Barboza --- tests/qemuhotplugtest.c | 2 + .../ppc64-modern-bulk-monitor.json | 390 +++++++++--------- .../ppc64-modern-individual-monitor.json | 196 ++++----- .../x86-modern-bulk-monitor.json | 150 +++---- .../x86-modern-individual-add-monitor.json | 92 ++--- .../x86-old-bulk-monitor.json | 150 +++---- 6 files changed, 491 insertions(+), 489 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9dd42664cd..e008c1bf0d 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -437,6 +437,8 @@ testQemuHotplugCpuPrepare(const char *test, priv =3D data->vm->privateData; + virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_CPUS_FAST); + if (data->modern) virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-monitor.json b/tes= ts/qemuhotplugtestcpus/ppc64-modern-bulk-monitor.json index c139426b7b..068b45e3c0 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-monitor.json +++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-monitor.json @@ -35,81 +35,81 @@ "id": "libvirt-15" } -{"execute":"query-cpus","id":"libvirt-2"} +{"execute":"query-cpus-fast","id":"libvirt-2"} { "return": [ { - "arch": "ppc", + "target": "ppc", "current": true, - "CPU": 0, + "cpu-index": 0, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", + "qom-path": "/machine/unattached/device[1]/thread[0]", "halted": false, - "thread_id": 21925 + "thread-id": 21925 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 1, + "cpu-index": 1, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[1]", + "qom-path": "/machine/unattached/device[1]/thread[1]", "halted": false, - "thread_id": 21926 + "thread-id": 21926 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 2, + "cpu-index": 2, "nip": -4611686018422360608, - "qom_path": "/machine/unattached/device[1]/thread[2]", + "qom-path": "/machine/unattached/device[1]/thread[2]", "halted": false, - "thread_id": 21927 + "thread-id": 21927 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 3, + "cpu-index": 3, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[3]", + "qom-path": "/machine/unattached/device[1]/thread[3]", "halted": false, - "thread_id": 21928 + "thread-id": 21928 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 4, + "cpu-index": 4, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[4]", + "qom-path": "/machine/unattached/device[1]/thread[4]", "halted": false, - "thread_id": 21930 + "thread-id": 21930 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 5, + "cpu-index": 5, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[5]", + "qom-path": "/machine/unattached/device[1]/thread[5]", "halted": false, - "thread_id": 21931 + "thread-id": 21931 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 6, + "cpu-index": 6, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[6]", + "qom-path": "/machine/unattached/device[1]/thread[6]", "halted": false, - "thread_id": 21932 + "thread-id": 21932 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 7, + "cpu-index": 7, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[7]", + "qom-path": "/machine/unattached/device[1]/thread[7]", "halted": false, - "thread_id": 21933 + "thread-id": 21933 } ], "id": "libvirt-12" @@ -165,153 +165,153 @@ "id": "libvirt-15" } -{"execute":"query-cpus","id":"libvirt-5"} +{"execute":"query-cpus-fast","id":"libvirt-5"} { "return": [ { - "arch": "ppc", + "target": "ppc", "current": true, - "CPU": 0, + "cpu-index": 0, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", + "qom-path": "/machine/unattached/device[1]/thread[0]", "halted": false, - "thread_id": 21925 + "thread-id": 21925 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 1, + "cpu-index": 1, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[1]", + "qom-path": "/machine/unattached/device[1]/thread[1]", "halted": false, - "thread_id": 21926 + "thread-id": 21926 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 2, + "cpu-index": 2, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[2]", + "qom-path": "/machine/unattached/device[1]/thread[2]", "halted": false, - "thread_id": 21927 + "thread-id": 21927 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 3, + "cpu-index": 3, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[3]", + "qom-path": "/machine/unattached/device[1]/thread[3]", "halted": false, - "thread_id": 21928 + "thread-id": 21928 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 4, + "cpu-index": 4, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[4]", + "qom-path": "/machine/unattached/device[1]/thread[4]", "halted": false, - "thread_id": 21930 + "thread-id": 21930 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 5, + "cpu-index": 5, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[5]", + "qom-path": "/machine/unattached/device[1]/thread[5]", "halted": false, - "thread_id": 21931 + "thread-id": 21931 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 6, + "cpu-index": 6, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[6]", + "qom-path": "/machine/unattached/device[1]/thread[6]", "halted": false, - "thread_id": 21932 + "thread-id": 21932 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 7, + "cpu-index": 7, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[7]", + "qom-path": "/machine/unattached/device[1]/thread[7]", "halted": false, - "thread_id": 21933 + "thread-id": 21933 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 8, + "cpu-index": 8, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[0]", + "qom-path": "/machine/peripheral/vcpu1/thread[0]", "halted": false, - "thread_id": 22131 + "thread-id": 22131 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 9, + "cpu-index": 9, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[1]", + "qom-path": "/machine/peripheral/vcpu1/thread[1]", "halted": false, - "thread_id": 22132 + "thread-id": 22132 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 10, + "cpu-index": 10, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[2]", + "qom-path": "/machine/peripheral/vcpu1/thread[2]", "halted": false, - "thread_id": 22133 + "thread-id": 22133 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 11, + "cpu-index": 11, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[3]", + "qom-path": "/machine/peripheral/vcpu1/thread[3]", "halted": false, - "thread_id": 22134 + "thread-id": 22134 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 12, + "cpu-index": 12, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[4]", + "qom-path": "/machine/peripheral/vcpu1/thread[4]", "halted": false, - "thread_id": 22135 + "thread-id": 22135 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 13, + "cpu-index": 13, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[5]", + "qom-path": "/machine/peripheral/vcpu1/thread[5]", "halted": false, - "thread_id": 22136 + "thread-id": 22136 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 14, + "cpu-index": 14, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[6]", + "qom-path": "/machine/peripheral/vcpu1/thread[6]", "halted": false, - "thread_id": 22137 + "thread-id": 22137 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 15, + "cpu-index": 15, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[7]", + "qom-path": "/machine/peripheral/vcpu1/thread[7]", "halted": false, - "thread_id": 22138 + "thread-id": 22138 } ], "id": "libvirt-14" @@ -368,225 +368,225 @@ "id": "libvirt-15" } -{"execute":"query-cpus","id":"libvirt-8"} +{"execute":"query-cpus-fast","id":"libvirt-8"} { "return": [ { - "arch": "ppc", + "target": "ppc", "current": true, - "CPU": 0, + "cpu-index": 0, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", + "qom-path": "/machine/unattached/device[1]/thread[0]", "halted": false, - "thread_id": 21925 + "thread-id": 21925 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 1, + "cpu-index": 1, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[1]", + "qom-path": "/machine/unattached/device[1]/thread[1]", "halted": false, - "thread_id": 21926 + "thread-id": 21926 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 2, + "cpu-index": 2, "nip": -4611686018422360576, - "qom_path": "/machine/unattached/device[1]/thread[2]", + "qom-path": "/machine/unattached/device[1]/thread[2]", "halted": false, - "thread_id": 21927 + "thread-id": 21927 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 3, + "cpu-index": 3, "nip": -4611686018422360596, - "qom_path": "/machine/unattached/device[1]/thread[3]", + "qom-path": "/machine/unattached/device[1]/thread[3]", "halted": false, - "thread_id": 21928 + "thread-id": 21928 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 4, + "cpu-index": 4, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[4]", + "qom-path": "/machine/unattached/device[1]/thread[4]", "halted": false, - "thread_id": 21930 + "thread-id": 21930 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 5, + "cpu-index": 5, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[5]", + "qom-path": "/machine/unattached/device[1]/thread[5]", "halted": false, - "thread_id": 21931 + "thread-id": 21931 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 6, + "cpu-index": 6, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[6]", + "qom-path": "/machine/unattached/device[1]/thread[6]", "halted": false, - "thread_id": 21932 + "thread-id": 21932 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 7, + "cpu-index": 7, "nip": -4611686018422360596, - "qom_path": "/machine/unattached/device[1]/thread[7]", + "qom-path": "/machine/unattached/device[1]/thread[7]", "halted": false, - "thread_id": 21933 + "thread-id": 21933 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 8, + "cpu-index": 8, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[0]", + "qom-path": "/machine/peripheral/vcpu1/thread[0]", "halted": false, - "thread_id": 22131 + "thread-id": 22131 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 9, + "cpu-index": 9, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[1]", + "qom-path": "/machine/peripheral/vcpu1/thread[1]", "halted": false, - "thread_id": 22132 + "thread-id": 22132 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 10, + "cpu-index": 10, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[2]", + "qom-path": "/machine/peripheral/vcpu1/thread[2]", "halted": false, - "thread_id": 22133 + "thread-id": 22133 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 11, + "cpu-index": 11, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[3]", + "qom-path": "/machine/peripheral/vcpu1/thread[3]", "halted": false, - "thread_id": 22134 + "thread-id": 22134 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 12, + "cpu-index": 12, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[4]", + "qom-path": "/machine/peripheral/vcpu1/thread[4]", "halted": false, - "thread_id": 22135 + "thread-id": 22135 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 13, + "cpu-index": 13, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[5]", + "qom-path": "/machine/peripheral/vcpu1/thread[5]", "halted": false, - "thread_id": 22136 + "thread-id": 22136 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 14, + "cpu-index": 14, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[6]", + "qom-path": "/machine/peripheral/vcpu1/thread[6]", "halted": false, - "thread_id": 22137 + "thread-id": 22137 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 15, + "cpu-index": 15, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu1/thread[7]", + "qom-path": "/machine/peripheral/vcpu1/thread[7]", "halted": false, - "thread_id": 22138 + "thread-id": 22138 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 16, + "cpu-index": 16, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[0]", + "qom-path": "/machine/peripheral/vcpu2/thread[0]", "halted": false, - "thread_id": 22223 + "thread-id": 22223 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 17, + "cpu-index": 17, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[1]", + "qom-path": "/machine/peripheral/vcpu2/thread[1]", "halted": false, - "thread_id": 22224 + "thread-id": 22224 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 18, + "cpu-index": 18, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[2]", + "qom-path": "/machine/peripheral/vcpu2/thread[2]", "halted": false, - "thread_id": 22225 + "thread-id": 22225 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 19, + "cpu-index": 19, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[3]", + "qom-path": "/machine/peripheral/vcpu2/thread[3]", "halted": false, - "thread_id": 22226 + "thread-id": 22226 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 20, + "cpu-index": 20, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[4]", + "qom-path": "/machine/peripheral/vcpu2/thread[4]", "halted": false, - "thread_id": 22227 + "thread-id": 22227 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 21, + "cpu-index": 21, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[5]", + "qom-path": "/machine/peripheral/vcpu2/thread[5]", "halted": false, - "thread_id": 22228 + "thread-id": 22228 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 22, + "cpu-index": 22, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[6]", + "qom-path": "/machine/peripheral/vcpu2/thread[6]", "halted": false, - "thread_id": 22229 + "thread-id": 22229 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 23, + "cpu-index": 23, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu2/thread[7]", + "qom-path": "/machine/peripheral/vcpu2/thread[7]", "halted": false, - "thread_id": 22230 + "thread-id": 22230 } ], "id": "libvirt-17" diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-individual-monitor.json= b/tests/qemuhotplugtestcpus/ppc64-modern-individual-monitor.json index ad5cc984a8..b90c4acb73 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-individual-monitor.json +++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-monitor.json @@ -35,81 +35,81 @@ "id": "libvirt-15" } -{"execute":"query-cpus","id":"libvirt-2"} +{"execute":"query-cpus-fast","id":"libvirt-2"} { "return": [ { - "arch": "ppc", + "target": "ppc", "current": true, - "CPU": 0, + "cpu-index": 0, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", + "qom-path": "/machine/unattached/device[1]/thread[0]", "halted": false, - "thread_id": 21925 + "thread-id": 21925 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 1, + "cpu-index": 1, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[1]", + "qom-path": "/machine/unattached/device[1]/thread[1]", "halted": false, - "thread_id": 21926 + "thread-id": 21926 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 2, + "cpu-index": 2, "nip": -4611686018422360608, - "qom_path": "/machine/unattached/device[1]/thread[2]", + "qom-path": "/machine/unattached/device[1]/thread[2]", "halted": false, - "thread_id": 21927 + "thread-id": 21927 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 3, + "cpu-index": 3, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[3]", + "qom-path": "/machine/unattached/device[1]/thread[3]", "halted": false, - "thread_id": 21928 + "thread-id": 21928 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 4, + "cpu-index": 4, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[4]", + "qom-path": "/machine/unattached/device[1]/thread[4]", "halted": false, - "thread_id": 21930 + "thread-id": 21930 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 5, + "cpu-index": 5, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[5]", + "qom-path": "/machine/unattached/device[1]/thread[5]", "halted": false, - "thread_id": 21931 + "thread-id": 21931 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 6, + "cpu-index": 6, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[6]", + "qom-path": "/machine/unattached/device[1]/thread[6]", "halted": false, - "thread_id": 21932 + "thread-id": 21932 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 7, + "cpu-index": 7, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[7]", + "qom-path": "/machine/unattached/device[1]/thread[7]", "halted": false, - "thread_id": 21933 + "thread-id": 21933 } ], "id": "libvirt-12" @@ -165,153 +165,153 @@ "id": "libvirt-15" } -{"execute":"query-cpus","id":"libvirt-5"} +{"execute":"query-cpus-fast","id":"libvirt-5"} { "return": [ { - "arch": "ppc", + "target": "ppc", "current": true, - "CPU": 0, + "cpu-index": 0, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[0]", + "qom-path": "/machine/unattached/device[1]/thread[0]", "halted": false, - "thread_id": 21925 + "thread-id": 21925 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 1, + "cpu-index": 1, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[1]", + "qom-path": "/machine/unattached/device[1]/thread[1]", "halted": false, - "thread_id": 21926 + "thread-id": 21926 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 2, + "cpu-index": 2, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[2]", + "qom-path": "/machine/unattached/device[1]/thread[2]", "halted": false, - "thread_id": 21927 + "thread-id": 21927 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 3, + "cpu-index": 3, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[3]", + "qom-path": "/machine/unattached/device[1]/thread[3]", "halted": false, - "thread_id": 21928 + "thread-id": 21928 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 4, + "cpu-index": 4, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[4]", + "qom-path": "/machine/unattached/device[1]/thread[4]", "halted": false, - "thread_id": 21930 + "thread-id": 21930 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 5, + "cpu-index": 5, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[5]", + "qom-path": "/machine/unattached/device[1]/thread[5]", "halted": false, - "thread_id": 21931 + "thread-id": 21931 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 6, + "cpu-index": 6, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[6]", + "qom-path": "/machine/unattached/device[1]/thread[6]", "halted": false, - "thread_id": 21932 + "thread-id": 21932 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 7, + "cpu-index": 7, "nip": -4611686018426772172, - "qom_path": "/machine/unattached/device[1]/thread[7]", + "qom-path": "/machine/unattached/device[1]/thread[7]", "halted": false, - "thread_id": 21933 + "thread-id": 21933 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 8, + "cpu-index": 8, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[0]", + "qom-path": "/machine/peripheral/vcpu16/thread[0]", "halted": false, - "thread_id": 22131 + "thread-id": 22131 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 9, + "cpu-index": 9, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[1]", + "qom-path": "/machine/peripheral/vcpu16/thread[1]", "halted": false, - "thread_id": 22132 + "thread-id": 22132 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 10, + "cpu-index": 10, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[2]", + "qom-path": "/machine/peripheral/vcpu16/thread[2]", "halted": false, - "thread_id": 22133 + "thread-id": 22133 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 11, + "cpu-index": 11, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[3]", + "qom-path": "/machine/peripheral/vcpu16/thread[3]", "halted": false, - "thread_id": 22134 + "thread-id": 22134 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 12, + "cpu-index": 12, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[4]", + "qom-path": "/machine/peripheral/vcpu16/thread[4]", "halted": false, - "thread_id": 22135 + "thread-id": 22135 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 13, + "cpu-index": 13, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[5]", + "qom-path": "/machine/peripheral/vcpu16/thread[5]", "halted": false, - "thread_id": 22136 + "thread-id": 22136 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 14, + "cpu-index": 14, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[6]", + "qom-path": "/machine/peripheral/vcpu16/thread[6]", "halted": false, - "thread_id": 22137 + "thread-id": 22137 }, { - "arch": "ppc", + "target": "ppc", "current": false, - "CPU": 15, + "cpu-index": 15, "nip": -4611686018426772172, - "qom_path": "/machine/peripheral/vcpu16/thread[7]", + "qom-path": "/machine/peripheral/vcpu16/thread[7]", "halted": false, - "thread_id": 22138 + "thread-id": 22138 } ], "id": "libvirt-14" diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json b/tests= /qemuhotplugtestcpus/x86-modern-bulk-monitor.json index b1d02b8d43..a412ccaf6e 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json +++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json @@ -83,54 +83,54 @@ "id": "libvirt-23" } -{"execute":"query-cpus","id":"libvirt-2"} +{"execute":"query-cpus-fast","id":"libvirt-2"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 } ], "id": "libvirt-22" @@ -236,63 +236,63 @@ "id": "libvirt-23" } -{"execute":"query-cpus","id":"libvirt-5"} +{"execute":"query-cpus-fast","id":"libvirt-5"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 5, - "qom_path": "/machine/peripheral/vcpu5", + "cpu-index": 5, + "qom-path": "/machine/peripheral/vcpu5", "pc": -2130415978, "halted": true, - "thread_id": 518297 + "thread-id": 518297 } ], "id": "libvirt-22" @@ -399,72 +399,72 @@ "id": "libvirt-23" } -{"execute":"query-cpus","id":"libvirt-8"} +{"execute":"query-cpus-fast","id":"libvirt-8"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 5, - "qom_path": "/machine/peripheral/vcpu5", + "cpu-index": 5, + "qom-path": "/machine/peripheral/vcpu5", "pc": -2130415978, "halted": true, - "thread_id": 518297 + "thread-id": 518297 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 6, - "qom_path": "/machine/peripheral/vcpu6", + "cpu-index": 6, + "qom-path": "/machine/peripheral/vcpu6", "pc": -2130415978, "halted": true, - "thread_id": 518298 + "thread-id": 518298 } ], "id": "libvirt-22" diff --git a/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.js= on b/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.json index df05e5e3a9..0acf2d0cd9 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.json +++ b/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.json @@ -83,54 +83,54 @@ "id": "libvirt-23" } -{"execute":"query-cpus","id":"libvirt-2"} +{"execute":"query-cpus-fast","id":"libvirt-2"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 } ], "id": "libvirt-22" @@ -236,63 +236,63 @@ "id": "libvirt-23" } -{"execute":"query-cpus","id":"libvirt-5"} +{"execute":"query-cpus-fast","id":"libvirt-5"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 5, - "qom_path": "/machine/peripheral/vcpu7", + "cpu-index": 5, + "qom-path": "/machine/peripheral/vcpu7", "pc": -2130415978, "halted": true, - "thread_id": 518297 + "thread-id": 518297 } ], "id": "libvirt-22" diff --git a/tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json b/tests/qe= muhotplugtestcpus/x86-old-bulk-monitor.json index 6caf8cc184..626c0a5699 100644 --- a/tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json +++ b/tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json @@ -1,51 +1,51 @@ -{"execute":"query-cpus","id":"libvirt-1"} +{"execute":"query-cpus-fast","id":"libvirt-1"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 } ], "id": "libvirt-22" @@ -55,63 +55,63 @@ {"return": {}} -{"execute":"query-cpus","id":"libvirt-3"} +{"execute":"query-cpus-fast","id":"libvirt-3"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 5, - "qom_path": "/machine/peripheral/vcpu5", + "cpu-index": 5, + "qom-path": "/machine/peripheral/vcpu5", "pc": -2130415978, "halted": true, - "thread_id": 518297 + "thread-id": 518297 } ], "id": "libvirt-22" @@ -121,72 +121,72 @@ {"return": {}} -{"execute":"query-cpus","id":"libvirt-5"} +{"execute":"query-cpus-fast","id":"libvirt-5"} { "return": [ { - "arch": "x86", + "target": "x86", "current": true, - "CPU": 0, - "qom_path": "/machine/unattached/device[0]", + "cpu-index": 0, + "qom-path": "/machine/unattached/device[0]", "pc": -2130415978, "halted": true, - "thread_id": 518291 + "thread-id": 518291 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 1, - "qom_path": "/machine/unattached/device[2]", + "cpu-index": 1, + "qom-path": "/machine/unattached/device[2]", "pc": -2130415978, "halted": true, - "thread_id": 518292 + "thread-id": 518292 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 2, - "qom_path": "/machine/unattached/device[3]", + "cpu-index": 2, + "qom-path": "/machine/unattached/device[3]", "pc": -2130415978, "halted": true, - "thread_id": 518294 + "thread-id": 518294 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 3, - "qom_path": "/machine/unattached/device[4]", + "cpu-index": 3, + "qom-path": "/machine/unattached/device[4]", "pc": -2130415978, "halted": true, - "thread_id": 518295 + "thread-id": 518295 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 4, - "qom_path": "/machine/unattached/device[5]", + "cpu-index": 4, + "qom-path": "/machine/unattached/device[5]", "pc": -2130415978, "halted": true, - "thread_id": 518296 + "thread-id": 518296 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 5, - "qom_path": "/machine/peripheral/vcpu5", + "cpu-index": 5, + "qom-path": "/machine/peripheral/vcpu5", "pc": -2130415978, "halted": true, - "thread_id": 518297 + "thread-id": 518297 }, { - "arch": "x86", + "target": "x86", "current": false, - "CPU": 6, - "qom_path": "/machine/peripheral/vcpu6", + "cpu-index": 6, + "qom-path": "/machine/peripheral/vcpu6", "pc": -2130415978, "halted": true, - "thread_id": 518298 + "thread-id": 518298 } ], "id": "libvirt-22" --=20 2.24.1