From nobody Mon Feb 9 10:12:35 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=1656000970; cv=none; d=zohomail.com; s=zohoarc; b=XdnAfqSM/DAwTMeBWwy0WZjNKfT8inPJji5HVOIvN8ava3tjDGY2x1lMd3pwlv2urAFnFWAk//vj5ieGEOvQUm8JWCr0fOkrtSmquVFBrihdixCopkZ9iFbu7cCBfvqVodE7Vct4xsE32nxsgYl/5aE6KYYTVUs1xbyde3gL1rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656000970; 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=i58PtkfXAq4VIc2QvSf+dud/CH3DoJTfJT3Xyb9nT5E=; b=CEwfzlQCzLps3LoQWJxfVPWJIzXMap0T+V1y4j2Ut3sGhUAxAFzbWC4eTdj+T0JBx2o8vDpmtqi4i5NutnmoESZcXmr+jCvv8crVVaIO4o+2lhhtBIgzpFVkEtR80oxngvBxfCH0CmbVWZZErydghLD8WbrYkLFwvbSVZOZVmCU= 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 1656000970282139.13646835405996; Thu, 23 Jun 2022 09:16:10 -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-112-NV7qg1MxN5Wo1VifoJycHA-1; Thu, 23 Jun 2022 12:15:26 -0400 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 7E7938B0B0A; Thu, 23 Jun 2022 16:14:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 692FA2166B26; Thu, 23 Jun 2022 16:14:58 +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 ED15A194B959; Thu, 23 Jun 2022 16:14:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 341C8194B950 for ; Thu, 23 Jun 2022 16:14:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1412F1121315; Thu, 23 Jun 2022 16:14:56 +0000 (UTC) Received: from harajuku.homenet.telecomitalia.it (unknown [10.40.194.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 946471121314 for ; Thu, 23 Jun 2022 16:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656000969; 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=i58PtkfXAq4VIc2QvSf+dud/CH3DoJTfJT3Xyb9nT5E=; b=YzGWNlM4ZcIIrakB/CtDwi/i4J/bfe5U/8x7JzpQsYpRI3dBdtHEWr6ykNcKEXrArtKply aH848OB6+SmRP4h7GXG0OQs1l7qKpaJSbKGEiiP7tQ45mKQcVxn0uC9cXqQzwKPtwNlIZe ASh6+3ZGyt65ujdODPSB9qDicSu0vs8= X-MC-Unique: NV7qg1MxN5Wo1VifoJycHA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 17/28] conf: Enable secure-boot when enrolled-keys is enabled Date: Thu, 23 Jun 2022 18:14:29 +0200 Message-Id: <20220623161440.61653-18-abologna@redhat.com> In-Reply-To: <20220623161440.61653-1-abologna@redhat.com> References: <20220623161440.61653-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1656000971916100009 Content-Type: text/plain; charset="utf-8" The latter doesn't make sense without the former, so make that visible in the XML. Signed-off-by: Andrea Bolognani --- src/conf/domain_conf.c | 10 ++++++++++ .../firmware-auto-efi-enrolled-keys.x86_64-latest.xml | 1 + 2 files changed, 11 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9b82f391c4..3977b5040f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4876,6 +4876,16 @@ virDomainDefPostParseMemory(virDomainDef *def, static void virDomainDefPostParseOs(virDomainDef *def) { + if (def->os.firmwareFeatures && + def->os.firmwareFeatures[VIR_DOMAIN_OS_DEF_FIRMWARE_FEATURE_ENROLL= ED_KEYS] =3D=3D VIR_TRISTATE_BOOL_YES) { + + /* For all non-broken firmware builds, enrolled-keys implies + * secure-boot, and having the Secure Boot keys in the NVRAM file + * when the firmware doesn't support the Secure Boot feature doesn= 't + * make sense anyway. Reflect this fact explicitly in the XML */ + def->os.firmwareFeatures[VIR_DOMAIN_OS_DEF_FIRMWARE_FEATURE_SECURE= _BOOT] =3D VIR_TRISTATE_BOOL_YES; + } + if (!def->os.loader) return; =20 diff --git a/tests/qemuxml2xmloutdata/firmware-auto-efi-enrolled-keys.x86_6= 4-latest.xml b/tests/qemuxml2xmloutdata/firmware-auto-efi-enrolled-keys.x86= _64-latest.xml index aa08caa4f7..8dcc741c1e 100644 --- a/tests/qemuxml2xmloutdata/firmware-auto-efi-enrolled-keys.x86_64-lates= t.xml +++ b/tests/qemuxml2xmloutdata/firmware-auto-efi-enrolled-keys.x86_64-lates= t.xml @@ -8,6 +8,7 @@ hvm + --=20 2.35.3