From nobody Wed May 8 01:00:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1622827694; cv=none; d=zohomail.com; s=zohoarc; b=YeTJL36wj/kHAIqZCyHeN1Sy69xjyVW0PA13CxKG2P6on21LpCwBQjjjKW5Ay+dWU3F7yyjqHNcCPBruxG8B5RlUXGLbWIqAF3ZDxCzHvmdhEtuQmBjCJW73okq5g+K/xqt8RB1MCGk1Jniq99iwVrAXeSuZ2TcwK/7lGSJ1U88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622827694; 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=GOa4e8uDe/rndkR04MndL8m11Ycq5flKcohZMQ86ur8=; b=MH9QkwZie1Wl1MV6+LLsYLFUuxi4AK3HQStCLAdZBtWxDLI09HuUXIsJrVvnraZ/XM632J1EV3xkUUi5p/dJppPECRloflLb0gBBJkT5LvCo2yKMjl9wUJumEJuFi4keGKBKk5qbfJAaX6YtEurftlUKP7MXAnGC0OAaH5Whxk4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1622827694847557.8148524872031; Fri, 4 Jun 2021 10:28:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-449-HRH8cswIMPuD6aRIwrJBdA-1; Fri, 04 Jun 2021 13:28:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4626B10082ED; Fri, 4 Jun 2021 17:28:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D56A25C239; Fri, 4 Jun 2021 17:28:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8AC7144A58; Fri, 4 Jun 2021 17:28:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 154HS1sf019553 for ; Fri, 4 Jun 2021 13:28:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1EF6420149A2; Fri, 4 Jun 2021 17:28:01 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 17F6B20877D7 for ; Fri, 4 Jun 2021 17:27:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C392B80D0E1 for ; Fri, 4 Jun 2021 17:27:59 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-346-PqkAlbBhN2mv28HDvdPmkg-1; Fri, 04 Jun 2021 13:27:57 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2051.outbound.protection.outlook.com [104.47.6.51]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-31-kCU9KG1TNZm_-E6qINCimA-1; Fri, 04 Jun 2021 19:27:55 +0200 Received: from AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) by AM0PR0402MB3764.eurprd04.prod.outlook.com (2603:10a6:208:9::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20; Fri, 4 Jun 2021 17:27:55 +0000 Received: from AM8PR04MB7970.eurprd04.prod.outlook.com ([fe80::44f9:5a6e:fe98:1718]) by AM8PR04MB7970.eurprd04.prod.outlook.com ([fe80::44f9:5a6e:fe98:1718%7]) with mapi id 15.20.4195.024; Fri, 4 Jun 2021 17:27:55 +0000 Received: from localhost (192.225.191.61) by AM8P189CA0004.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20 via Frontend Transport; Fri, 4 Jun 2021 17:27:54 +0000 X-MC-Unique: HRH8cswIMPuD6aRIwrJBdA-1 X-MC-Unique: PqkAlbBhN2mv28HDvdPmkg-1 X-MC-Unique: kCU9KG1TNZm_-E6qINCimA-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH 1/3] libxl: Introduce domain def validate callback Date: Fri, 4 Jun 2021 11:27:46 -0600 Message-ID: <20210604172748.681-2-jfehlig@suse.com> In-Reply-To: <20210604172748.681-1-jfehlig@suse.com> References: <20210604172748.681-1-jfehlig@suse.com> X-Originating-IP: [192.225.191.61] X-ClientProxiedBy: AM8P189CA0004.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::9) To AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 048640a0-6ce4-4a0a-6d3e-08d9277e1696 X-MS-TrafficTypeDiagnostic: AM0PR0402MB3764: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: eTb7DuDAnasKQfoex2VgdWpmk51GG8B+CuBP5QI79HUuKRFkd6HDH4Pac14Hu5LnvHEc+V47oGHzGrbVVM6MJ4eH19yyIlC2lNg8xcD79//qK67umjLURPpormqV4uBS1o8Tn4NnJoWVGFLGMzfUkUnByiVjAvC2BLUSfb48J4D+N43X8+4AcSMaSO8R9RniNAQqns4Ppkov0QEja9a3+61Ghb77+FlUVgnhCSECtLUFw/hUj1A8Vf1/8m/F71mTirW0R2XEnGXmGOurNbbcbJeF2c2+5humKNxBTmS2gtZe/9YgcKCdtmHoQ+mIQG84BGIOuFcvjLpv2Qf0if3jfnYz8c3uVjsV2GqQg0/rrcKealN4wVDQ8Zs7sB8ZSlifajJPcsQ7bYge+fPpEEaMVzDaZSBL9cw93/Afy467dBv9FHduzPr7KVKp/7VSiWLVB2rT7P4WIegp9yfrhnlRHlUsV/qzpIZU0xI+USa2B/xiBuYjo5fa5+aewJc2zS5PHbIQe7lXT7oxROICGJ8czENGzMFoXsV1kM7HRaPwyo742OtNqtClwGMPr80+VXX2u9KKGZGa/uFpZotmd4vxh1VEjVrDeOuVNi9NwoZdwFc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR04MB7970.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(136003)(346002)(376002)(39860400002)(366004)(6496006)(6666004)(4326008)(107886003)(36756003)(86362001)(8676002)(38100700002)(16526019)(8936002)(186003)(478600001)(26005)(6486002)(2906002)(83380400001)(1076003)(316002)(5660300002)(956004)(66556008)(66946007)(2616005)(66476007)(6916009); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?0Y2hnWNbvULnrEJLQzGbqqRbEVD6yZ4a/vXDgp5diJsrY6tHw2UhMiEqKuVd?= =?us-ascii?Q?ppKDCto2a7Kw2LjO4eUYLoO8Wq8mupWysDpvfW/Jarxn3lmzlSrCyZ/H1j4j?= =?us-ascii?Q?u+14bgzWkODnVUCSHIgA448MnzRdnRRiez0zvxVOrN/qXNdPPHAgN6TdTWQn?= =?us-ascii?Q?UIj95sFLmtPjbEa9DMGP3Fl37ItKIz2eChj2rtJSLvmmzgq/qQcdnwfEFhgv?= =?us-ascii?Q?wBPqH5N5jfOUbhmggsjlW1c/QWSbMgxOxzHUPtIq+mlKl6VlFMaUvUSvoQ81?= =?us-ascii?Q?X0Ewpuqe+086sNyyb1HBjppTn4Z0R9qUMVnxBc3X6pop9+fvePgQOSZe3ch8?= =?us-ascii?Q?9152QmcmbQpqXV2XoOD48UB6O2zrXpiRSIT2Vd5oveSn+iosY4fjHtmx6FK4?= =?us-ascii?Q?BF/FmnNRq9J4X4LJTCZ3s8U2Rd7SUV46XlBX5V/HLrlIq6u7BBXmY9MRwajN?= =?us-ascii?Q?cVyN5mOcwNwVNd5eCrBuE8oSrgby19FMmieIQOe+172a231cfqZ3/7EBxC0P?= =?us-ascii?Q?wPaXgepI4t3S98gZISn8oIfyS/WocsNuffjxI7L/m7RnbLwIDPZoIenbV44K?= =?us-ascii?Q?RF62LfHrJls2it7bxPEmXBD4Z2xYcHK8FHmQR46HN6qJcpFG24UosoInBAgi?= =?us-ascii?Q?LuFeVveCLvdZTrhb8NsvHZSSWi09/fYh1J1O+die+Fj5N5IJ7ESVKOwW32hN?= =?us-ascii?Q?FZ36NOaSnnD86utDBL/8WpQFf9QJO9hMmt+TN1OzwCmB9axfAPGYs2BxAjK0?= =?us-ascii?Q?WpyI5fJockDMrO45QB6njkSa5iWmTnX4/FxFOQhUtyQKkb+uv957UHA8bsWF?= =?us-ascii?Q?TxJBtb7nW0zLz33R1dnjgAyju8CQPBTrf8r6q3uX20mxmuWI8XwiBym5j5SB?= =?us-ascii?Q?qeP9BtLNlfa7aRe31Y2n+sIcxXX59/0dT8AuV8jlOq2u5Bo6o3hyU5Zx6rUK?= =?us-ascii?Q?0+SOBJYIZWKkWz4YtLLvu2Q/JxFaorrcPvCSukt0reS/IqMhis0GWXUKk6AZ?= =?us-ascii?Q?rtB2dytIlciNjVRO+blPx6WO6fynDBorASjatZsJR19tXWpAaVNBe+siMnFi?= =?us-ascii?Q?apUH6Jci5u/xi78Ri7/H6oza9u+ZoyexdVQyD4kY4HfR8OTIiy4HZF+ZBUpN?= =?us-ascii?Q?cNTD3281TeKYQYyW1sBcdrWOTVZswoVhzJQ0HRA976tB/RgXic13d7I1T0+B?= =?us-ascii?Q?njJbmrmI4yYfn0ur0pTAWlc1G1GJpQE1tIoXUU5nIReNxU8TxqcwjENeFFdH?= =?us-ascii?Q?AXs8ZgkAiRH5JuYwzzbTefEANGSwEUu8bjn1/Ssz4oYLZ3IxWK/6/eiSm1v9?= =?us-ascii?Q?XW4WtYyOXJGCgcHmeAcQBCQf?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 048640a0-6ce4-4a0a-6d3e-08d9277e1696 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7970.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 17:27:54.9468 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kc/cTTjqcrGZ/GfECOMszrYBABnlvg13wogm2v0ZGOEnEVQ4nWYvwwSI5YqDeP0J+eaEZRNpvf1+CehNp9xZwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3764 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 154HS1sf019553 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 Content-Type: text/plain; charset="utf-8" Introduce libxlDomainDefValidate and move the existing validation check from libxlDomainDefPostParse. Additional validation will be introduced in subsequent patches. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libxl/libxl_domain.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 625e04a9b0..9630f12568 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -379,17 +379,9 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDef *dev, static int libxlDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, - void *opaque, + void *opaque G_GNUC_UNUSED, void *parseOpaque G_GNUC_UNUSED) { - libxlDriverPrivate *driver =3D opaque; - g_autoptr(libxlDriverConfig) cfg =3D libxlDriverConfigGet(driver); - - if (!virCapabilitiesDomainSupported(cfg->caps, def->os.type, - def->os.arch, - def->virtType)) - return -1; - /* Xen PV domains always have a PV console, so add one to the domain c= onfig * via post-parse callback if not explicitly specified in the XML. */ if (def->os.type !=3D VIR_DOMAIN_OSTYPE_HVM && def->nconsoles =3D=3D 0= ) { @@ -441,11 +433,28 @@ libxlDomainDefPostParse(virDomainDef *def, return 0; } =20 +static int +libxlDomainDefValidate(const virDomainDef *def, + void *opaque, + void *parseOpaque G_GNUC_UNUSED) +{ + libxlDriverPrivate *driver =3D opaque; + g_autoptr(libxlDriverConfig) cfg =3D libxlDriverConfigGet(driver); + + if (!virCapabilitiesDomainSupported(cfg->caps, def->os.type, + def->os.arch, + def->virtType)) + return -1; + + return 0; +} + virDomainDefParserConfig libxlDomainDefParserConfig =3D { .macPrefix =3D { 0x00, 0x16, 0x3e }, .netPrefix =3D LIBXL_GENERATED_PREFIX_XEN, .devicesPostParseCallback =3D libxlDomainDeviceDefPostParse, .domainPostParseCallback =3D libxlDomainDefPostParse, + .domainValidateCallback =3D libxlDomainDefValidate, .features =3D VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, }; =20 --=20 2.31.1 From nobody Wed May 8 01:00:44 2024 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1622827704; cv=none; d=zohomail.com; s=zohoarc; b=MG0F0CQ6FGyqsJtbKiv5kQSwv+9RAtd8uI8JDLzujK2Z5mfR0tyoWFmXXAIxFBg/hAXU6N9n0s7OAZdIvtAhYh26h/W3FDDGjhkuw6ydC1sBV3sai3hRHVMkVoJnSZFa6bZfMiEP65GTJI58FYbPj6N9yFw88TvYuduu+ohQFPY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622827704; 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=JNSgRIxtna08BINNZmB6hgk0gxiwuqJFAa0hACLP2N0=; b=X2JyhbT4mJYuyMa9VW3SieIngyHlFaApcayW8dFFvA0Q13fFCcnxhYGgxTaV0Q7A7ZjXgO9GDwUiQIEvISHKJ27i5KIibwuEsrv2tCBojLBw7l8XkJK9B9DRTGtFL/t2Wsj7nAeHuygME3xCPPJN+snz3ao3cQixBgJgWJhGuuw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= 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 1622827704144891.4565600065478; Fri, 4 Jun 2021 10:28:24 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-waPysYopO-yNi1vcubyF0w-1; Fri, 04 Jun 2021 13:28:19 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93BA5803F50; Fri, 4 Jun 2021 17:28:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 603415D705; Fri, 4 Jun 2021 17:28:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1E0931800BB8; Fri, 4 Jun 2021 17:28:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 154HS7A7019579 for ; Fri, 4 Jun 2021 13:28:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2806E10C6EAD; Fri, 4 Jun 2021 17:28:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 231AF10C6EAB for ; Fri, 4 Jun 2021 17:28:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 71FB880D0E4 for ; Fri, 4 Jun 2021 17:28:03 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-330-WzoP9sxPO56cys0OsnYbjg-1; Fri, 04 Jun 2021 13:28:01 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2109.outbound.protection.outlook.com [104.47.18.109]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-14-yiUmwwZPNPGeUKk9YLQiJg-1; Fri, 04 Jun 2021 19:27:59 +0200 Received: from AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) by AM8PR04MB7905.eurprd04.prod.outlook.com (2603:10a6:20b:235::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Fri, 4 Jun 2021 17:27:58 +0000 Received: from AM8PR04MB7970.eurprd04.prod.outlook.com ([fe80::44f9:5a6e:fe98:1718]) by AM8PR04MB7970.eurprd04.prod.outlook.com ([fe80::44f9:5a6e:fe98:1718%7]) with mapi id 15.20.4195.024; Fri, 4 Jun 2021 17:27:58 +0000 Received: from localhost (192.225.191.61) by AM8P189CA0029.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23 via Frontend Transport; Fri, 4 Jun 2021 17:27:57 +0000 X-MC-Unique: waPysYopO-yNi1vcubyF0w-1 X-MC-Unique: WzoP9sxPO56cys0OsnYbjg-1 X-MC-Unique: yiUmwwZPNPGeUKk9YLQiJg-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH 2/3] libxl: Forbid domain definition with secure boot enabled Date: Fri, 4 Jun 2021 11:27:47 -0600 Message-ID: <20210604172748.681-3-jfehlig@suse.com> In-Reply-To: <20210604172748.681-1-jfehlig@suse.com> References: <20210604172748.681-1-jfehlig@suse.com> X-Originating-IP: [192.225.191.61] X-ClientProxiedBy: AM8P189CA0029.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::34) To AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6de80fb1-ac1f-4936-e1ec-08d9277e18b8 X-MS-TrafficTypeDiagnostic: AM8PR04MB7905: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:27 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: 843Engm2cnERIVSAWeyCv1Bd4iTOW8VZXardplIFVFXy3U5t2EjdNAEsjENvoGxn07zkujnQwVvIRxtUUKt39j8mK/Zp5lpHFdmk6ASYzp1lXpK66ND4iReF0Hq1Qx6mD8rcQWf8kuvkyHdGcRJzxcP6vdnncRykMfWZmSv0hQAJ8yhUCrHcNfGzPBxFQb83tvm4I/vRMi3LDxR9NK0iqoxEA1LeC2RfvSy4te5qhEmCpX0V0o2rHq1PKX/SllYyugY+IpfYMAdjLVB47e5FqmeadHdnJz/gmmsk1C6heb0+gTG/bVpy9VsGd+hXB1WnP4lMIY0tLfmLluNG+dbbNmIwW4YrrJ38ujRdxubZuIL47eObBq57xFhErQ0Iah9zE1lQ/wE1i+0itkoA2NuMj41akbhaYonnUTuBxWV/CJwWFdM/xDvYUUe3+5JLng0SKpbTyBQB4+HEn6gppGMMyICzgDwWPdIs0OQgntdRfDSoMFWQtB+q/tjPBTz4uxaOWtqXsSLm7GGw1lJoFqwHnyC4cYTh0HU8SSHSc7gGIwFJ/CXK7/ccqaLkoIrG5j2jmaIG4RSxeVsAfHJByVmoqg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR04MB7970.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(376002)(346002)(366004)(39860400002)(136003)(107886003)(4326008)(16526019)(83380400001)(66476007)(2906002)(66556008)(186003)(26005)(6666004)(66946007)(478600001)(4744005)(8936002)(8676002)(5660300002)(2616005)(316002)(956004)(38100700002)(36756003)(6496006)(6486002)(6916009)(86362001)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?eKphC3EXqiPFHKcTcxFToTTNm/daFDpt7QX24GtHCJoy2UpHgBgC5J7z9F3P?= =?us-ascii?Q?lVWmiR3pVxHvEUSuGB4I8nw1ZOimi6FBeDzcg8EjGbaQiAt/BuDAWn2vRXz3?= =?us-ascii?Q?g8nqitBM1X9sylslbKgp78HBec/fm9O2bLdK/H/AWBKIysQEN11IjyANvGyQ?= =?us-ascii?Q?jXGUaDOOblYIY5EmRN02UAKQBxKIEym552FyZ7Cmb1LMr3MU3hwdFnXy+sa5?= =?us-ascii?Q?6rYifUcEpqTC8ajCrxwHzt9yAIpAVnKLkPn4g8b/X9H5o1ZvWpk0ZF6rSH/X?= =?us-ascii?Q?I8xisVpNI2KdZeVRpGWmjTyR+A1sEa3vAyfdqwa13fmDTmVmWtXykpkD7RAk?= =?us-ascii?Q?2YVGaIgrgGrKDLF/ubPfDRrQvlmYYPlit0vMnJpsOY3cyS/x//eIKjKr4KcJ?= =?us-ascii?Q?FqEwkDGOyAnAGdkjQeUNHOWRCqmmaz730W/K2lvSXj5xEq6J2K0rsc78n4XI?= =?us-ascii?Q?W6d653JT1ShBzrpuNAe/ob7SYSpRZdUtsdIBMrcMEnNpsRCwUy8xy/T/U6p7?= =?us-ascii?Q?YWAbdbLdys9s/bfl1i2fs4JlkqISRgi7FXcYGid2My+DB8IoDODl+C/fF5J7?= =?us-ascii?Q?4jGZY04MzicRA3LvM3JUp1L+FK3fWTACnw+TVYzTXdo7qyXH3UjfQbpcf3LJ?= =?us-ascii?Q?+D2QEaCliENGi9sKL1+66VqiM8tB1zGvyYGDE2o/R+x+p6WhItovPP87Q3eM?= =?us-ascii?Q?wGkEfH3xLDeEx3FmmiiFzvXNIEkOvP+HQF+NRH0+CDIplwWzQFZBk2Byotme?= =?us-ascii?Q?PGnZvjcBksneysV9tOtqS+WPc1kX0C2abarIukyuMXrSzyChSn7bNjb29Uut?= =?us-ascii?Q?IPrlgE0YTqvTPqcgpElk68fkE7vjqPikwTNx3b20V+mouZAFuPCaSeTA1LoH?= =?us-ascii?Q?JULmEX+Q3pS+JLEGzQRxyG2WukGShQjSJze6lHZJiAC0BFE3hYYGl4c2mOwa?= =?us-ascii?Q?FE0epgKBfDOZijCETUVjkul/xnFdfXXAGxTRtIaQPY25Nc/d1MzPyScPNLhJ?= =?us-ascii?Q?TfJWLL880FIH/QZO0grDjY8QDpU23N3GbpnUaidhKbFri/a63Mcqcjl4knTX?= =?us-ascii?Q?KQ9wBhFZycnB2YHZOXOchbO4vDUe1wFWf7YkCTcCrIVcBkFxt3+5v4PK7F5G?= =?us-ascii?Q?+ILauY93TAmRfoz/zwrQiQuZ6/5ov+qVgfVd21Cb5f9+R1QkMsPtXyQUiRW8?= =?us-ascii?Q?49ofL9d9a+/QRvAAFNu8LwWs60ND2PKrnDZo+tPpZ9VPJk1hrbbMosc10SMp?= =?us-ascii?Q?VMBQWvQsTV8x7HpnFqkgNYpx/xhpxPNqUjbaA/zPP3y8IVQlozrLpqzVvGCM?= =?us-ascii?Q?imWSA97kaafWJopBxOQnooFH?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6de80fb1-ac1f-4936-e1ec-08d9277e18b8 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7970.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 17:27:58.4833 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JIKk0LMr1SSu3gitioRqWOyxOrqOEeLamYQeQYPS0xZ1c+Fk/0r26q9e6CO6pREwavsQyHxyUdXF3Xx74AYP/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7905 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 154HS7A7019579 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Content-Type: text/plain; charset="utf-8" Xen+ovmf does not support secure boot. Fail domain def validation if secure boot is enabled. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libxl/libxl_domain.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 9630f12568..14d000511a 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -446,6 +446,16 @@ libxlDomainDefValidate(const virDomainDef *def, def->virtType)) return -1; =20 + /* Xen+ovmf does not support secure boot */ + if (virDomainDefHasOldStyleUEFI(def)) { + if (def->os.loader && + def->os.loader->secure =3D=3D VIR_TRISTATE_BOOL_YES) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Secure boot is not supported on Xen")); + return -1; + } + } + return 0; } =20 --=20 2.31.1 From nobody Wed May 8 01:00:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1622827709; cv=none; d=zohomail.com; s=zohoarc; b=nj54wZov48SHcps4TuTIZBag58P/P+JFboRk+950vlmIepdwhenNZuK7RI1v47c+UcmfqtkurH7glVuErG+dmr3F7lJSqOguLP/G7g/Z9UUkkx8p++03pfIJ5uruk6xbTjt6vaaMQz8G0lV4sTRSBLGbJeCEEvML7jDb2K1/YwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622827709; 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=Fo8yx3Iuw3ALJpADIx2OqzMDzKOnse5IIUxx/ACdGxE=; b=Z35Sv9D5QfQTBdP86z/aesNPpmEdknraLBhLYnF3zHLdcdscKuFtfKCNrNwEzEo388zlH3bDwGzOzrGphY5clf2N9YsLMeWo1PmM1nHvVSjo//+14n4L4IkyFgIqec6j0vDjk678m7ypKpZdBcfymUL5le32tfCuJQBojxNPt+g= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1622827709107442.71954063389023; Fri, 4 Jun 2021 10:28:29 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-563-5oV4Irf2P12drM3kChqJyg-1; Fri, 04 Jun 2021 13:28:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 87E118042C1; Fri, 4 Jun 2021 17:28:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6393C5C26D; Fri, 4 Jun 2021 17:28:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 331F544A5D; Fri, 4 Jun 2021 17:28:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 154HSAst019590 for ; Fri, 4 Jun 2021 13:28:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5738E12160F; Fri, 4 Jun 2021 17:28:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E75E120EBA for ; Fri, 4 Jun 2021 17:28:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07BB7101D220 for ; Fri, 4 Jun 2021 17:28:07 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-252-WuVtHEagMGqO5b9Kpg8LUQ-1; Fri, 04 Jun 2021 13:28:04 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2110.outbound.protection.outlook.com [104.47.18.110]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-20-HXZh1M_VMqOctIQUfTE8AQ-1; Fri, 04 Jun 2021 19:28:02 +0200 Received: from AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) by AM8PR04MB7905.eurprd04.prod.outlook.com (2603:10a6:20b:235::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Fri, 4 Jun 2021 17:28:02 +0000 Received: from AM8PR04MB7970.eurprd04.prod.outlook.com ([fe80::44f9:5a6e:fe98:1718]) by AM8PR04MB7970.eurprd04.prod.outlook.com ([fe80::44f9:5a6e:fe98:1718%7]) with mapi id 15.20.4195.024; Fri, 4 Jun 2021 17:28:02 +0000 Received: from localhost (192.225.191.61) by AM8P189CA0021.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.15 via Frontend Transport; Fri, 4 Jun 2021 17:28:01 +0000 X-MC-Unique: 5oV4Irf2P12drM3kChqJyg-1 X-MC-Unique: WuVtHEagMGqO5b9Kpg8LUQ-1 X-MC-Unique: HXZh1M_VMqOctIQUfTE8AQ-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH 3/3] libxl: Support firmware autoselection Date: Fri, 4 Jun 2021 11:27:48 -0600 Message-ID: <20210604172748.681-4-jfehlig@suse.com> In-Reply-To: <20210604172748.681-1-jfehlig@suse.com> References: <20210604172748.681-1-jfehlig@suse.com> X-Originating-IP: [192.225.191.61] X-ClientProxiedBy: AM8P189CA0021.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::26) To AM8PR04MB7970.eurprd04.prod.outlook.com (2603:10a6:20b:24f::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db42dc4f-1c55-4f47-4aa0-08d9277e1af7 X-MS-TrafficTypeDiagnostic: AM8PR04MB7905: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:741 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: ZFc9lbPPCy1t+joDwsSIPRRXqwgFS2yg62ExTm7fVCoIqCnoioz/M9fQtVlvtErO1Fpt8mb63SWLpAhF6L7hU17ZFbChM9O1j3XYLiLbmefHgTZY12Fitn6WQ/XCqWTSfHfHmQbkolHFMdyPqHXlDcMfbNjM+592LrbLf0tb/abD82/Zc/Iu6iPmAyaeGH1Re7H4ioV9o9gTaaYAFeYs4Xm7CjBswi2pMf5oUJkrqgAhgia9ev+1KYndg7MWNl1cRYFumvBRNWQvzlSl3PHdjRji36NHrx6BuNOuN1AHXxZyURnPpnNvCIlQmZkaPSzY4D5hJJ2s1OFH5fo3lHOi//EK72fbdbiOdTXrxctrLqMXSsx1lH1qALEOY4sLQiLRzK1N67X85zBTlV7zT3Dos3s47iwvC4JzKl9otuxpoujA+fvOx3tVMxeymXNqJePy3Z1EfcwO6nLVHbEEQnIJgsXA6XiTpgGrgUHw6MhbJp5VFqh6Q3f2q/QVQcN1zajtlyxEuGf2lGdTTscdkkCRTpn+eNJY2UlgCFzLiMU0EG6s71tTYBsaGXor4XjVaUq4LLM3TlFVtocUhwJ51BqrHJvtnomfjKqY0iGc/ljZGxYsrK4Sm9Fg6eJ5SQF6ezV3jq0976VnJBM+8z0AMK+tqMb+ZqewMFcbvQOq+J6PpgtNlCMy3EzXy3DOboENfu+NOn+Qg3LKdu74H01yqDEC6w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR04MB7970.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(376002)(346002)(366004)(39860400002)(136003)(107886003)(4326008)(16526019)(83380400001)(66476007)(2906002)(66556008)(186003)(26005)(6666004)(66946007)(478600001)(8936002)(8676002)(5660300002)(966005)(2616005)(316002)(956004)(38100700002)(36756003)(6496006)(6486002)(6916009)(86362001)(1076003); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?7kh6BcnAO14o1shfs/0ft/4lOILeS3XWvfrs1+8LkY8Ujp0+8VO3F+Y0UBcJ?= =?us-ascii?Q?nM27gMC49LM2vyfk4hhc0g6Ktnmn4HO7NMk5VTd7U4at5SFDzxPPREQAzn86?= =?us-ascii?Q?nuRm3JAfPI8j3UmGlf08AKj+ciHbsq/HPeWKlYigwkkYOfw4jWmsv5PUSxoW?= =?us-ascii?Q?CqYIAgbaDd0DIihs0SKCr6P5AZKFkXAh682vcs805YGGHg3CCnVQKY6bJSIL?= =?us-ascii?Q?3fIYVV20wypxiv2nOPEMv2xj3h0Kfs1eP/UnUOCpNFGxaTjilvUJeQHewIfY?= =?us-ascii?Q?zfdSoxS0zHn/V66M5bAQsvvbBuWI2MOpslYrc1NnA3m35TFgXwcssCQeV8mi?= =?us-ascii?Q?O5XAtgkvcpja5yNfm1U5pBLZ9+v2pCXDY3MvQG0uK9vUowxzzkUke9NSKKr8?= =?us-ascii?Q?ZvbtsI/FS2q0ew3+gsrO2DsiOX4GoiIMqW8wBY0vnPrCJnCaLWNW6DOUWWIM?= =?us-ascii?Q?8GE77efGoH0IQ4gJ0u9+7dVGidvwPYqRKR0qBZL4/hm0Qg5/RL/i6Zm+w7om?= =?us-ascii?Q?o/yhzb7oEhrkK01Q1NmqEYj50EA9Sll0OEI1MaDIWGfdPbqqThiVFKBe65AT?= =?us-ascii?Q?smY9CwNbHJWSJizA3xqBJy5w01chlcFUrkBMNj1J2XrbZf/XkxoY0sfMggLL?= =?us-ascii?Q?VADPwuJbJsZC4PRBLIRYijO9YVgmndX9wXKBMRL+7aQPSDeZPDeg5l3as6Go?= =?us-ascii?Q?e4aXZzDIS4ma2h1c388Va0oTzggWPZ02jDhH3a6fmDoR9KtOo894kwyoxQEN?= =?us-ascii?Q?XnK1V6UfBtwxWEO6LQNUCgmnzerlLbgtCg0iDJDREH508qjHZjm3A8cHD48/?= =?us-ascii?Q?X4AH8Z5OeG3RYstVZQ4YYGHJ0XOYQdHe0aVkIq/BnwS4YIs/uVx5yU+pIQP+?= =?us-ascii?Q?0s6dZM8oiDqkxsvGm0QSOGCHKI9rFSUe1ffhe3HT8L1aeIlXP/3FlNFRoxs+?= =?us-ascii?Q?svNocczJjX6lBfNUdi1jTrFVYF7OnT6auWxz6WKH1SJiAJS46llDwxS3rquw?= =?us-ascii?Q?NOBNJvZEwrci1crZTPjp/BCRkC+rXJVOW0/rxWhv5A5WqFOr7Jng/qGFg0uu?= =?us-ascii?Q?F10GBfrdh++AdIW2lqIsYntyTWpWbZJ+GuljBOMp/lQC1TDt/H8ZZotXHH/C?= =?us-ascii?Q?jdJOmRgcbHL3/9x3/FmUJpd5ENirO38fGE0iJD0oiursz8l6c7tv+pZ8OH0v?= =?us-ascii?Q?hpjiYMPjsequhARteX/Cg3ksn6zBdzjrCJ5otVg5jwkY6D+PcqlgD4zSYRtJ?= =?us-ascii?Q?JkFYupk3Lj8UrXl3ErNJRbX57XpdHsMU6ooMaEHE4MOEnni0mTqvqFNi9W7C?= =?us-ascii?Q?qUMGWjUjGT7jaQVxGA68GwoY?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: db42dc4f-1c55-4f47-4aa0-08d9277e1af7 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7970.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 17:28:02.3821 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /hlbJ/1pkzc9q3B2qobN3JyDutPeThUDoCEE2WAP3tdyQH8GDTehPYFG3P3Iy0WC387rhAkuXKVMSSaa3DFEow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7905 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 154HSAst019590 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 Content-Type: text/plain; charset="utf-8" Xen only supports one firmware, making autoselection easy to implement. In fact, is probably preferable in the Xen driver, where libxl supports a firmware setting with accepted values such as bios, ovmf, uefi (currently same semantics as ovmf), seabios, etc. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libxl/libxl_conf.c | 17 +++++++++++++++-- src/libxl/libxl_domain.c | 22 ++++++++++++++++------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index fc4268db01..aef93fae53 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -627,15 +627,28 @@ libxlMakeDomBuildInfo(virDomainDef *def, =20 /* * Currently libxl only allows specifying the type of BIOS. - * If the type is PFLASH, we assume OVMF and set libxl_bios_type + * If automatic firmware selection is enabled or the loader + * type is PFLASH, we assume OVMF and set libxl_bios_type * to LIBXL_BIOS_TYPE_OVMF. The path to the OVMF firmware is * configured when building Xen using '--with-system-ovmf=3D'. If * not specified, LIBXL_FIRMWARE_DIR/ovmf.bin is used. In the * future, Xen will support a user-specified firmware path. See * https://lists.xenproject.org/archives/html/xen-devel/2016-03/ms= g01628.html */ - if (virDomainDefHasOldStyleUEFI(def)) + if (def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) { + if (def->os.loader =3D=3D NULL) + def->os.loader =3D g_new0(virDomainLoaderDef, 1); + if (def->os.loader->path =3D=3D NULL) + def->os.loader->path =3D g_strdup(cfg->firmwares[0]->name); + if (def->os.loader->type =3D=3D VIR_DOMAIN_LOADER_TYPE_NONE) + def->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_PFLASH; + if (def->os.loader->readonly =3D=3D VIR_TRISTATE_BOOL_ABSENT) + def->os.loader->readonly =3D VIR_TRISTATE_BOOL_YES; b_info->u.hvm.bios =3D LIBXL_BIOS_TYPE_OVMF; + def->os.firmware =3D VIR_DOMAIN_OS_DEF_FIRMWARE_NONE; + } else if (virDomainDefHasOldStyleUEFI(def)) { + b_info->u.hvm.bios =3D LIBXL_BIOS_TYPE_OVMF; + } =20 if (def->emulator) { if (!virFileExists(def->emulator)) { diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 14d000511a..59d26d5e2b 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -440,6 +440,7 @@ libxlDomainDefValidate(const virDomainDef *def, { libxlDriverPrivate *driver =3D opaque; g_autoptr(libxlDriverConfig) cfg =3D libxlDriverConfigGet(driver); + bool reqSecureBoot =3D false; =20 if (!virCapabilitiesDomainSupported(cfg->caps, def->os.type, def->os.arch, @@ -447,13 +448,20 @@ libxlDomainDefValidate(const virDomainDef *def, return -1; =20 /* Xen+ovmf does not support secure boot */ + if (def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) { + if (def->os.firmwareFeatures && + def->os.firmwareFeatures[VIR_DOMAIN_OS_DEF_FIRMWARE_FEATURE_SE= CURE_BOOT]) + reqSecureBoot =3D true; + } if (virDomainDefHasOldStyleUEFI(def)) { if (def->os.loader && - def->os.loader->secure =3D=3D VIR_TRISTATE_BOOL_YES) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Secure boot is not supported on Xen")); - return -1; - } + def->os.loader->secure =3D=3D VIR_TRISTATE_BOOL_YES) + reqSecureBoot =3D true; + } + if (reqSecureBoot) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Secure boot is not supported on Xen")); + return -1; } =20 return 0; @@ -465,7 +473,9 @@ virDomainDefParserConfig libxlDomainDefParserConfig =3D= { .devicesPostParseCallback =3D libxlDomainDeviceDefPostParse, .domainPostParseCallback =3D libxlDomainDefPostParse, .domainValidateCallback =3D libxlDomainDefValidate, - .features =3D VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, + + .features =3D VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT | + VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING, }; =20 =20 --=20 2.31.1