]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Include varstore element in domcaps
authorAndrea Bolognani <abologna@redhat.com>
Fri, 30 Jan 2026 16:46:30 +0000 (17:46 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 24 Feb 2026 10:29:06 +0000 (11:29 +0100)
We want to advertise whether the element is usable when
defining new domains.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
docs/formatdomaincaps.rst
src/conf/domain_capabilities.c
src/conf/domain_capabilities.h
src/conf/schemas/domaincaps.rng

index 3426b7c9cd9562a17c0e5ed4af4c2ac715926b86..5a1d3f2670ca4e1d4b202bb1c4201b67706c30de 100644 (file)
@@ -141,6 +141,7 @@ domains.
            <value>no</value>
          </enum>
        </loader>
+       <varstore supported='yes'/>
      </os>
      ...
    <domainCapabilities>
@@ -227,6 +228,12 @@ are the following:
    possible to enforce Secure Boot, look at the ``enrolledKeys`` enum inside
    the ``<firmwareFeatures/>`` element instead.
 
+The ``<varstore/>`` element :since:`(since 12.1.0)` indicates whether UEFI
+variable storage backed by the ``uefi-vars`` QEMU device can be used as an
+alternative to pflash-based NVRAM storage. This is the only type of variable
+storage compatible with Secure Boot on non-x86 architectures, but it can be
+used on x86 too.
+
 CPU configuration
 ~~~~~~~~~~~~~~~~~
 
index 9b3577cd084fb61f4e9fb75f8b98f0ab4fbddf67..78b8e6e6e17347e6176c9c8701cba2ffc61c3ab6 100644 (file)
@@ -449,12 +449,21 @@ virDomainCapsLoaderFormat(virBuffer *buf,
     FORMAT_EPILOGUE(loader);
 }
 
+static void
+virDomainCapsVarstoreFormat(virBuffer *buf,
+                            const virDomainCapsVarstore *varstore)
+{
+    FORMAT_PROLOGUE(varstore);
+    FORMAT_EPILOGUE(varstore);
+}
+
 static void
 virDomainCapsOSFormat(virBuffer *buf,
                       const virDomainCapsOS *os)
 {
     const virDomainCapsFirmwareFeatures *firmwareFeatures = &os->firmwareFeatures;
     const virDomainCapsLoader *loader = &os->loader;
+    const virDomainCapsVarstore *varstore = &os->varstore;
 
     FORMAT_PROLOGUE(os);
 
@@ -462,6 +471,7 @@ virDomainCapsOSFormat(virBuffer *buf,
 
     virDomainCapsFirmwareFeaturesFormat(&childBuf, firmwareFeatures);
     virDomainCapsLoaderFormat(&childBuf, loader);
+    virDomainCapsVarstoreFormat(&childBuf, varstore);
 
     FORMAT_EPILOGUE(os);
 }
index a68fafe235b20ac46fccba3d5365349c9fdfb5ba..02344fd9b6a4c24e116d7d10f74789a8b25905d4 100644 (file)
@@ -61,6 +61,11 @@ struct _virDomainCapsLoader {
     virDomainCapsEnum secure;   /* Info about secure:virTristateBool */
 };
 
+typedef struct _virDomainCapsVarstore virDomainCapsVarstore;
+struct _virDomainCapsVarstore {
+    virTristateBool supported;
+};
+
 STATIC_ASSERT_ENUM(VIR_DOMAIN_OS_DEF_FIRMWARE_LAST);
 typedef struct _virDomainCapsOS virDomainCapsOS;
 struct _virDomainCapsOS {
@@ -68,6 +73,7 @@ struct _virDomainCapsOS {
     virDomainCapsEnum firmware;     /* Info about virDomainOsDefFirmware */
     virDomainCapsFirmwareFeatures firmwareFeatures;
     virDomainCapsLoader loader;     /* Info about virDomainLoaderDef */
+    virDomainCapsVarstore varstore;
 };
 
 STATIC_ASSERT_ENUM(VIR_DOMAIN_MEMORY_SOURCE_LAST);
index 3b24caeca6d1280d20a0aab5d77b0d64706c1eb1..4682abbf41aba55d8acdd3b80387c5efe8277691 100644 (file)
     </element>
   </define>
 
+  <define name="varstore">
+    <element name="varstore">
+      <ref name="supported"/>
+    </element>
+  </define>
+
   <define name="os">
     <element name="os">
       <interleave>
         <optional>
           <ref name="loader"/>
         </optional>
+        <optional>
+          <ref name="varstore"/>
+        </optional>
       </interleave>
     </element>
   </define>