[libvirt] [PATCH v2 06/15] conf: Introduce firmware attribute to <os/>

Michal Privoznik mprivozn at redhat.com
Tue Mar 12 15:13:56 UTC 2019


On 3/11/19 4:04 PM, Daniel P. Berrangé wrote:
> On Thu, Mar 07, 2019 at 10:29:16AM +0100, Michal Privoznik wrote:
>> The idea is that using this attribute users enable libvirt to
>> automagically select firmware image for their domain. For
>> instance:
>>
>>    <os firmware='efi'>
>>      <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
>>      <loader secure='no'/>
> 
> Ah, now I see why you need <loader> without a path
> specified. We need to be able to set the secure
> attribute.
> 
>>    </os>
>>
>>    <os firmware='bios'>
>>      <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
>>    </os>
>>
>> (The automagic of selecting firmware image will be described in
>> later commits.)
>>
>> Accepted values are 'bios' and 'efi' to let libvirt select
>> corresponding type of firmware.
>>
>> I know it is a good sign to introduce xml2xml test case when
>> changing XML config parser but that will have to come later.
>> Firmware auto selection is not enabled for any driver just yet so
>> any xml2xml test would fail right away.
>>
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>>   docs/formatdomain.html.in     | 22 +++++++++-
>>   docs/schemas/domaincommon.rng |  8 ++++
>>   src/conf/domain_conf.c        | 75 ++++++++++++++++++++++++++++-------
>>   src/conf/domain_conf.h        | 12 ++++++
>>   src/libvirt_private.syms      |  2 +
>>   5 files changed, 103 insertions(+), 16 deletions(-)
>>
>> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
>> index eb00c01d96..fedca0eedc 100644
>> --- a/docs/formatdomain.html.in
>> +++ b/docs/formatdomain.html.in
>> @@ -128,7 +128,7 @@
>>   
>>   <pre>
>>   ...
>> -<os>
>> +<os firmware='uefi'>
>>     <type>hvm</type>
>>     <loader readonly='yes' secure='no' type='rom'>/usr/lib/xen/boot/hvmloader</loader>
>>     <nvram template='/usr/share/OVMF/OVMF_VARS.fd'>/var/lib/libvirt/nvram/guest_VARS.fd</nvram>
>> @@ -141,6 +141,26 @@
>>   ...</pre>
>>   
>>       <dl>
>> +      <dt><code>firmware</code></dt>
>> +      <dd>The <code>firmware</code> attribute allows management
>> +        applications to automatically fill <code><loader/></code>
>> +        and <code><nvram/></code> elements and possibly enable
>> +        some features required by selected firmware. Accepted values are
>> +        <code>bios</code> and <code>efi</code>.<br/>
> 
> NB, this firmware attribute is something we'll want in the VMWare
> driver too.  So the text from this point downwards should be explicitly
> noted as being specific to QEMU. Or maybe this text about search locations
> should just be in the drvqemu.html.in file, and linked from here ?

I'll go with the former. When implementing this for VMWare it can be 
moved to drvqemu. BTW why do we need this for VMWare?

> 
>> +        The selection process scans for files describing installed
>> +        firmware images in specified location and uses the most specific
>> +        one which fulfils domain requirements. The locations in order of
>> +        preference (from generic to most specific one) are:
>> +        <ul>
>> +          <li><code>/usr/share/qemu/firmware</code></li>
>> +          <li><code>/etc/qemu/firmware</code></li>
>> +          <li><code>$XDG_CONFIG_HOME/qemu/firmware</code></li>
>> +        </ul>
>> +        For more information refer to firmware metadata specification as
>> +        described in <code>docs/interop/firmware.json</code> in QEMU
>> +        repository. Regular users do not need to bother.
>> +        <span class="since">Since 5.2.0 (QEMU and KVM only)</span>
>> +      </dd>
>>         <dt><code>type</code></dt>
>>         <dd>The content of the <code>type</code> element specifies the
>>           type of operating system to be booted in the virtual machine.
> 
> 
> Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>
> 

Thanks,
Michal




More information about the libvir-list mailing list