From nobody Mon Feb 9 10:32:29 2026 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 --- 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