From nobody Mon Feb 9 05:14:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1567086335; cv=none; d=zoho.com; s=zohoarc; b=CRkY0i7qsOpDy0Pji9ZUFlvL7FTJm5dQFouwEMImILlyib/nuA/yuRt4LrM4Gha5VCRgbYqe0Y0RSUZ1milZcqC77u20/DNcbi1fY1qw+dTbODkLubO5XI23DichuhSjVSxjeliWTDa3mEnPmHhu3rPzGvAyho/D6oi2U4th6d8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567086335; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=0whZYs3u+AaIHq8eSDMqMH4euZGZIyMIBv0BxcxiQ7Q=; b=ddt9HCBAcA0WLj0aP0zUi04Pzl7FRpXjlP6pUy6QIybpe/dbN3xwmLVRJiXi0aHKGD1XCnz+vGhggr6Kgu1BdQOADQ4BU7v2HvqDPJ5AuznGzBccn934SeLpPBD4qfwEsc1aAdA4bv90pNbkZdqblmv4SyEe26LHdRsfN0tjNCo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567086335904533.0444875740853; Thu, 29 Aug 2019 06:45:35 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id EB2CD87521C; Thu, 29 Aug 2019 13:45:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98EDE19C4F; Thu, 29 Aug 2019 13:45:33 +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 5A153180B536; Thu, 29 Aug 2019 13:45:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7TDjT2G011512 for ; Thu, 29 Aug 2019 09:45:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 60EF6608C1; Thu, 29 Aug 2019 13:45:29 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8ABF5F7DE; Thu, 29 Aug 2019 13:45:28 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 29 Aug 2019 15:45:17 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/2] qemu: command: Use all vCPU properties when creating args for vCPU hotplug 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Thu, 29 Aug 2019 13:45:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" As qemu documents we should use everything in the 'props' sub-object of the data returned by query-hotpluggable-cpus. Until now we only used everything we recognized, but that may break in cases when qemu introduces new fields. This change requires a fix to the test data as some fields were reordered. https://bugzilla.redhat.com/show_bug.cgi?id=3D1741658 Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 19 +++---------------- .../x86-modern-bulk-monitor.json | 8 ++++---- .../x86-modern-individual-add-monitor.json | 4 ++-- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 373ebd6d1a..1ca1ecd2f0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10609,24 +10609,11 @@ qemuBuildHotpluggableCPUProps(const virDomainVcpu= Def *vcpu) qemuDomainVcpuPrivatePtr vcpupriv =3D QEMU_DOMAIN_VCPU_PRIVATE(vcpu); VIR_AUTOPTR(virJSONValue) ret =3D NULL; - if (virJSONValueObjectCreate(&ret, "s:driver", vcpupriv->type, - "s:id", vcpupriv->alias, NULL) < 0) + if (!(ret =3D virJSONValueCopy(vcpupriv->props))) return NULL; - if (vcpupriv->socket_id !=3D -1 && - virJSONValueObjectAdd(ret, "i:socket-id", vcpupriv->socket_id, NUL= L) < 0) - return NULL; - - if (vcpupriv->core_id !=3D -1 && - virJSONValueObjectAdd(ret, "i:core-id", vcpupriv->core_id, NULL) <= 0) - return NULL; - - if (vcpupriv->thread_id !=3D -1 && - virJSONValueObjectAdd(ret, "i:thread-id", vcpupriv->thread_id, NUL= L) < 0) - return NULL; - - if (vcpupriv->node_id !=3D -1 && - virJSONValueObjectAdd(ret, "i:node-id", vcpupriv->node_id, NULL) <= 0) + if (virJSONValueObjectPrependString(ret, "id", vcpupriv->alias) < 0 || + virJSONValueObjectPrependString(ret, "driver", vcpupriv->type) < 0) return NULL; VIR_RETURN_PTR(ret); diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json b/tests= /qemuhotplugtestcpus/x86-modern-bulk-monitor.json index 4dcb6a2cf5..b1d02b8d43 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json +++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json @@ -141,9 +141,9 @@ "arguments": { "driver": "qemu64-x86_64-cpu", "id": "vcpu5", - "socket-id": 1, "core-id": 0, - "thread-id": 1 + "thread-id": 1, + "socket-id": 1 }, "id": "libvirt-3" } @@ -303,9 +303,9 @@ "arguments": { "driver": "qemu64-x86_64-cpu", "id": "vcpu6", - "socket-id": 1, "core-id": 1, - "thread-id": 0 + "thread-id": 0, + "socket-id": 1 }, "id": "libvirt-6" } diff --git a/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.js= on b/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.json index 294198b270..df05e5e3a9 100644 --- a/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.json +++ b/tests/qemuhotplugtestcpus/x86-modern-individual-add-monitor.json @@ -141,9 +141,9 @@ "arguments": { "driver": "qemu64-x86_64-cpu", "id": "vcpu7", - "socket-id": 1, "core-id": 1, - "thread-id": 1 + "thread-id": 1, + "socket-id": 1 }, "id": "libvirt-3" } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list