From nobody Tue Mar 3 04:52:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1771416556; cv=none; d=zohomail.com; s=zohoarc; b=gZOXShfWy1A6SiZ+6Y+aE2XrtKKLQxqyyK/HOVPwvQhgGEPDRwUPpQVKxaitwcBWzo/4yyytulcwNLp0zIY+SYzvTgsFiee6RLXwrtBJL+5n2FuPOPaZ03qmqOmzd9e62llJHgCHTEgZPpHZAkHloVOff+1DzTsbdGoYJWWZL8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771416556; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=RRzA+CpCpEahTeJaCyAHM4BcMNTLXU6h2KF4ImQRlUg=; b=FGRZtM3sLz/6UMsqJqLpvjpHR/uMHARlZerk6JWPEqlrTOzkxGAxERhek3LJjkWqHlwvnZVGIYoPA3dII48g9yNFiwYYYy0DiQ6fPx12GPctuVxUqqmsfd6LYiBtZrKRFUK1snbp3ovtyBgLwfhL2F9v+gnul+M7vuQnWJ6lGFM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1771416555899944.3478492275789; Wed, 18 Feb 2026 04:09:15 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 21A4641A96; Wed, 18 Feb 2026 07:09:15 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 4E78E41B5D; Wed, 18 Feb 2026 07:06:18 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 371B94193C; Wed, 18 Feb 2026 07:06:13 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id AF6A7418F4 for ; Wed, 18 Feb 2026 07:06:12 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-569-LfhnecijPhi64IH7T--TmA-1; Wed, 18 Feb 2026 07:06:11 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 62EB9180025C for ; Wed, 18 Feb 2026 12:06:10 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (unknown [10.45.226.171]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 72C2330001A5 for ; Wed, 18 Feb 2026 12:06:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771416372; h=from:from: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; bh=RRzA+CpCpEahTeJaCyAHM4BcMNTLXU6h2KF4ImQRlUg=; b=iEBsh0hscysy2nqrCAPCIcpNAL2A5rXs+G5cPYW483aD/TvmOl3mp+4/m08IXBm+FJJxEb kiklLImVflkAO81FIwB1suQfp/ahfji19yNja44UzvEzfZBbkKqt0/YQdGRgwysJLRBF7M MeHyrGcxo9WKR7HCXI/VurmFA0cOOBs= X-MC-Unique: LfhnecijPhi64IH7T--TmA-1 X-Mimecast-MFC-AGG-ID: LfhnecijPhi64IH7T--TmA_1771416370 To: devel@lists.libvirt.org Subject: [PATCH v3 02/38] conf: Move type=rom default for loader to drivers Date: Wed, 18 Feb 2026 13:05:25 +0100 Message-ID: <20260218120601.230343-3-abologna@redhat.com> In-Reply-To: <20260218120601.230343-1-abologna@redhat.com> References: <20260218120601.230343-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 0McyHYUu_xW7e5auwjMisoTH4xxYw13xL3wuYjryasA_1771416370 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ON6LHYI2BYS5IZPURA6M3HEZRNDBRFKK X-Message-ID-Hash: ON6LHYI2BYS5IZPURA6M3HEZRNDBRFKK X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1771416556479158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Right now we set this default in the common parsing code, which is not a big problem per se but would get in the way of some upcoming changes. Leave this choice to individual drivers instead. Only the QEMU and Xen drivers use the value for anything, so we can limit the amount of code duplication this change causes. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_postparse.c | 19 ------------------- src/libxl/libxl_domain.c | 6 ++++++ src/qemu/qemu_firmware.c | 5 +++++ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c index 38e731348d..cbaae75c02 100644 --- a/src/conf/domain_postparse.c +++ b/src/conf/domain_postparse.c @@ -89,22 +89,6 @@ virDomainDefPostParseMemory(virDomainDef *def, } =20 =20 -static int -virDomainDefPostParseOs(virDomainDef *def) -{ - if (!def->os.loader) - return 0; - - if (def->os.loader->path && - def->os.loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_NONE) { - /* By default, loader is type of 'rom' */ - def->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_ROM; - } - - return 0; -} - - static void virDomainDefPostParseMemtune(virDomainDef *def) { @@ -1251,9 +1235,6 @@ virDomainDefPostParseCommon(virDomainDef *def, if (virDomainDefPostParseMemory(def, data->parseFlags) < 0) return -1; =20 - if (virDomainDefPostParseOs(def) < 0) - return -1; - virDomainDefPostParseMemtune(def); =20 if (virDomainDefRejectDuplicateControllers(def) < 0) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 9842d6fece..c6717e31cf 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -279,6 +279,12 @@ libxlDomainDefPostParse(virDomainDef *def, def->features[VIR_DOMAIN_FEATURE_ACPI] =3D VIR_TRISTATE_SWITCH= _ON; } =20 + if (def->os.loader && + def->os.loader->path && + !def->os.loader->type) { + def->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_ROM; + } + /* add implicit balloon device */ if (def->memballoon =3D=3D NULL) { virDomainMemballoonDef *memballoon; diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 519828f6f9..6a074055ca 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1662,6 +1662,11 @@ qemuFirmwareFillDomainCustom(virDomainDef *def) if (!loader) return; =20 + if (loader->path && + !loader->type) { + loader->type =3D VIR_DOMAIN_LOADER_TYPE_ROM; + } + if (loader->path && !loader->format) { loader->format =3D VIR_STORAGE_FILE_RAW; --=20 2.53.0