[libvirt] [PATCH] Add condiitonal definition for constants

Daniel P. Berrangé posted 1 patch 5 years, 10 months ago
Failed in applying to current master (apply log)
connect_compat.h | 16 ++++++++++++++++
domain_compat.h  |  4 ++++
2 files changed, 20 insertions(+)
[libvirt] [PATCH] Add condiitonal definition for constants
Posted by Daniel P. Berrangé 5 years, 10 months ago
To be able to build against older libvirt, we need to conditionally
define the constants, even though they're not exposed in the public
API.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

Pushed as build fix.

 connect_compat.h | 16 ++++++++++++++++
 domain_compat.h  |  4 ++++
 2 files changed, 20 insertions(+)

diff --git a/connect_compat.h b/connect_compat.h
index cd6d678..f780e58 100644
--- a/connect_compat.h
+++ b/connect_compat.h
@@ -243,4 +243,20 @@ int virNodeGetSEVInfoCompat(virConnectPtr conn,
                             int *nparams,
                             unsigned int flags);
 
+#ifndef VIR_NODE_SEV_CBITPOS
+#define VIR_NODE_SEV_CBITPOS "cbitpos"
+#endif
+
+#ifndef VIR_NODE_SEV_REDUCED_PHYS_BITS
+#define VIR_NODE_SEV_REDUCED_PHYS_BITS "reduced-phys-bits"
+#endif
+
+#ifndef VIR_NODE_SEV_PDH
+#define VIR_NODE_SEV_PDH "pdh"
+#endif
+
+#ifndef VIR_NODE_SEV_CERT_CHAIN
+#define VIR_NODE_SEV_CERT_CHAIN "cert-chain"
+#endif
+
 #endif /* LIBVIRT_GO_CONNECT_COMPAT_H__ */
diff --git a/domain_compat.h b/domain_compat.h
index 5c93ef5..345505c 100644
--- a/domain_compat.h
+++ b/domain_compat.h
@@ -1042,4 +1042,8 @@ int virDomainGetLaunchSecurityInfoCompat(virDomainPtr domain,
                                          int *nparams,
                                          unsigned int flags);
 
+#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT
+#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT "sev-measurement"
+#endif
+
 #endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Add condiitonal definition for constants
Posted by Peter Krempa 5 years, 10 months ago
On Tue, Jun 19, 2018 at 10:06:25 +0100, Daniel Berrange wrote:
> To be able to build against older libvirt, we need to conditionally
> define the constants, even though they're not exposed in the public
> API.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> 
> Pushed as build fix.

Please set up your subject-prefix for this project.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list