conf: Add firmware blob configuration

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@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik
2020-06-04 14:15:40 +02:00
parent b44898dd31
commit 3dda889a44
10 changed files with 400 additions and 111 deletions

View File

@@ -479,6 +479,10 @@
&lt;entry&gt;otherappname:more arbitrary data&lt;/entry&gt;
&lt;/oemStrings&gt;
&lt;/sysinfo&gt;
&lt;sysinfo type='fwcfg'&gt;
&lt;entry name='opt/com.example/name'&gt;example value&lt;/entry&gt;
&lt;entry name='opt/com.coreos/config' file='/tmp/provision.ign'/&gt;
&lt;/sysinfo&gt;
...</pre>
<p>
@@ -593,6 +597,34 @@
</dd>
</dl>
</dd>
<dt><code>fwcfg</code></dt>
<dd>
Some hypervisors provide unified way to tweak how firmware configures
itself, or may contain tables to be installed for the guest OS, for
instance boot order, ACPI, SMBIOS, etc. It even allows users to define
their own config blobs. In case of QEMU, these then appear under domain's
sysfs, under <code>/sys/firmware/qemu_fw_cfg</code>. Note, that these
values apply regardless the &lt;smbios/&gt; mode under &lt;os/&gt;.
<span class="since">Since 6.5.0</span>
<pre>
&lt;smbios type='fwcfg'&gt;
&lt;entry name='opt/com.example/name'&gt;example value&lt;/entry&gt;
&lt;entry name='opt/com.coreos/config' file='/tmp/provision.ign'/&gt;
&lt;/smbios&gt;
</pre>
The <code>smbios</code> element can have multiple <code>entry</code>
child elements. Each element then has mandatory <code>name</code>
attribute, which defines the name of the blob and must begin with
<code>"opt/"</code> and to avoid clashing with other names is advised to
be in form <code>"opt/$RFQDN/$name"</code> where <code>$RFQDN</code> is a
reverse fully qualified domain name you control.
Then, the element can either contain the value (to set the blob value
directly), or <code>file</code> attribute (to set the blob value from
the file).
</dd>
</dl>
<h3><a id="elementsCPUAllocation">CPU Allocation</a></h3>