[PATCH v2 3/8] conf: Add firmware blob configuration
Daniel P. Berrangé
berrange at redhat.com
Tue Jun 9 09:55:42 UTC 2020
On Thu, Jun 04, 2020 at 08:44:04PM +0200, Michal Privoznik wrote:
> QEMU has -fw_cfg which allows users to tweak how firmware
> configures itself and/or provide new configuration blobs.
> Introduce new <sysinfo/> type "fwcfg" that will hold these
> new blobs.
>
> It's possible to either specify new value as a string or
> provide a filename which contents then serve as the value.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> docs/formatdomain.html.in | 32 +++
> docs/schemas/domaincommon.rng | 143 ++++++++------
> src/conf/domain_conf.c | 186 +++++++++++++-----
> src/conf/domain_conf.h | 4 +-
> src/qemu/qemu_command.c | 10 +-
> src/util/virsysinfo.c | 54 ++++-
> src/util/virsysinfo.h | 16 +-
> tests/qemuxml2argvdata/smbios-type-fwcfg.xml | 63 ++++++
> .../qemuxml2xmloutdata/smbios-type-fwcfg.xml | 1 +
> tests/qemuxml2xmltest.c | 1 +
> 10 files changed, 396 insertions(+), 114 deletions(-)
> create mode 100644 tests/qemuxml2argvdata/smbios-type-fwcfg.xml
> create mode 120000 tests/qemuxml2xmloutdata/smbios-type-fwcfg.xml
> diff --git a/tests/qemuxml2argvdata/smbios-type-fwcfg.xml b/tests/qemuxml2argvdata/smbios-type-fwcfg.xml
> new file mode 100644
> index 0000000000..2644833b21
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/smbios-type-fwcfg.xml
> @@ -0,0 +1,63 @@
> +<domain type='qemu'>
> + <name>QEMUGuest1</name>
> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> + <memory unit='KiB'>219100</memory>
> + <currentMemory unit='KiB'>219100</currentMemory>
> + <vcpu placement='static'>1</vcpu>
> + <sysinfo type='smbios'>
> + <bios>
> + <entry name='vendor'>LENOVO</entry>
> + <entry name='version'>6FET82WW (3.12 )</entry>
> + </bios>
> + <system>
> + <entry name='manufacturer'>Fedora</entry>
> + <entry name='product'>Virt-Manager</entry>
> + <entry name='version'>0.8.2-3.fc14</entry>
> + <entry name='serial'>32dfcb37-5af1-552b-357c-be8c3aa38310</entry>
> + <entry name='uuid'>c7a5fdbd-edaf-9455-926a-d65c16db1809</entry>
> + <entry name='sku'>1234567890</entry>
> + <entry name='family'>Red Hat</entry>
> + </system>
> + <baseBoard>
> + <entry name='manufacturer'>Lenovo</entry>
> + <entry name='product'>20BE0061MC</entry>
> + <entry name='version'>0B98401 Pro</entry>
> + <entry name='serial'>W1KS427111E</entry>
> + <entry name='location'>Not Available</entry>
> + </baseBoard>
> + </sysinfo>
> + <sysinfo type='fwcfg'>
> + <entry name='opt/com.example/name' value='example value'/>
> + <entry name='opt/com.coreos/config' file='/tmp/provision.ign'/>
> + </sysinfo>
I find it undesirable to use the value be the element contents
in the SMBIOS case, and an attribute in fwcfg case. IOW I think
we should be doing
<sysinfo type='fwcfg'>
<entry name='opt/com.example/name'>example value</value>
<entry name='opt/com.coreos/config' file='/tmp/provision.ign'/>
</sysinfo>
Which is how we would have to retrofit a "file" attribute into
the existing SMBIOS xml too
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list