From nobody Mon Feb 9 06:26:42 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 --- 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