On Wed, Jun 06, 2018 at 12:50:07PM -0500, Brijesh Singh wrote:
QEMU version >= 2.12 provides support for launching an encrypted
VMs on
AMD x86 platform using Secure Encrypted Virtualization (SEV) feature.
This patch adds support to query the SEV capability from the qemu.
Signed-off-by: Brijesh Singh <brijesh.singh(a)amd.com>
---
src/conf/domain_capabilities.c | 12 ++++
src/conf/domain_capabilities.h | 16 +++++
src/libvirt_private.syms | 2 +-
src/qemu/qemu_capabilities.c | 35 ++++++++++
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_capspriv.h | 4 ++
src/qemu/qemu_monitor.c | 10 +++
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 79 ++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 3 +
.../caps_2.12.0.x86_64.replies | 10 +++
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 3 +-
12 files changed, 176 insertions(+), 3 deletions(-)
With the following squashed in:
Reviewed-by: Erik Skultety <eskultet(a)redhat.com>
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 30b32725c0..56c1903cf4 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -137,9 +137,6 @@ struct _virDomainCapsCPU {
virDomainCapsCPUModelsPtr custom;
};
-/*
- * SEV capabilities
- */
typedef struct _virSEVCapability virSEVCapability;
typedef virSEVCapability *virSEVCapabilityPtr;
struct _virSEVCapability {
@@ -149,10 +146,6 @@ struct _virSEVCapability {
unsigned int reduced_phys_bits;
};
-void
-virSEVCapabilitiesFree(virSEVCapability *capabilities);
-
-
struct _virDomainCaps {
virObjectLockable parent;
@@ -218,4 +211,7 @@ int virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum,
void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum);
char * virDomainCapsFormat(virDomainCapsPtr const caps);
+
+void
+virSEVCapabilitiesFree(virSEVCapability *capabilities);
#endif /* __DOMAIN_CAPABILITIES_H__ */
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ba435db07f..af66c7995f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -187,6 +187,7 @@ virDomainCapsFormat;
virDomainCapsNew;
virSEVCapabilitiesFree;
+
# conf/domain_conf.h
virBlkioDeviceArrayClear;
virDiskNameParse;