From nobody Thu Apr 18 21:40:01 2024 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=1641920525; cv=none; d=zohomail.com; s=zohoarc; b=KWWpGKH6E2xJqJwJEZgan9dXvWnmqWSD84GGZwyICMrqP2QsIOzeL2g1F1k5Ktw1gpNLLvZxEE6eWrKzP4J6XxZqGysh61aSXt6QBW/ss8dfQNe7syPyRTBvab6zPy/DVlPNwm4vWRAFcofZ40e2Cbj3E2s/DLTtXtu/koEpZSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641920525; 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=eBg+hddH6tpCClzzxrtpqZrK6T/CmxEo75AMjV0Yzj0=; b=ky71qgXF5LCCLaIcrXs38nqW6L0FITPvjF2XG7N0CHG+vRrKURRiySDb1zEvLyDqYlxwihVaJI5+UFLHPXhLtfqAaZM9HJwZrMGqnT7LxjPpgJHGXOa1fW1wlTElBQk08BKu6n+PNLnHuXQ4QpPOoUlUGaw9Mo50OxSfFaeKYoU= 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 1641920525829279.1994648421198; Tue, 11 Jan 2022 09:02:05 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-377-wIA8Uxs6OGy9vNYrwL-BPg-1; Tue, 11 Jan 2022 12:01:29 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1071D1083F62; Tue, 11 Jan 2022 17:01:23 +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 E48A08C08D; Tue, 11 Jan 2022 17:01:22 +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 B0EA04BB7C; Tue, 11 Jan 2022 17:01:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20BH11Bt004171 for ; Tue, 11 Jan 2022 12:01:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4AD2C7F81D; Tue, 11 Jan 2022 17:01:01 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 987767D57D; Tue, 11 Jan 2022 17:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641920524; 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=eBg+hddH6tpCClzzxrtpqZrK6T/CmxEo75AMjV0Yzj0=; b=VpK4PKhpeUReYMP/90ajJ1A1FvoNqGPUsb8Td2McWkRYQS/BzweUB1bcFhWXAvzhVZ6GiE Rk75tG2i/Eosi634wt/465YEFcfNHoysrowJGA8OmWnpSs2XtuJLdgZuUYiF7I6Yzt66tt ksOU6RKyaoWmlQ9MO31Ly+0eISZQrOg= X-MC-Unique: wIA8Uxs6OGy9vNYrwL-BPg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] docs: split example for schema Date: Tue, 11 Jan 2022 17:00:54 +0000 Message-Id: <20220111170056.203542-2-berrange@redhat.com> In-Reply-To: <20220111170056.203542-1-berrange@redhat.com> References: <20220111170056.203542-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.14 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641920527085100001 The docs illustration for the schema contains a mixture of incompatible configuration options. This is rather confusing and misleading to users. Splitting the illustration into four separate examples clarifies the situation. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- docs/formatdomain.rst | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d4f30bb8af..3dee28d52a 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -110,12 +110,19 @@ harddisk, cdrom, network) determining where to obtain= /find the boot image. =20 :: =20 + ... - + hvm - /usr/lib/xen/boot= /hvmloader - /var/lib/libvirt/nvr= am/guest_VARS.fd + /usr/lib/xen/boot/hvmloader + + ... + + + ... + + hvm @@ -123,6 +130,25 @@ harddisk, cdrom, network) determining where to obtain/= find the boot image. ... =20 + + ... + + hvm + /usr/share/OV= MF/OVMF_CODE.fd + /var/lib/libvirt/nvr= am/guest_VARS.fd + + + ... + + + ... + + hvm + + + + ... + ``firmware`` The ``firmware`` attribute allows management applications to automatica= lly fill ```` and ```` elements and possibly enable some --=20 2.33.1 From nobody Thu Apr 18 21:40:01 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; 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=1641920494; cv=none; d=zohomail.com; s=zohoarc; b=Nta0rLmkjzMt0S8SZZasf8SFNG1lF7DunZYM0x/MOnHOxKLdIF8npxL8v0Rr6GA2HAIQjruWjBho6eEY+fvTCZnEdYeuPuNSQRdHWVxTcI0Df41h5Fg8G7fKtT/cY0N4+sQpDW89FTJxDSjoWoiJJ9VzaU5bLHZZUZlB/R0C0ZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641920494; 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=gIVhxSxpE+Q8/OZ0FNK56zywWhmh10oKkOvM/Ks/VPM=; b=HprIZiIPFDX1SfC2m6Q77zNpfOc0agLKYSM/gaKUUnqVIBbOmOJUbDeBEVHJBpWR57yuGree37OpjFP++IPepaglysnxUhBgWxK0vpElKt8Jgmb6JSygEB/pTdWIlQB7dgdA42YoaFPzSLndrQH1v6bWv4nVhnd02eY25MycZ4w= 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 1641920494712942.9038763090958; Tue, 11 Jan 2022 09:01:34 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-260-zS5_0EnEN3W5PhTqO44UXA-1; Tue, 11 Jan 2022 12:01:31 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 568FF1083F65; Tue, 11 Jan 2022 17:01:26 +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 3282676E1E; Tue, 11 Jan 2022 17:01:26 +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 F0D4D1809CB8; Tue, 11 Jan 2022 17:01:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20BH12q3004187 for ; Tue, 11 Jan 2022 12:01:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 576357F81D; Tue, 11 Jan 2022 17:01:02 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A9487D57D; Tue, 11 Jan 2022 17:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641920493; 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=gIVhxSxpE+Q8/OZ0FNK56zywWhmh10oKkOvM/Ks/VPM=; b=WjlqYwwFvcNK9kuhuy4G111fGX0+uoHb6+H/IkM4nloaEBfrYf7A4BSECmrjyt5q6boN1l w+4fddP/v8JhVbyRX7DEXH+0f8M+Kg7Owv6IDEpr4xe9NRfSahkLAVdrOtrOngSNlYH3ff 2lPmbDw1pJ7QRxJaNwgrgFEEtzKDtXA= X-MC-Unique: zS5_0EnEN3W5PhTqO44UXA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] docs: use virYesNo definition in more schemas Date: Tue, 11 Jan 2022 17:00:55 +0000 Message-Id: <20220111170056.203542-3-berrange@redhat.com> In-Reply-To: <20220111170056.203542-1-berrange@redhat.com> References: <20220111170056.203542-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.13 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641920497252100001 A few places are still using an expend yes/no choice instead of the common virYesNo definition. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- docs/schemas/capability.rng | 5 +---- docs/schemas/domainbackup.rng | 5 +---- docs/schemas/domaincaps.rng | 5 +---- docs/schemas/domaincommon.rng | 17 ++++------------- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index 7747a01558..c7e72c6f39 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -409,10 +409,7 @@ - - yes - no - + diff --git a/docs/schemas/domainbackup.rng b/docs/schemas/domainbackup.rng index 05cc28ab00..1ac9da62c1 100644 --- a/docs/schemas/domainbackup.rng +++ b/docs/schemas/domainbackup.rng @@ -60,10 +60,7 @@ - - yes - no - + diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index b40ee0f35a..9cbc2467ab 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -156,10 +156,7 @@ - - yes - no - + diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7fa5c2b8b5..169b8d8dee 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -300,18 +300,12 @@ - - yes - no - + - - yes - no - + @@ -5331,11 +5325,8 @@ - - yes - no - - + + --=20 2.33.1 From nobody Thu Apr 18 21:40:01 2024 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=1641920479; cv=none; d=zohomail.com; s=zohoarc; b=hH5dK6JG9YohqyYFsFPeAHYS6TDf9xejBcrwRdhmG5Saqi6v27KsxO2+rtJsaZoIlRsW3NgOPpBycozm//qxCbqUcH0GyOuV4EUDeKec4iMu5F0IG/SvAuKcmwtA5pTer/36f0w2AiuMOsassRIhX0QC4OfIA9f0Ik8dMGLiy7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641920479; 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=sRuJ2tXmKQ2FJWk7YwYYBbsF0eUtgMvd7VxieiMOQls=; b=TUriWexht0xB2UlVH1rD6ls7qz0slqUo89MxnU7cfoUReDk/yXuOIlKJaMTWlvNh+7hcNMZpnfdqIGxUtzMFcWN3eaTpVywFdZbSvTmBqmFD7EWpaMfzybTmR1IdQq4tSkKmAWTe5q7V6alMqdsc0UWxDQMyhuUpWJhYH03JP5k= 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 1641920479091549.2032246115475; Tue, 11 Jan 2022 09:01:19 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-171-jF2CkYLINC6PY9oXd8P69Q-1; Tue, 11 Jan 2022 12:01:12 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 30B5383DD22; Tue, 11 Jan 2022 17:01:06 +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 DEA8177F2C; Tue, 11 Jan 2022 17:01:05 +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 124561809CBA; Tue, 11 Jan 2022 17:01:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20BH13ra004196 for ; Tue, 11 Jan 2022 12:01:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5E03D7F81C; Tue, 11 Jan 2022 17:01:03 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8A6B7D57D; Tue, 11 Jan 2022 17:01:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641920478; 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=sRuJ2tXmKQ2FJWk7YwYYBbsF0eUtgMvd7VxieiMOQls=; b=GDU+ZvbQcJBiFTi0pX/ux2L+0w9PXYd/xYZzAKjnQwoF/25Le+snhTq3wxRwrosN/iZMPt P7kF2aIUKpzFa+kRRtXIq+XHsrp8wXWqN1pXzDRiUwDh+rBMkJ6/ddKlwYR82aLHGRrjYd EoyeTN+VC/If+j+qV6zbwj0mh6JGR5Y= X-MC-Unique: jF2CkYLINC6PY9oXd8P69Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] qemu: split handling of distinct firmware enum conversions Date: Tue, 11 Jan 2022 17:00:56 +0000 Message-Id: <20220111170056.203542-4-berrange@redhat.com> In-Reply-To: <20220111170056.203542-1-berrange@redhat.com> References: <20220111170056.203542-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.13 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1641920480413100001 The qemuFirmwareOSInterfaceTypeFromOsDefFirmware method was added to convert from virDomainOsDefFirmware to the qemuFirmwareOSInterface enum. It was later also used to convert from virDomainLoader to qemuFirmwareOSInterface in: commit 8e1804f9f66f13ca1412d22bf1a957b6d55a2365 Author: Michal Pr=C3=ADvozn=C3=ADk Date: Tue Dec 17 17:45:50 2019 +0100 qemu_firmware: Try to autofill for old style UEFI specification This caused compile errors with clang due to passing a mis-matched enum type. These were later silenced by stripping the enum types: commit 8fcee47807d29008632a7ad918cbe93ac0a20597 Author: Michal Pr=C3=ADvozn=C3=ADk Date: Wed Jan 8 09:42:47 2020 +0100 qemu_firmware: Accept int in qemuFirmwareOSInterfaceTypeFromOsDefFirmwa= re() This is still rather confusing to humans reading the code. It is clearer to just define a separate helper method for the virDomainLoader type conversion. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/conf/domain_conf.h | 4 ++-- src/qemu/qemu_firmware.c | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 144ba4dd12..8a7e9a1668 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2292,8 +2292,8 @@ struct _virDomainOSEnv { =20 typedef enum { VIR_DOMAIN_OS_DEF_FIRMWARE_NONE =3D 0, - VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS =3D VIR_DOMAIN_LOADER_TYPE_ROM, - VIR_DOMAIN_OS_DEF_FIRMWARE_EFI =3D VIR_DOMAIN_LOADER_TYPE_PFLASH, + VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS, + VIR_DOMAIN_OS_DEF_FIRMWARE_EFI, =20 VIR_DOMAIN_OS_DEF_FIRMWARE_LAST } virDomainOsDefFirmware; diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 529ab8d68e..84c80eaacb 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -899,7 +899,7 @@ qemuFirmwareMatchesMachineArch(const qemuFirmware *fw, =20 =20 static qemuFirmwareOSInterface -qemuFirmwareOSInterfaceTypeFromOsDefFirmware(int fw) +qemuFirmwareOSInterfaceTypeFromOsDefFirmware(virDomainOsDefFirmware fw) { switch (fw) { case VIR_DOMAIN_OS_DEF_FIRMWARE_BIOS: @@ -915,6 +915,23 @@ qemuFirmwareOSInterfaceTypeFromOsDefFirmware(int fw) } =20 =20 +static qemuFirmwareOSInterface +qemuFirmwareOSInterfaceTypeFromOsDefLoaderType(virDomainLoader type) +{ + switch (type) { + case VIR_DOMAIN_LOADER_TYPE_ROM: + return QEMU_FIRMWARE_OS_INTERFACE_BIOS; + case VIR_DOMAIN_LOADER_TYPE_PFLASH: + return QEMU_FIRMWARE_OS_INTERFACE_UEFI; + case VIR_DOMAIN_LOADER_TYPE_NONE: + case VIR_DOMAIN_LOADER_TYPE_LAST: + break; + } + + return QEMU_FIRMWARE_OS_INTERFACE_NONE; +} + + #define VIR_QEMU_FIRMWARE_AMD_SEV_ES_POLICY (1 << 2) =20 =20 @@ -939,7 +956,7 @@ qemuFirmwareMatchDomain(const virDomainDef *def, =20 if (want =3D=3D QEMU_FIRMWARE_OS_INTERFACE_NONE && def->os.loader) { - want =3D qemuFirmwareOSInterfaceTypeFromOsDefFirmware(def->os.load= er->type); + want =3D qemuFirmwareOSInterfaceTypeFromOsDefLoaderType(def->os.lo= ader->type); =20 if (fw->mapping.device !=3D QEMU_FIRMWARE_DEVICE_FLASH || STRNEQ(def->os.loader->path, fw->mapping.data.flash.executable= .filename)) { --=20 2.33.1