From nobody Sat May 18 13:36:57 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=1693228304; cv=none; d=zohomail.com; s=zohoarc; b=VQ/ah0iuVDmWPJd6aOo5agW08zTaiA2MwOZUxPHcQi2mLNzwex4MMINd2pk9/5lrbJ5dDgVx0UJ6dxshTjyxYkc8X7WSAJhnyAkSzU7s6aAiF3ezIrkc0i1Hkv6Vsx4uUtvH9LOz1LTLJyfuLsrLqA02OcTjDFuMC88jRSqJVak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693228304; 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=zxl45kfL1GbxEXaRcsT/3nBcsYni9VDMqEzN4T6KW10=; b=EBbj14LMtDKOOaxM5E+cxpSUUErBT4fdlXXjcnAX3/ztQ1Fw98NUkbn+xOkqdWf3RZ8MMUFQ9uV5VHteeH4yfj4ZzMQ747q+VGmVeXj19UcjyPi2xyM4BzAckR+S/kIVjjL3hJPti4pIdHL7MmWm9Rb7zsHlRQabWsh0S7pZl4I= 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 1693228304870478.62615879380076; Mon, 28 Aug 2023 06:11:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-72I5oznBOciJZoW4PJKRXg-1; Mon, 28 Aug 2023 09:11:38 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9CB53C0FC95; Mon, 28 Aug 2023 13:11:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B4B240C2063; Mon, 28 Aug 2023 13:11:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AA1E519465A8; Mon, 28 Aug 2023 13:11:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 284531946587 for ; Mon, 28 Aug 2023 13:11:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0885B2166B26; Mon, 28 Aug 2023 13:11:30 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 822ED2166B25 for ; Mon, 28 Aug 2023 13:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693228303; 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=zxl45kfL1GbxEXaRcsT/3nBcsYni9VDMqEzN4T6KW10=; b=J/aPAWyH3PbcZLIo2fspVs4p7lPGuAH7XtQpXKNyKJne2gyN3/Tlz0AFvtNrKdnuUBUYay QWDN7d0+sO+Qg9d8qgUwV91CaNjRGfbCmEl/lib4dSeVKUtfkkR62gGZaBu5Uy0/Z2JIo0 3wrmepyWrLdfquXJ3RmoMqko+NzIMW4= X-MC-Unique: 72I5oznBOciJZoW4PJKRXg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/9] qemu: Rename qemuDomainSupportsNewVcpuHotplug to qemuDomainSupportsVcpuHotplug Date: Mon, 28 Aug 2023 15:11:19 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1693228306815100001 Content-Type: text/plain; charset="utf-8" Support for legacy cpu hotplug was removed a long time ago. At this point this function only checks whether the current machine type supports cpu hotplug. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 4 ++-- src/qemu/qemu_domain.h | 2 +- src/qemu/qemu_hotplug.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index bfeddc7746..49ae44fcbf 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9998,7 +9998,7 @@ qemuDomainValidateVcpuInfo(virDomainObj *vm) bool -qemuDomainSupportsNewVcpuHotplug(virDomainObj *vm) +qemuDomainSupportsVcpuHotplug(virDomainObj *vm) { qemuDomainObjPrivate *priv =3D vm->privateData; @@ -10035,7 +10035,7 @@ qemuDomainRefreshVcpuInfo(virDomainObj *vm, int rc; int ret =3D -1; - hotplug =3D qemuDomainSupportsNewVcpuHotplug(vm); + hotplug =3D qemuDomainSupportsVcpuHotplug(vm); VIR_DEBUG("Maxvcpus %zu hotplug %d", maxvcpus, hotplug); if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 786f239495..15d1bb4900 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -860,7 +860,7 @@ int qemuDomainSetMaxMemLock(virDomainObj *vm, int qemuDomainDefValidateMemoryHotplug(const virDomainDef *def, const virDomainMemoryDef *mem); -bool qemuDomainSupportsNewVcpuHotplug(virDomainObj *vm); +bool qemuDomainSupportsVcpuHotplug(virDomainObj *vm); bool qemuDomainHasVcpuPids(virDomainObj *vm); pid_t qemuDomainGetVcpuPid(virDomainObj *vm, unsigned int vcpuid); int qemuDomainValidateVcpuInfo(virDomainObj *vm); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d7d1db8ecc..d845731aee 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6400,7 +6400,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver, size_t i; bool vcpuTidMissing =3D false; - if (!qemuDomainSupportsNewVcpuHotplug(vm)) { + if (!qemuDomainSupportsVcpuHotplug(vm)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cpu hotplug is not supported")); return -1; @@ -6846,7 +6846,7 @@ qemuDomainSetVcpuInternal(virQEMUDriver *driver, g_autoptr(virBitmap) livevcpus =3D NULL; if (def) { - if (!qemuDomainSupportsNewVcpuHotplug(vm)) { + if (!qemuDomainSupportsVcpuHotplug(vm)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("this qemu version does not support specific " "vCPU hotplug")); --=20 2.41.0 From nobody Sat May 18 13:36:57 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=1693228336; cv=none; d=zohomail.com; s=zohoarc; b=cC9jXiscddCoSkL2wKh+Xfi/5EjWRFB5m1a5/Yx3+za+f3Q189asMUcUStKjnmhroCpgf6K1aEhRpBrLSBtmQ2VK1wKzMp3vgtc3OxEdvl2i1mpUJWY16Z5+zp5DYpiYUBPF0YGquXJSgDoe1R1mW6mAMIZNFA7G+THsHH3VHNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693228336; 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=2EmE2pKHNcYl5W/x3ToLgw6Iiy8zADPZYqKcbz8roaQ=; b=mMqZ46lTt+9NowPV7I+o6uLvrZ+sWbueyaeJmWQUDgR7VgnkX9lBDnX+TT+eJ6RkwWZFRtn0TzqUCVxvtkzB5UDRYfS+HgELyOOq2ayCsq4QQM9SSV2/RlpL9bSxnbpo/tGkt4cieuXL3H6VVvvorFNielFTCQjnYSv03DNZjos= 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 1693228336783665.9972809546304; Mon, 28 Aug 2023 06:12:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-19-SzpzLH7QNsi4tIyho0cW0g-1; Mon, 28 Aug 2023 09:11:44 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DE140805AF6; Mon, 28 Aug 2023 13:11:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7999492C3E; Mon, 28 Aug 2023 13:11:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DE6D01946A4C; Mon, 28 Aug 2023 13:11:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E7E8B1946A42 for ; Mon, 28 Aug 2023 13:11:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CD6EC2166B26; Mon, 28 Aug 2023 13:11:30 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 575CE2166B25 for ; Mon, 28 Aug 2023 13:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693228335; 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=2EmE2pKHNcYl5W/x3ToLgw6Iiy8zADPZYqKcbz8roaQ=; b=ink/CqfTVzDUBBKbmWWf2VpL8rKAyKk6Zs53GA8wYcTUc9dU857+14UBtyUmEWN8R5fCgm AajiOlo2o0z1jJy67Ij31P7nzlAJ+JoK2mao2WaQQq8bVguyUfDx9qGb/18ALhL/oH9o/x EYnyWNGA9ANwVthJ9MEj5m5D70kHU9E= X-MC-Unique: SzpzLH7QNsi4tIyho0cW0g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/9] qemu: capabilities: Export functions necessary for probing machine types Date: Mon, 28 Aug 2023 15:11:20 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1693228337719100001 Content-Type: text/plain; charset="utf-8" Upcoming patch will re-probe machines from the current qemu instance to populate the private copy of qemuCaps after reconnecting to a running instance. This is needed to be able to access the machine type data, while storing them in the status XML seems to be an overkill, for information which can be easily reprobed. Export 'virQEMUCapsInitQMPArch' needed to populate the 'arch' field and 'virQEMUCapsProbeQMPMachineTypes'. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 6 +++--- src/qemu/qemu_capabilities.h | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 05cc11218a..86619ee92f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2798,7 +2798,7 @@ virQEMUCapsHasMachines(virQEMUCaps *qemuCaps) } -static int +int virQEMUCapsProbeQMPMachineTypes(virQEMUCaps *qemuCaps, virDomainVirtType virtType, qemuMonitor *mon) @@ -5407,9 +5407,9 @@ virQEMUCapsIsValid(void *data, * * Returns: 0 on success, <0 on failure */ -static int +int virQEMUCapsInitQMPArch(virQEMUCaps *qemuCaps, - qemuMonitor *mon) + qemuMonitor *mon) { g_autofree char *archstr =3D NULL; diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 2198b94cf2..620ebf779f 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -895,3 +895,12 @@ virQEMUCapsProbeHVF(virQEMUCaps *qemuCaps) G_NO_INLINE; virArch virQEMUCapsArchFromString(const char *arch); const char *virQEMUCapsArchToString(virArch arch); + +int +virQEMUCapsInitQMPArch(virQEMUCaps *qemuCaps, + qemuMonitor *mon); + +int +virQEMUCapsProbeQMPMachineTypes(virQEMUCaps *qemuCaps, + virDomainVirtType virtType, + qemuMonitor *mon); --=20 2.41.0 From nobody Sat May 18 13:36:57 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=1693228308; cv=none; d=zohomail.com; s=zohoarc; b=SgEacM+nFawMRTbPGE7DN8g4oiB+ulsuz3RQU/sEmSc14ALdFZ2xHxykFzWaxXC69q6oogirO6io/gzOmd/CRhBunVaqdccf5yX203mSxf2a53EbywApoLDGqajvEBKcCCd5wwJQopt+x00mRXX88CMxjsDtqdDIbCLQAP4ji3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693228308; 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=0O0fOx2jrCCp5IHLhC65rhOkmijL2zxYdfG31MSeVLE=; b=BroV62TVImEvOyCoKtYk07J8hKkqn518Al+YOpvTiyS1hZ4gnHNuf1jF2rcn1Jn1e9v5X0nykRAFI3YQr585fKSGENSF7goLL9OqphWoOYJ3hlYrsWin3MKaIu1QggLkUOhasFO8+Oyi1kjRL7AW98IWABugESTpOKNhS7LLu38= 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 1693228308859247.94433644128173; Mon, 28 Aug 2023 06:11:48 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-488-IeBPYBRiNcGEA5yy7M7fHw-1; Mon, 28 Aug 2023 09:11:44 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A90F800CB4; Mon, 28 Aug 2023 13:11:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD864492C13; Mon, 28 Aug 2023 13:11:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CCC5E19465BB; Mon, 28 Aug 2023 13:11:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B4A0F1946A5A for ; Mon, 28 Aug 2023 13:11:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9A56E2166B28; Mon, 28 Aug 2023 13:11:31 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23E432166B25 for ; Mon, 28 Aug 2023 13:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693228307; 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=0O0fOx2jrCCp5IHLhC65rhOkmijL2zxYdfG31MSeVLE=; b=euSYv5RpyC8UqUmzEXSWNePnCneJixaEX0+vCmnks32MoJBuo3FDW2c9nvmEmP1sMZlcQ2 0dvLVI6rMVLga0hURVoOgv3YALEEjgMfn2mUKL1QfT1SrHSKyXIyVF/5Ftq+wkuXw4oPC8 euPug+H0tNNZDqO9njyGQYwMO9sR/I8= X-MC-Unique: IeBPYBRiNcGEA5yy7M7fHw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/9] qemu: process: Probe machine type data on reconnect to qemu Date: Mon, 28 Aug 2023 15:11:21 +0200 Message-ID: <7c863d27d0ccbb008b1927f8c397bfc02db83b07.1693227408.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1693228311295100001 Content-Type: text/plain; charset="utf-8" When reconnecting we populate only the capability flags from the XML as we need to know the exact flags that were present when starting the VM. On the other hand the machine type data is not stored as it wasn't really used after startup. While storing all of the data into the status XML would be theoretically possible, with machine-type specific data it makes no sense to do so, and thus the data can be re-probed from the current instance. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_process.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a6ed69cfe2..3e1198a564 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8816,6 +8816,38 @@ qemuProcessRefreshCPU(virQEMUDriver *driver, } +/** + * qemuProcessReloadMachineTypes: + * + * Reload machine type information into the 'qemuCaps' object from the cur= rent + * qemu. + */ +static int +qemuProcessReloadMachineTypes(virDomainObj *vm) +{ + qemuDomainObjPrivate *priv =3D vm->privateData; + bool fail =3D false; + + qemuDomainObjEnterMonitor(vm); + + if (virQEMUCapsInitQMPArch(priv->qemuCaps, priv->mon) < 0) + fail =3D true; + + if (!fail && + virQEMUCapsProbeQMPMachineTypes(priv->qemuCaps, + vm->def->virtType, + priv->mon) < 0) + fail =3D true; + + qemuDomainObjExitMonitor(vm); + + if (fail) + return -1; + + return 0; +} + + struct qemuProcessReconnectData { virQEMUDriver *driver; virDomainObj *obj; @@ -8950,6 +8982,11 @@ qemuProcessReconnect(void *opaque) goto error; } + /* Reload and populate machine type data into 'qemuCaps' as that is not + * serialized into the status XML. */ + if (qemuProcessReloadMachineTypes(obj) < 0) + goto error; + if (qemuDomainAssignAddresses(obj->def, priv->qemuCaps, driver, obj, false) < 0) { goto error; --=20 2.41.0 From nobody Sat May 18 13:36:57 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=1693228305; cv=none; d=zohomail.com; s=zohoarc; b=D7AT89DEeNdd8/h64rfSK0vARQmASARwJHnUIHd4Fw/RvuKC44MrwHh83RdB/Itx1EnxQfL6UhrGdYIz2FeVQHmU3RlZ8UK6ftvPeDiIRGp5tGaZFCuVmhaPQmghwr2xu+EOnuE6eUPE71/JqGAyDv6gLVViITXXsFOvYtSvNUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693228305; 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=kA1nygtspkiec//Vrji0YgHtsfYAPgpvFPpSJMijaXU=; b=f40l23q3JraGXEbfFFTFYFujKupF0dT4ZhLdOnzPZEbW9PPj25ZDmVK8cpKUVkS5Cl4LYx2tNG+Ln1zJYdlgDsnRlYTkBknhyvHBY9qEo3xYR9BLOI1XLZo/Mi219Wq5RrWNIgg3fLIegk5Sx5MjwJmMtLg9y5+K6WhHW+6dx28= 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 1693228305923234.40248259525254; Mon, 28 Aug 2023 06:11:45 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-h8ITtSksNTSOJgatHNdUwg-1; Mon, 28 Aug 2023 09:11:37 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C929A185A7A3; Mon, 28 Aug 2023 13:11:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 572EB112131E; Mon, 28 Aug 2023 13:11:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2145A19465B6; Mon, 28 Aug 2023 13:11:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9BE7819465B3 for ; Mon, 28 Aug 2023 13:11:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6F9972166B27; Mon, 28 Aug 2023 13:11:32 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7A002166B25 for ; Mon, 28 Aug 2023 13:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693228304; 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=kA1nygtspkiec//Vrji0YgHtsfYAPgpvFPpSJMijaXU=; b=iBzECTyEZmUNo4+K70UbqtlBaZ/E3TzK9ffVQbUYmgMR7M1plUUeIdTm5OpCEwT7ZXZ2g7 QumMnRG0G/AiaZX4oHUq1839dfTYmyBuR9IyJRCc5Rz4uGbXHzeO2WJ2UC9jFG7I1dV2/i 9FzxWdJrjAFbSRznKAfUw7cN1osUmb0= X-MC-Unique: h8ITtSksNTSOJgatHNdUwg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/9] qemuxml2argvtest: Modernize 'cpu-hotplug-startup' case Date: Mon, 28 Aug 2023 15:11:22 +0200 Message-ID: <32f04a00df5519e3597ebd647b0184ea812d2279.1693227408.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: 1693228307771100004 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- ...args =3D> cpu-hotplug-startup.x86_64-latest.args} | 14 ++++++++------ tests/qemuxml2argvtest.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) rename tests/qemuxml2argvdata/{cpu-hotplug-startup.args =3D> cpu-hotplug-s= tartup.x86_64-latest.args} (55%) diff --git a/tests/qemuxml2argvdata/cpu-hotplug-startup.args b/tests/qemuxm= l2argvdata/cpu-hotplug-startup.x86_64-latest.args similarity index 55% rename from tests/qemuxml2argvdata/cpu-hotplug-startup.args rename to tests/qemuxml2argvdata/cpu-hotplug-startup.x86_64-latest.args index a870d56792..009c08d71a 100644 --- a/tests/qemuxml2argvdata/cpu-hotplug-startup.args +++ b/tests/qemuxml2argvdata/cpu-hotplug-startup.x86_64-latest.args @@ -9,12 +9,14 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ /usr/bin/qemu-system-x86_64 \ -name guest=3DQEMUGuest1,debug-threads=3Don \ -S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/var/lib/libvirt/qemu/d= omain--1-QEMUGuest1/master-key.aes \ --machine pc,usb=3Doff,dump-guest-core=3Doff \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ -accel tcg \ +-cpu qemu64 \ -m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ -overcommit mem-lock=3Doff \ --smp 1,maxcpus=3D6,sockets=3D3,cores=3D2,threads=3D1 \ +-smp 1,maxcpus=3D6,sockets=3D3,dies=3D1,cores=3D2,threads=3D1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -display none \ -no-user-config \ @@ -23,9 +25,9 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ -rtc base=3Dutc \ -no-shutdown \ --no-acpi \ -boot strict=3Don \ --usb \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6e63f8a2eb..1e6cbbf028 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2513,7 +2513,7 @@ mymain(void) DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-invalid-address-type"); DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-invalid-address"); - DO_TEST("cpu-hotplug-startup", QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); + DO_TEST_CAPS_LATEST("cpu-hotplug-startup"); DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("cpu-hotplug-granularity", "ppc64= "); DO_TEST_CAPS_LATEST("virtio-options"); --=20 2.41.0 From nobody Sat May 18 13:36:57 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=1693228310; cv=none; d=zohomail.com; s=zohoarc; b=PmC1vQuIDiW3+3WPXkC/l0tzx3oKtRm+aFzTpzJ2943gb5xvOSslURgO6ntP17oqaC2AU7tt86XGRVScpEp/hUjcdeUudHq6CIRsIsqtarDtKw86oW9pyh1J9VtGZ8kmcEpCSJ9upKHNe8TumJvxERIAJzNJIAy05jlliBxrvmo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693228310; 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=s1FDo8TiM7N99f4CCGV0DEu6JZQXL6TyX5ks+45iGcY=; b=YBvSHCHEu85UZ910I2Xc6WszmvBqg1m4W4YN3XB4E6zreYyoqj7e4E7Pki12q4mcw4mSbe2N/F3qJey4z65LifU0vJVQukFobcYgtoy/ngupzu9iXSmiwSBSGDkSOjVDznTydS9DQG31l39JlIKlc3OowICljK640KW4TZC7pss= 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 1693228310245576.4385506667402; Mon, 28 Aug 2023 06:11:50 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-272-ktlNkexwN6-nEdXhSa-Srw-1; Mon, 28 Aug 2023 09:11:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 111128D40D7; Mon, 28 Aug 2023 13:11:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F38C91121319; Mon, 28 Aug 2023 13:11:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 56AE219465B9; Mon, 28 Aug 2023 13:11:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 66FB41946A67 for ; Mon, 28 Aug 2023 13:11:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 43E892166B2C; Mon, 28 Aug 2023 13:11:33 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9B3C2166B25 for ; Mon, 28 Aug 2023 13:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693228309; 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=s1FDo8TiM7N99f4CCGV0DEu6JZQXL6TyX5ks+45iGcY=; b=bo+YJhdoGRwamsm9X7dOgwvXr+tmYYUB9ez9j3n2Nv/V4dbLXQBKE+mdnoAtOgtU9kZCrK 0nyZ+h9s8jSTv1IiE5MO5KwCgGGWcrBkvYWWM1cDWlN4rrSmVXg4WUhYGJDNX+1agVSU2Y uQxY7YyuqfmZ9fgY271AdG/pj18QHy8= X-MC-Unique: ktlNkexwN6-nEdXhSa-Srw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/9] tests: qemuhotplugtest: Fix arch-specific parts of 'ppc64' test XMLs Date: Mon, 28 Aug 2023 15:11:23 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: 1693228311648100005 Content-Type: text/plain; charset="utf-8" The tests were using a copy of a x86_64 based XML and thus 'qemuhotplugtest' was selecting wrong capabilities to use for that specific test. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- .../ppc64-modern-bulk-domain.xml | 4 ++-- .../ppc64-modern-bulk-result-conf.xml | 18 ++++++++++-------- .../ppc64-modern-bulk-result-live.xml | 19 ++++++++----------- .../ppc64-modern-individual-domain.xml | 4 ++-- .../ppc64-modern-individual-result-conf.xml | 18 ++++++++++-------- .../ppc64-modern-individual-result-live.xml | 19 ++++++++----------- 6 files changed, 40 insertions(+), 42 deletions(-) diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-domain.xml b/tests= /qemuhotplugtestcpus/ppc64-modern-bulk-domain.xml index cc0322762a..f7c754ccf7 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-domain.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-domain.xml @@ -5,7 +5,7 @@ 219100 32 - hvm + hvm @@ -15,6 +15,6 @@ restart destroy - /usr/bin/qemu-system-x86_64 + /usr/bin/qemu-system-ppc64 diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml b/= tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml index afb2c85bc2..ad11b2f8a6 100644 --- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml +++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml @@ -39,11 +39,11 @@ - hvm + hvm - qemu64 + POWER9 @@ -51,16 +51,18 @@ restart destroy - /usr/bin/qemu-system-x86_64 - -
+ /usr/bin/qemu-system-ppc64 + +
+ + + + - - -