From nobody Sun May 19 10:57:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1644346120; cv=none; d=zohomail.com; s=zohoarc; b=MahW00MCfWUx0qI49GBqxksJjOMRJy9pVTjRyjfuJeAMJLLVux322oL7H3HwWdlF737vzHUflVO4UuDKljEpWvIo2cVFGjhrFdvrG8/a53DiX4NDI3SM4661D5YEk5zCndFgiF6hj/wVo8Y1SLymxFaGgriLPVkbRNeSpR7nOQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346120; 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=tmztf7lG1ipOXCmCTbPGzD9Xn2m5uZaL6Ny/UJzUHfY=; b=JbHZlBd+RRuZius6cqC4sgPg/G0BNf4Y5bySRA9HCkd7G69o+N1ue7yXPhRCfW38TGmdY5cUcUBcm2dmHxComxna/1IvZ7oLSQoYiFTlZNvf4/4omYDS+v1xkUrOXP1BNejrPeUx73toTijwNctIq/GYmndUpx4up08ntto1ABo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1644346120555491.9020184750541; Tue, 8 Feb 2022 10:48:40 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-_alznxWSOC-YpeMN5FfoOg-1; Tue, 08 Feb 2022 13:48:36 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D43348144FD; Tue, 8 Feb 2022 18:48:28 +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 B224E74EBE; Tue, 8 Feb 2022 18:48:28 +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 83E431802E37; Tue, 8 Feb 2022 18:48:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217BsdFY032431 for ; Mon, 7 Feb 2022 06:54:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4079A6F9CD; Mon, 7 Feb 2022 11:54:39 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 988686F95F for ; Mon, 7 Feb 2022 11:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346119; 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=tmztf7lG1ipOXCmCTbPGzD9Xn2m5uZaL6Ny/UJzUHfY=; b=JSmckG3L/mVNsnotSoyLFA8g3z8FoAbs2yxrvAH0e4Ho4MTDHYCNI40nSrnOiez/h+m1Y9 QIcMH+LQG11lv1WN7OQXyKbACvHyKBoZJ+xQ3VVTAsXQ/Z4EeLXX0E/fk/EXJzHT4Ygf/d 5UctVz8efP29k9wpm4/mLNQyYIPYOZk= X-MC-Unique: _alznxWSOC-YpeMN5FfoOg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/7] qemuMonitorJSONGetCPUx86Data: Unexport Date: Mon, 7 Feb 2022 12:53:53 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644346121402100001 Content-Type: text/plain; charset="utf-8" The function is used only as a helper in src/qemu/qemu_monitor_json.c Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_monitor_json.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index b0b513683b..d81456bcad 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -7024,7 +7024,7 @@ qemuMonitorJSONParseCPUx86Features(virJSONValue *data) } -int +static int qemuMonitorJSONGetCPUx86Data(qemuMonitor *mon, const char *property, virCPUData **cpudata) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 64d9ebdaa3..be66c545c9 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -646,11 +646,6 @@ int qemuMonitorJSONGetDeviceAliases(qemuMonitor *mon, char ***aliases); -int -qemuMonitorJSONGetCPUx86Data(qemuMonitor *mon, - const char *property, - virCPUData **cpudata); - int qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, virCPUData **data, --=20 2.34.1 From nobody Sun May 19 10:57:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1644346399; cv=none; d=zohomail.com; s=zohoarc; b=WT9eODaQyfUu/J9QY8bOa28nPk0/pfM9nzpmHM1nIzfAZKtBMakMEZcY4LQRUPSmCBIxq7CKVKjyr2r+PTNAcAcGZA8h0oQgzjUAMZF2cV7fWpsjJcOb5P2sBvsLouwaVBFRoCzharPHEL/fldXCO0Ndr9NrOPiyoeiNGRbvILY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346399; 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=yUYQJshHnIyTn43QuBaJuxTFmVBmcBe0asw122z/cVs=; b=cP4hWYT2ElITv3fTUqgEdC7QNxITLbCSiVUs7RxvsOgkY+AN5fn0H1oNq9fF3j5nfUh8caU7AUoX7Ed01JdFjUv7nXA096uc1zeE6/137uZdAIlGzKwv/XZnm2+W797WBkgoohPtnmoBO0LD8Yx7/9b/7mjiGQ9HkJ3+j8EiSAg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1644346399027712.6767877316993; Tue, 8 Feb 2022 10:53:19 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-231-XiB5PFzQNBGl5W873I3Ovw-1; Tue, 08 Feb 2022 13:53:14 -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 81FD38519F8; Tue, 8 Feb 2022 18:53:08 +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 5F45834D41; Tue, 8 Feb 2022 18:53:08 +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 3118D4A70D; Tue, 8 Feb 2022 18:53:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217BseZ6032455 for ; Mon, 7 Feb 2022 06:54:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id D0F5C6FB88; Mon, 7 Feb 2022 11:54:40 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34C086FB8B for ; Mon, 7 Feb 2022 11:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346398; 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=yUYQJshHnIyTn43QuBaJuxTFmVBmcBe0asw122z/cVs=; b=TvcloheexCcnb8Xa/2O1Azcht+SpeHRsuiNQcvNJyLcdR0ltEvXKdkX69hTR9HwJN/QpPo RbSEetD1XFoWLFSGrb45DWxQ0giivrO6EvLL7lZFSkA4ZFPiE2nBUVXvC13tXnTDi5/5zX 9kkpNUzn5b1DfIY5L4t8LC5oGwAbuKE= X-MC-Unique: XiB5PFzQNBGl5W873I3Ovw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/7] qemuProcessUpdateAndVerifyCPU: Refactor cleanup Date: Mon, 7 Feb 2022 12:53:54 +0100 Message-Id: <1675a3c3af302c6afdd92aeeffdce3116ce59eb3.1644234805.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644346400824100001 Content-Type: text/plain; charset="utf-8" Use automatic memory clearing and remove the 'ret' variable. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ea586e54c1..d080ab1c49 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4335,25 +4335,19 @@ qemuProcessUpdateAndVerifyCPU(virQEMUDriver *driver, virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - virCPUData *cpu =3D NULL; - virCPUData *disabled =3D NULL; - int ret =3D -1; + g_autoptr(virCPUData) cpu =3D NULL; + g_autoptr(virCPUData) disabled =3D NULL; if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < = 0) - goto cleanup; + return -1; if (qemuProcessVerifyCPU(vm, cpu) < 0) - goto cleanup; + return -1; if (qemuProcessUpdateLiveGuestCPU(vm, cpu, disabled) < 0) - goto cleanup; - - ret =3D 0; + return -1; - cleanup: - virCPUDataFree(cpu); - virCPUDataFree(disabled); - return ret; + return 0; } --=20 2.34.1 From nobody Sun May 19 10:57:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1644346393; cv=none; d=zohomail.com; s=zohoarc; b=lvM8BBJ5b35s1tdknxEuvu7OFT8BhleOBpBpiksg4oTLUJqip35mNS4aEsbSE/d702XG9EL5Bx14CeNC4U7kq6XFLcR9aDL+MImKjc11Cei7+Mn1s3mNBl2O+lFe1qBJX5w2nvJT448nO3gtacw+Rgs3qCoKDSw35fCzXVEsh20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346393; 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=O9EjaZI5tGLrHeqQySar+QCrT5LIWBsfIUhMQuDt1XI=; b=MJFpWFr0TRBgEqgJhygkrB0uPwoVKfYbL1XtXaVm6bnoNojW7hTSf8Z0QQ1yCloXB8tqD+73ReYVYhlCeRmMO4L38joeSDf+oWdb2fvwSHuS6cxxsTtNdpUz9niHNIDwSxMVsEWJwXP77wb8HZdO3xwEMP7giOgTn9NdRGaxHnU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1644346393736998.8646241859309; Tue, 8 Feb 2022 10:53:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-308-Eez_fImiNLS2vvF6FstEgQ-1; Tue, 08 Feb 2022 13:53:11 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B68F1091DA7; Tue, 8 Feb 2022 18:53:05 +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 01CD08588E; Tue, 8 Feb 2022 18:53:05 +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 C60064A70A; Tue, 8 Feb 2022 18:53:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217BsgYF032460 for ; Mon, 7 Feb 2022 06:54:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2FBDA6F95F; Mon, 7 Feb 2022 11:54:42 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 475426F948 for ; Mon, 7 Feb 2022 11:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346393; 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=O9EjaZI5tGLrHeqQySar+QCrT5LIWBsfIUhMQuDt1XI=; b=BBfMMAoAL614DpaXbrzslQ5RyE4l+PTSX9EHuDtejkvV3NjIcmNczBPyef7WT77XME6nfj x4PToTdJDR13oHOs6abN+Ph1tSPNTI0/P+x3fOUWkzoVSptJ1yf/Dy8DWpO8iTMBQXFdWX s0z3SlExwK2QSb3ptTxla68MCKfxoqs= X-MC-Unique: Eez_fImiNLS2vvF6FstEgQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/7] qemu: monitor: Don't hardcode QOM path of first CPU Date: Mon, 7 Feb 2022 12:53:55 +0100 Message-Id: <545cf5f8cc6c3e7d5b93d272af341f60f9a41bf3.1644234805.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644346395806100004 Content-Type: text/plain; charset="utf-8" Convert all code using the 'QOM_CPU_PATH' macro to accept the QOM path as an argument. For now the new helper for fetching the path 'qemuProcessGetVCPUQOMPath' will always return the same hard-coded value. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 17 ++++++++++------ src/qemu/qemu_monitor.h | 3 +++ src/qemu/qemu_monitor_json.c | 38 ++++++++++++++++++++++-------------- src/qemu/qemu_monitor_json.h | 3 +++ src/qemu/qemu_process.c | 15 ++++++++++++-- tests/qemumonitorjsontest.c | 2 ++ 6 files changed, 55 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index babf9e62fb..a79ccabdca 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3887,6 +3887,7 @@ qemuMonitorSetDomainLog(qemuMonitor *mon, /** * qemuMonitorJSONGetGuestCPUx86: * @mon: Pointer to the monitor + * @cpuQOMPath: QOM path of a CPU to probe * @data: returns the cpu data * @disabled: returns the CPU data for features which were disabled by QEMU * @@ -3897,10 +3898,11 @@ qemuMonitorSetDomainLog(qemuMonitor *mon, */ int qemuMonitorGetGuestCPUx86(qemuMonitor *mon, + const char *cpuQOMPath, virCPUData **data, virCPUData **disabled) { - VIR_DEBUG("data=3D%p disabled=3D%p", data, disabled); + VIR_DEBUG("cpuQOMPath=3D%s data=3D%p disabled=3D%p", cpuQOMPath, data,= disabled); QEMU_CHECK_MONITOR(mon); @@ -3908,7 +3910,7 @@ qemuMonitorGetGuestCPUx86(qemuMonitor *mon, if (disabled) *disabled =3D NULL; - return qemuMonitorJSONGetGuestCPUx86(mon, data, disabled); + return qemuMonitorJSONGetGuestCPUx86(mon, cpuQOMPath, data, disabled); } @@ -3916,6 +3918,7 @@ qemuMonitorGetGuestCPUx86(qemuMonitor *mon, * qemuMonitorGetGuestCPU: * @mon: Pointer to the monitor * @arch: CPU architecture + * @cpuQOMPath: QOM path of a CPU to probe * @translate: callback for translating CPU feature names from QEMU to lib= virt * @opaque: data for @translate callback * @enabled: returns the CPU data for all enabled features @@ -3929,13 +3932,14 @@ qemuMonitorGetGuestCPUx86(qemuMonitor *mon, int qemuMonitorGetGuestCPU(qemuMonitor *mon, virArch arch, + const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback translate, void *opaque, virCPUData **enabled, virCPUData **disabled) { - VIR_DEBUG("arch=3D%s translate=3D%p opaque=3D%p enabled=3D%p disabled= =3D%p", - virArchToString(arch), translate, opaque, enabled, disabled); + VIR_DEBUG("arch=3D%s cpuQOMPath=3D%s translate=3D%p opaque=3D%p enable= d=3D%p disabled=3D%p", + virArchToString(arch), cpuQOMPath, translate, opaque, enable= d, disabled); QEMU_CHECK_MONITOR(mon); @@ -3943,7 +3947,7 @@ qemuMonitorGetGuestCPU(qemuMonitor *mon, if (disabled) *disabled =3D NULL; - return qemuMonitorJSONGetGuestCPU(mon, arch, translate, opaque, + return qemuMonitorJSONGetGuestCPU(mon, arch, cpuQOMPath, translate, op= aque, enabled, disabled); } @@ -4416,11 +4420,12 @@ qemuMonitorGetJobInfo(qemuMonitor *mon, */ int qemuMonitorGetCPUMigratable(qemuMonitor *mon, + const char *cpuQOMPath, bool *migratable) { QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONGetCPUMigratable(mon, migratable); + return qemuMonitorJSONGetCPUMigratable(mon, cpuQOMPath, migratable); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 9b2e4e1421..11ecda97de 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1348,6 +1348,7 @@ void qemuMonitorSetDomainLog(qemuMonitor *mon, virFreeCallback destroy); int qemuMonitorGetGuestCPUx86(qemuMonitor *mon, + const char *cpuQOMPath, virCPUData **data, virCPUData **disabled); @@ -1356,6 +1357,7 @@ typedef const char *(*qemuMonitorCPUFeatureTranslatio= nCallback)(const char *name int qemuMonitorGetGuestCPU(qemuMonitor *mon, virArch arch, + const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback transl= ate, void *opaque, virCPUData **enabled, @@ -1489,6 +1491,7 @@ int qemuMonitorGetJobInfo(qemuMonitor *mon, int qemuMonitorGetCPUMigratable(qemuMonitor *mon, + const char *cpuQOMPath, bool *migratable); int diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index d81456bcad..8e1501d91f 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -48,8 +48,6 @@ VIR_LOG_INIT("qemu.qemu_monitor_json"); -#define QOM_CPU_PATH "/machine/unattached/device[0]" - #define LINE_ENDING "\r\n" VIR_ENUM_IMPL(qemuMonitorJob, @@ -7026,6 +7024,7 @@ qemuMonitorJSONParseCPUx86Features(virJSONValue *data) static int qemuMonitorJSONGetCPUx86Data(qemuMonitor *mon, + const char *cpuQOMPath, const char *property, virCPUData **cpudata) { @@ -7034,7 +7033,7 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitor *mon, virJSONValue *data; if (!(cmd =3D qemuMonitorJSONMakeCommand("qom-get", - "s:path", QOM_CPU_PATH, + "s:path", cpuQOMPath, "s:property", property, NULL))) return -1; @@ -7058,7 +7057,8 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitor *mon, * of a guest CPU, and 1 if the feature is supported. */ static int -qemuMonitorJSONCheckCPUx86(qemuMonitor *mon) +qemuMonitorJSONCheckCPUx86(qemuMonitor *mon, + const char *cpuQOMPath) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; @@ -7067,7 +7067,7 @@ qemuMonitorJSONCheckCPUx86(qemuMonitor *mon) size_t n; if (!(cmd =3D qemuMonitorJSONMakeCommand("qom-list", - "s:path", QOM_CPU_PATH, + "s:path", cpuQOMPath, NULL))) return -1; @@ -7102,6 +7102,7 @@ qemuMonitorJSONCheckCPUx86(qemuMonitor *mon) /** * qemuMonitorJSONGetGuestCPUx86: * @mon: Pointer to the monitor + * @cpuQOMPath: QOM path of a CPU to probe * @data: returns the cpu data of the guest * @disabled: returns the CPU data for features which were disabled by QEMU * @@ -7112,6 +7113,7 @@ qemuMonitorJSONCheckCPUx86(qemuMonitor *mon) */ int qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, + const char *cpuQOMPath, virCPUData **data, virCPUData **disabled) { @@ -7119,17 +7121,17 @@ qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, g_autoptr(virCPUData) cpuDisabled =3D NULL; int rc; - if ((rc =3D qemuMonitorJSONCheckCPUx86(mon)) < 0) + if ((rc =3D qemuMonitorJSONCheckCPUx86(mon, cpuQOMPath)) < 0) return -1; else if (!rc) return -2; - if (qemuMonitorJSONGetCPUx86Data(mon, "feature-words", + if (qemuMonitorJSONGetCPUx86Data(mon, cpuQOMPath, "feature-words", &cpuEnabled) < 0) return -1; if (disabled && - qemuMonitorJSONGetCPUx86Data(mon, "filtered-features", + qemuMonitorJSONGetCPUx86Data(mon, cpuQOMPath, "filtered-features", &cpuDisabled) < 0) return -1; @@ -7142,6 +7144,7 @@ qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, static int qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, + const char *cpuQOMPath, char ***props) { g_autoptr(virJSONValue) cmd =3D NULL; @@ -7150,7 +7153,7 @@ qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, *props =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("qom-list", - "s:path", QOM_CPU_PATH, + "s:path", cpuQOMPath, NULL))) return -1; @@ -7166,6 +7169,7 @@ qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, static int qemuMonitorJSONGetCPUData(qemuMonitor *mon, + const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback transla= te, void *opaque, virCPUData *data) @@ -7174,13 +7178,13 @@ qemuMonitorJSONGetCPUData(qemuMonitor *mon, g_auto(GStrv) props =3D NULL; char **p; - if (qemuMonitorJSONGetCPUProperties(mon, &props) < 0) + if (qemuMonitorJSONGetCPUProperties(mon, cpuQOMPath, &props) < 0) return -1; for (p =3D props; p && *p; p++) { const char *name =3D *p; - if (qemuMonitorJSONGetObjectProperty(mon, QOM_CPU_PATH, name, &pro= p) < 0) + if (qemuMonitorJSONGetObjectProperty(mon, cpuQOMPath, name, &prop)= < 0) return -1; if (!prop.val.b) @@ -7199,6 +7203,7 @@ qemuMonitorJSONGetCPUData(qemuMonitor *mon, static int qemuMonitorJSONGetCPUDataDisabled(qemuMonitor *mon, + const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback= translate, void *opaque, virCPUData *data) @@ -7206,7 +7211,7 @@ qemuMonitorJSONGetCPUDataDisabled(qemuMonitor *mon, g_auto(GStrv) props =3D NULL; char **p; - if (qemuMonitorJSONGetStringListProperty(mon, QOM_CPU_PATH, + if (qemuMonitorJSONGetStringListProperty(mon, cpuQOMPath, "unavailable-features", &prop= s) < 0) return -1; @@ -7228,6 +7233,7 @@ qemuMonitorJSONGetCPUDataDisabled(qemuMonitor *mon, * qemuMonitorJSONGetGuestCPU: * @mon: Pointer to the monitor * @arch: CPU architecture + * @cpuQOMPath: QOM path of a CPU to probe * @translate: callback for translating CPU feature names from QEMU to lib= virt * @opaque: data for @translate callback * @enabled: returns the CPU data for all enabled features @@ -7241,6 +7247,7 @@ qemuMonitorJSONGetCPUDataDisabled(qemuMonitor *mon, int qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, virArch arch, + const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback transl= ate, void *opaque, virCPUData **enabled, @@ -7253,11 +7260,11 @@ qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, !(cpuDisabled =3D virCPUDataNew(arch))) return -1; - if (qemuMonitorJSONGetCPUData(mon, translate, opaque, cpuEnabled) < 0) + if (qemuMonitorJSONGetCPUData(mon, cpuQOMPath, translate, opaque, cpuE= nabled) < 0) return -1; if (disabled && - qemuMonitorJSONGetCPUDataDisabled(mon, translate, opaque, cpuDisab= led) < 0) + qemuMonitorJSONGetCPUDataDisabled(mon, cpuQOMPath, translate, opaq= ue, cpuDisabled) < 0) return -1; *enabled =3D g_steal_pointer(&cpuEnabled); @@ -8671,13 +8678,14 @@ qemuMonitorJSONGetJobInfo(qemuMonitor *mon, int qemuMonitorJSONGetCPUMigratable(qemuMonitor *mon, + const char *cpuQOMPath, bool *migratable) { g_autoptr(virJSONValue) cmd =3D NULL; g_autoptr(virJSONValue) reply =3D NULL; if (!(cmd =3D qemuMonitorJSONMakeCommand("qom-get", - "s:path", QOM_CPU_PATH, + "s:path", cpuQOMPath, "s:property", "migratable", NULL))) return -1; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index be66c545c9..309d1fb409 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -648,12 +648,14 @@ qemuMonitorJSONGetDeviceAliases(qemuMonitor *mon, int qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, + const char *cpuQOMPath, virCPUData **data, virCPUData **disabled); int qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, virArch arch, + const char *cpuQOMPath, qemuMonitorCPUFeatureTranslationCallback transl= ate, void *opaque, virCPUData **enabled, @@ -846,6 +848,7 @@ qemuMonitorJSONSetDBusVMStateIdList(qemuMonitor *mon, int qemuMonitorJSONGetCPUMigratable(qemuMonitor *mon, + const char *cpuQOMPath, bool *migratable); int diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d080ab1c49..10e76583cf 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4224,6 +4224,14 @@ qemuProcessTranslateCPUFeatures(const char *name, } +/* returns the QOM path to the first vcpu */ +static const char * +qemuProcessGetVCPUQOMPath(void) +{ + return "/machine/unattached/device[0]"; +} + + static int qemuProcessFetchGuestCPU(virQEMUDriver *driver, virDomainObj *vm, @@ -4234,6 +4242,7 @@ qemuProcessFetchGuestCPU(virQEMUDriver *driver, qemuDomainObjPrivate *priv =3D vm->privateData; g_autoptr(virCPUData) dataEnabled =3D NULL; g_autoptr(virCPUData) dataDisabled =3D NULL; + const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(); bool generic; int rc; @@ -4251,10 +4260,11 @@ qemuProcessFetchGuestCPU(virQEMUDriver *driver, if (generic) { rc =3D qemuMonitorGetGuestCPU(priv->mon, vm->def->os.arch, + cpuQOMPath, qemuProcessTranslateCPUFeatures, priv-= >qemuCaps, &dataEnabled, &dataDisabled); } else { - rc =3D qemuMonitorGetGuestCPUx86(priv->mon, &dataEnabled, &dataDis= abled); + rc =3D qemuMonitorGetGuestCPUx86(priv->mon, cpuQOMPath, &dataEnabl= ed, &dataDisabled); } qemuDomainObjExitMonitor(driver, vm); @@ -8455,6 +8465,7 @@ qemuProcessRefreshCPUMigratability(virQEMUDriver *dri= ver, { qemuDomainObjPrivate *priv =3D vm->privateData; virDomainDef *def =3D vm->def; + const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(); bool migratable; int rc; @@ -8473,7 +8484,7 @@ qemuProcessRefreshCPUMigratability(virQEMUDriver *dri= ver, if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; - rc =3D qemuMonitorGetCPUMigratable(priv->mon, &migratable); + rc =3D qemuMonitorGetCPUMigratable(priv->mon, cpuQOMPath, &migratable); qemuDomainObjExitMonitor(driver, vm); if (rc < 0) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 48e2a457ab..7987182a82 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2186,6 +2186,7 @@ testQemuMonitorJSONGetCPUData(const void *opaque) return -1; if (qemuMonitorJSONGetGuestCPUx86(qemuMonitorTestGetMonitor(test), + "dummy", &cpuData, NULL) < 0) return -1; @@ -2221,6 +2222,7 @@ testQemuMonitorJSONGetNonExistingCPUData(const void *= opaque) return -1; rv =3D qemuMonitorJSONGetGuestCPUx86(qemuMonitorTestGetMonitor(test), + "dummy", &cpuData, NULL); if (rv !=3D -2) { virReportError(VIR_ERR_INTERNAL_ERROR, --=20 2.34.1 From nobody Sun May 19 10:57:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1644346399; cv=none; d=zohomail.com; s=zohoarc; b=YWADWXthWiA/fpj6MUDtqnKv2tiN2vkmqu1FaVnFrjs9k/OtsedEitZii9/vRpqMqjStASGdZqNBklWUyG1r/NQqkkF5Dmfak1G4kPC9RXQ7wMcyZpiCX9XYf99Rko5MdeoVeZI6qP1367M/fjwY+USNyR/802o4ao7nPyoquBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346399; 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=o5owKeHZHXrp6ZPzPk/XUNHG+IDxjepbAawSubaegP4=; b=DwqQf0WzhLrBX2lfLzJ/0+flhS6326J/kR2w4T8yoISO28BUhd8L7TTUyPfEjN7ZomZUOypI/Qkm0GHKZTrq5ccpAjrRYq12MoiOwckAhf3pQSvztnbVMc0E4/zCUqq0wK559y5BLwFMfQdm3gnUrMb+Zm4U8DpfJAs8LeX8Rco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1644346399605170.80678827403722; Tue, 8 Feb 2022 10:53:19 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-220-f_et3141N-WpJBx7ueRMpw-1; Tue, 08 Feb 2022 13:53:16 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 299E2190A7A5; Tue, 8 Feb 2022 18:53:11 +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 0AD687A46B; Tue, 8 Feb 2022 18:53:11 +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 D05034A712; Tue, 8 Feb 2022 18:53:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217Bshhh032475 for ; Mon, 7 Feb 2022 06:54:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 44A656F94E; Mon, 7 Feb 2022 11:54:43 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 960CF6F948 for ; Mon, 7 Feb 2022 11:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346398; 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=o5owKeHZHXrp6ZPzPk/XUNHG+IDxjepbAawSubaegP4=; b=DrOtRtcYjHgjZFzXF/l5W2602+9UuLuC+hAtIbDF0ISBZqMUbqZGJ1w/7vpJCtNilLkA6K QY+AV9SURM6+M/+iK4TqA7a4YBMWCvkItst8HVl66GWOcYIv8v1//Cq1mOfFssIwUW3c+M 72PVn+wJxCfSVEo70Usc6Sg4lXxeIX0= X-MC-Unique: f_et3141N-WpJBx7ueRMpw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/7] qemu: domain: Store 'qomPath' in qemuDomainVcpuPrivate Date: Mon, 7 Feb 2022 12:53:56 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644346400960100004 Content-Type: text/plain; charset="utf-8" The QOM path will be needed by code which is querying the cpu flags via 'qom-get' and thus needs a valid QOM path to the vCPU. Add it into the private data and transfer from the queried data. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 3 +++ src/qemu/qemu_domain.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 14b585c6e9..015f635dc8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -821,6 +821,7 @@ qemuDomainVcpuPrivateDispose(void *obj) g_free(priv->type); g_free(priv->alias); virJSONValueFree(priv->props); + g_free(priv->qomPath); return; } @@ -9550,6 +9551,8 @@ qemuDomainRefreshVcpuInfo(virQEMUDriver *driver, vcpupriv->props =3D g_steal_pointer(&info[i].props); vcpupriv->enable_id =3D info[i].id; vcpupriv->qemu_id =3D info[i].qemu_id; + g_free(vcpupriv->qomPath); + vcpupriv->qomPath =3D g_steal_pointer(&info[i].qom_path); if (hotplug && state) { vcpu->online =3D info[i].online; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 78474b3f73..8bf1c91049 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -316,6 +316,8 @@ struct _qemuDomainVcpuPrivate { int thread_id; int node_id; int vcpus; + + char *qomPath; }; #define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \ --=20 2.34.1 From nobody Sun May 19 10:57:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1644346442; cv=none; d=zohomail.com; s=zohoarc; b=llZipaxrtBq2/0QnEdHz23E1lQtr4ewwIwgfQxVwB+Dc+cQQZa96b7aftu28oax+cwj2LKnkMNwjpEMwiwbJiskWzjTdM+iBdMmDI5oBy1HMwo+owjsVULlGySat0rPUgKZwzAnJouaS3BseLVWdoBNbKkWDOmqiqnd6EYIvPMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346442; 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=rh8sRIUIetZJZr5c51TR+BD2VgRM3BhfthbnocGeXc0=; b=BmLmM5W/82IJH4qX4K7aHMPDvU1B6EJjRwZvYNpShO3lRoNfFJQKu0aXx/ejcAyv+vLqlJyCUZeqR3O1roGI0Sa+unlk0af9qYJCZvM4iCx2D3IIflzU1yl0amiFCg+/Ta0PgEY+/8DbF16YaKUL1cHZ2BYooT/aKSDlJ9mf8ac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1644346442885290.34616709370755; Tue, 8 Feb 2022 10:54:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-64-0vJYEVdJO2GsLZOoMI4rQw-1; Tue, 08 Feb 2022 13:53:19 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABD5F100C667; Tue, 8 Feb 2022 18:53:13 +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 8D65A7E123; Tue, 8 Feb 2022 18:53:13 +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 5787B1826D18; Tue, 8 Feb 2022 18:53:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217Bsiir032481 for ; Mon, 7 Feb 2022 06:54:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 579C66F959; Mon, 7 Feb 2022 11:54:44 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id A92E96F9C2 for ; Mon, 7 Feb 2022 11:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346441; 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=rh8sRIUIetZJZr5c51TR+BD2VgRM3BhfthbnocGeXc0=; b=a6BYnpA4cnWQMRWXb0+/8k9sOhX7sIIPYN8ThRS6EzjmkL4gTKlxKxca5ana/T++PeioSv DGVKQASn8uGtxKMdSlVLRsaCzfNS2FG2XRBkB5CeKKWnnEoKOk6BxFQTgkfbGTbQ715zvm LcJ5bPbs5pkmkNyM+K50BIxQFzNWe+c= X-MC-Unique: 0vJYEVdJO2GsLZOoMI4rQw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/7] qemu: process: Move cpu flag querying after code probing cpus Date: Mon, 7 Feb 2022 12:53:57 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644346444870100003 Content-Type: text/plain; charset="utf-8" Upcoming changes will require that we have a proper QOM path for cpus when querying the flags as qemu is going to change it. By moving the flag probing code later we'll already probe the QOM paths so no re-query will be needed. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 10e76583cf..f99b14b846 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7573,10 +7573,6 @@ qemuProcessLaunch(virConnectPtr conn, if (qemuConnectAgent(driver, vm) < 0) goto cleanup; - VIR_DEBUG("Verifying and updating provided guest CPU"); - if (qemuProcessUpdateAndVerifyCPU(driver, vm, asyncJob) < 0) - goto cleanup; - VIR_DEBUG("setting up hotpluggable cpus"); if (qemuDomainHasHotpluggableStartupVcpus(vm->def)) { if (qemuDomainRefreshVcpuInfo(driver, vm, asyncJob, false) < 0) @@ -7598,6 +7594,10 @@ qemuProcessLaunch(virConnectPtr conn, qemuDomainVcpuPersistOrder(vm->def); + VIR_DEBUG("Verifying and updating provided guest CPU"); + if (qemuProcessUpdateAndVerifyCPU(driver, vm, asyncJob) < 0) + goto cleanup; + VIR_DEBUG("Detecting IOThread PIDs"); if (qemuProcessDetectIOThreadPIDs(driver, vm, asyncJob) < 0) goto cleanup; --=20 2.34.1 From nobody Sun May 19 10:57:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1644346407; cv=none; d=zohomail.com; s=zohoarc; b=oG004mkcLe7kbYDpZZnvMV3emUmfh0P7th2jWprH3ylKqSDuXGWQxNH/yFhWZVGQVBSRgQ3F6UMAlvh0LAOmsC7mbICyynoYQt199Qlvik2hQkQBrgw7BpekUYE4aPKX+olYZCDYs8bdSJGSrB4YB9JngFWMYoyVo76Wyk/GfWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346407; 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=X3GBA/MTY5lS8+wvnlyQLs1+vGn+8/N3u2z4YpGj/X0=; b=KjwOZlZp5PFUQND8jDmvSEpNzALX8ppQ+XVpocLaAXDAy07ZHPdIKsiOhdY6xAZaphAxoCTrO51s/dATIlTZ12xU5V/G9dVFH+MuAnV2U9rYTvnLpPEzEv7aBvENLljy76dmjWKc3/oSBBJf0OYfqiDN5kJxSmgAaYrYPmr5D50= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16443464075602.993156700983036; Tue, 8 Feb 2022 10:53:27 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-20-8iV9dkM8PWSvyaugJwJoJg-1; Tue, 08 Feb 2022 13:53:22 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A47D851096; Tue, 8 Feb 2022 18:53:16 +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 4D772753DD; Tue, 8 Feb 2022 18:53:16 +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 14DA41826D1F; Tue, 8 Feb 2022 18:53:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217BsjLI032489 for ; Mon, 7 Feb 2022 06:54:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 698EB6F950; Mon, 7 Feb 2022 11:54:45 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7BDB6F9CC for ; Mon, 7 Feb 2022 11:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346406; 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=X3GBA/MTY5lS8+wvnlyQLs1+vGn+8/N3u2z4YpGj/X0=; b=UHz7fBLzEROLibKFIjbBAZ/WPx26uxW2inobr2f1IJLObEqcQe7AB8odHcN2ZyzsoMEQJ/ V3XK1v0X7OABrUlHI0HzTtGuxr3EEThINrjK/mMxXVDL0lfma3/GGVNNfMZ9uqdmKW9/QK K6A/o7TmqQWB61za+7bFAWFaOXKV9xQ= X-MC-Unique: 8iV9dkM8PWSvyaugJwJoJg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/7] qemu: process: Move call to qemuProcessRefreshCPU after cpu probe Date: Mon, 7 Feb 2022 12:53:58 +0100 Message-Id: <4632c787aaaed2c925938363328f43348f4e0df1.1644234805.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644346409808100001 Content-Type: text/plain; charset="utf-8" Similarly to previous commit we need to probe the vcpus first. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f99b14b846..bd9c6ed747 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8850,14 +8850,14 @@ qemuProcessReconnect(void *opaque) ignore_value(qemuSecurityCheckAllLabel(driver->securityManager, obj->def)); - if (qemuProcessRefreshCPU(driver, obj) < 0) - goto error; - if (qemuDomainRefreshVcpuInfo(driver, obj, QEMU_ASYNC_JOB_NONE, true) = < 0) goto error; qemuDomainVcpuPersistOrder(obj->def); + if (qemuProcessRefreshCPU(driver, obj) < 0) + goto error; + if (qemuDomainUpdateMemoryDeviceInfo(driver, obj, QEMU_ASYNC_JOB_NONE)= < 0) goto error; --=20 2.34.1 From nobody Sun May 19 10:57:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1644346399; cv=none; d=zohomail.com; s=zohoarc; b=i3STZ5gwIoJV51GI3lQcmYLn7ZVUvummUwbNfi1+hhcM8eH8KB1WyrY5lapztnnyonz5755tQwEIuKv4N+aZixa1+ZpoOtXkcHspkG92xqoyShqSLXiaKuTjxO34kQi4uCxGZie3puN454meJ0Pf4zJ/PqVAWJqPT0oFHQ1Q1EM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644346399; 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=MgYvC0WpzYR4J4u6IVZGpai6zM/5BMsMQb7FbyfAFcs=; b=mi2qYLIibhqRQZVWpezjewVbS3e38ihVwux5Q9728h7ilnh5m3V9VFWP3K17IlTLSesAbU0dgQ0Xi/XZ9/bsJOjKl+p4p6qJAbXohH1yzf8Iyzcoh37QJCUNQclTIOX7A8epeNPjZ7fNKB2RFiUOFZ5qv6Jn8k+4VPGYcT8fe2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1644346399173417.7929899957587; Tue, 8 Feb 2022 10:53:19 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-410-oL_f4k59M8uOz0eFN3r_ZA-1; Tue, 08 Feb 2022 13:53:14 -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 248F58519F7; Tue, 8 Feb 2022 18:53:08 +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 02C7E34D42; Tue, 8 Feb 2022 18:53:08 +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 C94B718218BE; Tue, 8 Feb 2022 18:53:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 217Bsknt032509 for ; Mon, 7 Feb 2022 06:54:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 88F2D6F950; Mon, 7 Feb 2022 11:54:46 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id D23C36F948 for ; Mon, 7 Feb 2022 11:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644346398; 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=MgYvC0WpzYR4J4u6IVZGpai6zM/5BMsMQb7FbyfAFcs=; b=ELEmchWDAEyfK6b9FHLRDp4EcXVpK6dFYg3NuhqEEZ1EeoMpdWh44umwjroXII4HuGP0D8 7n0wx77xpSl4gF0G5+hG1oRhYP9x9oXVbypQORvjommLaV54ufm1xe9YJpYc877Yn5uEEc lS2YKZpuW3NoBVPrlJbX94LdsjXqgac= X-MC-Unique: oL_f4k59M8uOz0eFN3r_ZA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/7] qemu: process: Don't use hardcoded QOM path for cpu for probing flags Date: Mon, 7 Feb 2022 12:53:59 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1644346400956100003 Content-Type: text/plain; charset="utf-8" Modify 'qemuProcessGetVCPUQOMPath' to take the detected QOM path of the first vCPU which is always present as the QOM path used our code probing CPU flags via 'qom-get'. This is needed as upcoming qemu will change it. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/272 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2051451 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bd9c6ed747..eeda2a92ef 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4226,8 +4226,16 @@ qemuProcessTranslateCPUFeatures(const char *name, /* returns the QOM path to the first vcpu */ static const char * -qemuProcessGetVCPUQOMPath(void) +qemuProcessGetVCPUQOMPath(virDomainObj *vm) { + virDomainVcpuDef *vcpu =3D virDomainDefGetVcpu(vm->def, 0); + qemuDomainVcpuPrivate *vcpupriv; + + if (vcpu && + (vcpupriv =3D QEMU_DOMAIN_VCPU_PRIVATE(vcpu)) && + vcpupriv->qomPath) + return vcpupriv->qomPath; + return "/machine/unattached/device[0]"; } @@ -4242,7 +4250,7 @@ qemuProcessFetchGuestCPU(virQEMUDriver *driver, qemuDomainObjPrivate *priv =3D vm->privateData; g_autoptr(virCPUData) dataEnabled =3D NULL; g_autoptr(virCPUData) dataDisabled =3D NULL; - const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(); + const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(vm); bool generic; int rc; @@ -8465,7 +8473,7 @@ qemuProcessRefreshCPUMigratability(virQEMUDriver *dri= ver, { qemuDomainObjPrivate *priv =3D vm->privateData; virDomainDef *def =3D vm->def; - const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(); + const char *cpuQOMPath =3D qemuProcessGetVCPUQOMPath(vm); bool migratable; int rc; --=20 2.34.1