[libvirt PATCH v2 08/12] include: define parameters for reporting SEV guest limits

Daniel P. Berrangé posted 12 patches 4 years, 1 month ago
There is a newer version of this series
[libvirt PATCH v2 08/12] include: define parameters for reporting SEV guest limits
Posted by Daniel P. Berrangé 4 years, 1 month ago
There are limits on the number of SEV/SEV-ES guests that can
be run on machines, which may be influenced by firmware
settings. This is important to expose to users.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 include/libvirt/libvirt-host.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/libvirt/libvirt-host.h b/include/libvirt/libvirt-host.h
index 4caed94a77..1dc4b8a147 100644
--- a/include/libvirt/libvirt-host.h
+++ b/include/libvirt/libvirt-host.h
@@ -472,6 +472,22 @@ typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
  */
 # define VIR_NODE_SEV_REDUCED_PHYS_BITS "reduced-phys-bits"
 
+/**
+ * VIR_NODE_SEV_MAX_GUESTS:
+ *
+ * Macro represents the number of SEV guests that can
+ * be run on the host, as a VIR_TYPED_PARAM_UINT.
+ */
+# define VIR_NODE_SEV_MAX_GUESTS "max-guests"
+
+/**
+ * VIR_NODE_SEV_MAX_ES_GUESTS:
+ *
+ * Macro represents the number of SEV-ES guests that can
+ * be run on the host, as a VIR_TYPED_PARAM_UINT.
+ */
+# define VIR_NODE_SEV_MAX_ES_GUESTS "max-es-guests"
+
 int virNodeGetSEVInfo (virConnectPtr conn,
                        virTypedParameterPtr *params,
                        int *nparams,
-- 
2.33.1

Re: [libvirt PATCH v2 08/12] include: define parameters for reporting SEV guest limits
Posted by Peter Krempa 4 years, 1 month ago
On Fri, Dec 10, 2021 at 11:37:31 +0000, Daniel P. Berrangé wrote:
> There are limits on the number of SEV/SEV-ES guests that can
> be run on machines, which may be influenced by firmware
> settings. This is important to expose to users.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  include/libvirt/libvirt-host.h | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)

As noted before, it's a shame that we don't cross-link these macros with
the API function in any autmatic way.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>