From nobody Sat Feb 7 23:25:36 2026 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=1670242665; cv=none; d=zohomail.com; s=zohoarc; b=eCiXKMoJFIa4VJZdBMvdJ1wSJOy5E4PsERbjIH4nmQ5I5EGpV0zv/9kpERK4FdFwYZmll6cgJT0mD1ONpXnGNIt+7UzzGQ8HQR+HXRbKJWxV3nLjR5GYCUO7pArw+y/N/Nr3+haugi5J4Q7wCH9rQpNDo43cUg/mx+SWKq2AdlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670242665; 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=INOCiJI7xBNfyOXKHThcZZ1Lu8AsG9C5Wd739QGyYLY=; b=XtZy5tnrk7k+u2PUUWYctkBtEQyx7nbY/ted+G4GG5llZgujGVzpvmutIk6eR2wxU//FPGKRyk7HPvRAB+IWtAZ0fIkTEAQ7RoIE3xscI7oMn3AaVRUPDipl0pregTIps2xRX5YhprJBVcDASYYBWSIiwD3mKYrl36lnkj+vjIo= 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 167024266561673.38032054086409; Mon, 5 Dec 2022 04:17:45 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-395-PMlibt6WO925AQwaTvKE5g-1; Mon, 05 Dec 2022 07:17:39 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E794438107B5; Mon, 5 Dec 2022 12:17:36 +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 CC0212166B29; Mon, 5 Dec 2022 12:17:36 +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 23BC6194658F; Mon, 5 Dec 2022 12:17:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9B6271946588 for ; Mon, 5 Dec 2022 12:17:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 80DD640C2089; Mon, 5 Dec 2022 12:17:33 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25B0040C206B for ; Mon, 5 Dec 2022 12:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670242664; 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=INOCiJI7xBNfyOXKHThcZZ1Lu8AsG9C5Wd739QGyYLY=; b=jHI5RJlL0zVFcdXDpYBQ7jKbikDTHIUPxAzA4dFS25SrRp9RBmJldStewIcUk7h5qQ34dD ExSSVA67X6xOpt5g7bVvCZyYA8fL8K3C16nv3J3f4SxTffC+Vycmghg+TtcxkkNJWPFUYA gFgDrwrZ2obfFviPw1pSSL/oKF2jYnw= X-MC-Unique: PMlibt6WO925AQwaTvKE5g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] qemu_process: Document qemuProcessPrepare{Domain, Host}() order Date: Mon, 5 Dec 2022 13:17:28 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.6 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: 1670242666466100004 Content-Type: text/plain; charset="utf-8"; x-default="true" The domain startup process is split into multiple phases. One of them is preparing the domain (at that point live) XML, private data, various paths, etc - see qemuProcessPrepareDomain(); the other prepares the host - see qemuProcessPrepareHost(). It's obvious that the domain XML preparation function must be called before the host preparation function (e.g. the host preparation might try to create a file which path is generated in the domain preparation phase). Nevertheless, let's document this expectation. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e1c18dde90..19b9242623 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6634,6 +6634,8 @@ qemuProcessPrepareChardevSource(virDomainDef *def, * start the domain but create a valid qemu command. If some code shouldn= 't be * executed in this case, make sure to check this flag. * + * This function MUST be called before qemuProcessPrepareHost(). + * * TODO: move all XML modification from qemuBuildCommandLine into this fun= ction */ int @@ -7151,6 +7153,8 @@ qemuProcessPrepareHostBackendChardevHotplug(virDomain= Obj *vm, * update live XML) to prepare environment for a domain which is about to = start * and it's the only place to do those modifications. * + * This function MUST be called only after qemuProcessPrepareDomain(). + * * TODO: move all host modification from qemuBuildCommandLine into this fu= nction */ int --=20 2.37.4 From nobody Sat Feb 7 23:25:36 2026 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=1670242664; cv=none; d=zohomail.com; s=zohoarc; b=A2dj3RyTA4lfU88hcF7vy8bBHoQx+v26cNgQ4uDw0wdEgkdUcTGmuBT044VeFJTIZGqB0/q4+rCUg7IubZeP+zChMNKgi34xAvZSVmnT2NvYoYQkKCptfG07wvh7ErMlbyV7VRbwQOQB9ZhuzNWq9Rec/fhSmtYwyubGLSBAY9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670242664; 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=L+wOugPU8PDpaR92w1Q/y8srce3X+lCAxBKy7BKYQHg=; b=mkxUbzsIPga4966/plIvcmgGADyp0had+Jqx2L4vnakojO8oxoOG2+WdIMMU59XmknCQ1lNkHjWHhWNYpPjsQUSxom4yleztMXqHHE89bEpzjsxjBHrXZTexW1snh5eef7VFFTagxNc6rYugFObDCsiV2fWkktq8wgfHimTdFN8= 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 1670242664882277.4477759506907; Mon, 5 Dec 2022 04:17:44 -0800 (PST) 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-361-D9ZdlZWzNWCMwjq4LNd8aw-1; Mon, 05 Dec 2022 07:17:39 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D2CF894E9D; Mon, 5 Dec 2022 12:17:36 +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 EE5652027062; Mon, 5 Dec 2022 12:17:35 +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 D4F6019465B9; Mon, 5 Dec 2022 12:17:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3C07D1946588 for ; Mon, 5 Dec 2022 12:17:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 204A940C2089; Mon, 5 Dec 2022 12:17:34 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id B91D340C206B for ; Mon, 5 Dec 2022 12:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670242663; 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=L+wOugPU8PDpaR92w1Q/y8srce3X+lCAxBKy7BKYQHg=; b=eLcIPXprjnExD/FQ9uXgpc6YxN5gHoj++ZpghMGDdB80Aazusa5p++tHjvEa6KySTNalca /gzjREdqfO+iDCiktBR3o9OQZOkEzG1pu7ZL60lTuz3o/KkD7Ydm/SfOvZzQhHZ0Sf7/P1 RLk7U2gN9FD0OF4EmFCKqYT1QSadPSA= X-MC-Unique: D9ZdlZWzNWCMwjq4LNd8aw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] qemu_extdevice: Init paths in qemuExtDevicesPrepareDomain() Date: Mon, 5 Dec 2022 13:17:29 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.4 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: 1670242666466100003 Content-Type: text/plain; charset="utf-8"; x-default="true" The path generation phase belongs conceptually into domain preparation phase and not host preparation. Move qemuExtDevicesInitPaths() call from qemuExtDevicesPrepareHost() into qemuExtDevicesPrepareDomain(). Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_extdevice.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index 3eaf6571a2..34454891f6 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -97,6 +97,9 @@ qemuExtDevicesPrepareDomain(virQEMUDriver *driver, int ret =3D 0; size_t i; =20 + if (qemuExtDevicesInitPaths(driver, vm->def) < 0) + return -1; + for (i =3D 0; i < vm->def->nvideos; i++) { virDomainVideoDef *video =3D vm->def->videos[i]; =20 @@ -134,9 +137,6 @@ qemuExtDevicesPrepareHost(virQEMUDriver *driver, virDomainDef *def =3D vm->def; size_t i; =20 - if (qemuExtDevicesInitPaths(driver, def) < 0) - return -1; - for (i =3D 0; i < def->ntpms; i++) { virDomainTPMDef *tpm =3D def->tpms[i]; =20 --=20 2.37.4 From nobody Sat Feb 7 23:25:36 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=1670242685; cv=none; d=zohomail.com; s=zohoarc; b=hffW6G3C1nvJk/cpBMvCDnYsByYXJbv90OpBZhMGtVPyFOxx2FMhf+QK1t0pFyiz7Uq6bz32qalIYxf9NekHT7IbrhwXy/EP0CRwkuAG/i1lmorLiWiZXX4q698wwdJ3jG1fPFOeAsLpHZq5YdYYbqB5aINtESJnXEVvotug41Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670242685; 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=UXBB+NGc5Eb2e0l5toESRLbUXGMgHF0AEy3y5bs3JnI=; b=LN11PGe3xi5Hn1iiehqRwY0hMhHlli06hNyioxJX2gJSOx8ErGnjf2tvdjUCCrwi05X3Bwf4j1f35uYjs+vNWmRdn67E1lmoZAQ0/kaylszlhLA+c64qSavC84SS58CkM/HxwhG5gjvDYXJJ1fkHIXU689+FRRwgd5qkwfdPtUU= 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 1670242685885847.7027812770593; Mon, 5 Dec 2022 04:18:05 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-114-ug1tloY-MUuisBY9_MRDNw-1; Mon, 05 Dec 2022 07:17:38 -0500 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 9FB631C07583; Mon, 5 Dec 2022 12:17:36 +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 6B06D4A927F; Mon, 5 Dec 2022 12:17:36 +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 480A41946A5E; Mon, 5 Dec 2022 12:17:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D00F719465B5 for ; Mon, 5 Dec 2022 12:17:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B598240C83DF; Mon, 5 Dec 2022 12:17:34 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 597C440C206B for ; Mon, 5 Dec 2022 12:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670242684; 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=UXBB+NGc5Eb2e0l5toESRLbUXGMgHF0AEy3y5bs3JnI=; b=Cg0Q05zkJo6GWAcZtt49XSGAeQzPJCPcrog24+jvwRKS8FclsBZHefg/Kw8HND1FPVRfFa 6IcVSb7iFGr6ln8MREA2ySC1yfxzD/t5uiGbvCGVyk3d4mOAIG/v1BrEIeFVrUGGmpZcW2 F5RX6Vr1RwjQlgJFbhUckY5Vbw3bIBU= X-MC-Unique: ug1tloY-MUuisBY9_MRDNw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] qemu_extdevice: Expose qemuExtDevicesInitPaths() Date: Mon, 5 Dec 2022 13:17:30 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1670242686575100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This function is going to be called outside of qemu_extdevice.c. Expose it to the rest of the driver. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_extdevice.c | 2 +- src/qemu/qemu_extdevice.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index 34454891f6..d5c3e8ed71 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -64,7 +64,7 @@ qemuExtDeviceLogCommand(virQEMUDriver *driver, * stored and we can remove directories and files in case of domain XML * changes. */ -static int +int qemuExtDevicesInitPaths(virQEMUDriver *driver, virDomainDef *def) { diff --git a/src/qemu/qemu_extdevice.h b/src/qemu/qemu_extdevice.h index 86e7133a2a..d4ac9f395c 100644 --- a/src/qemu/qemu_extdevice.h +++ b/src/qemu/qemu_extdevice.h @@ -30,6 +30,11 @@ int qemuExtDeviceLogCommand(virQEMUDriver *driver, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBU= TE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; =20 +int +qemuExtDevicesInitPaths(virQEMUDriver *driver, + virDomainDef *def) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; + int qemuExtDevicesPrepareDomain(virQEMUDriver *driver, virDomainObj *vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) --=20 2.37.4 From nobody Sat Feb 7 23:25:36 2026 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=1670242663; cv=none; d=zohomail.com; s=zohoarc; b=AQp6hAEbGMg3n1AbJeLxikkYl9i9Sl8Xgf7osu2ksE3Nz6pA7Zv2+/+NdHbc8cSsB/H6SYKLIu2d0s8acEc3Eh9fNtPkyIdpwZcJ6rqxiq2JydnqVaaofQrPqlV9rbP4end+w1eqgFep6QLletwUuOkmOxd0Vx9HBqTBPaYqTKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670242663; 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=1InW+faHZ+1GxTd2xcjvS1qhic7i3VUWKRopxI7N+4I=; b=c0vRLpbxeWka31ITUjMw+2KO6BqPp1XSfloFjbHjOiLfiqrHiH9FK11OGYa0LPVuvoU2P3N4asRIeCz6XvgaWzy/NtUXIz0bwwBWc6dhXjSbMF+2dURB2d9mALuHIjD1MkrBvPqlIZutgZarcfqJ5sOOdsrpUsZCBDuOYDqbCJ0= 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 1670242663218278.01698349683784; Mon, 5 Dec 2022 04:17:43 -0800 (PST) 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-481-TYXz6vV7P82TlTpOfpKo4Q-1; Mon, 05 Dec 2022 07:17:40 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4270085CE11; Mon, 5 Dec 2022 12:17: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 2849240C94CF; Mon, 5 Dec 2022 12:17: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 7F6DD1946597; Mon, 5 Dec 2022 12:17:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5FC881946A68 for ; Mon, 5 Dec 2022 12:17:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 555F540C2089; Mon, 5 Dec 2022 12:17:35 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED6B940C206B for ; Mon, 5 Dec 2022 12:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670242662; 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=1InW+faHZ+1GxTd2xcjvS1qhic7i3VUWKRopxI7N+4I=; b=VHmTtv4BmO7EsjCops6DCMw0FPpEwlqQaAWep+NuD1hNIL3wgrSh83gw4rVPPfqoRdhnIS 51JFfltDQDKlxUBQpiSOu/FilfL4lzNgVTS0mttBB0WebAGhl8sVj2lSGATtVmPWy1mHKe ZKq9YJDrpJkNNUMjC8U5e9PZkmWmcaI= X-MC-Unique: TYXz6vV7P82TlTpOfpKo4Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] qemu: Init ext devices paths on reconnect Date: Mon, 5 Dec 2022 13:17:31 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.2 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: 1670242664499100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Paths for external devices (well, so far only vTPM) are not stored in the status XML. Therefore, we need to regenerate them after we've been restarted and reconnecting to a running domain. Otherwise these will remain NULL which may later lead to a NULL dereference. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2150760 Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 19b9242623..c542be5036 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8896,6 +8896,9 @@ qemuProcessReconnect(void *opaque) if (qemuDomainMasterKeyReadFile(priv) < 0) goto error; =20 + if (qemuExtDevicesInitPaths(driver, obj->def) < 0) + goto error; + /* If we are connecting to a guest started by old libvirt there is no * allowReboot in status XML and we need to initialize it. */ qemuProcessPrepareAllowReboot(obj); --=20 2.37.4