mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
conf: Add availability of s390-pv in domain capabilities
Adding availability of s390-pv in domain capabilities and adjust tests. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
b823f7a781
commit
248a30c0c0
@ -257,6 +257,9 @@
|
||||
<optional>
|
||||
<ref name="backup"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="s390-pv"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="sev"/>
|
||||
</optional>
|
||||
@ -294,6 +297,12 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="s390-pv">
|
||||
<element name="s390-pv">
|
||||
<ref name="supported"/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="sev">
|
||||
<element name="sev">
|
||||
<ref name="supported"/>
|
||||
|
@ -42,6 +42,7 @@ VIR_ENUM_IMPL(virDomainCapsFeature,
|
||||
"genid",
|
||||
"backingStoreInput",
|
||||
"backup",
|
||||
"s390-pv",
|
||||
);
|
||||
|
||||
static virClass *virDomainCapsClass;
|
||||
|
@ -186,6 +186,7 @@ typedef enum {
|
||||
VIR_DOMAIN_CAPS_FEATURE_GENID,
|
||||
VIR_DOMAIN_CAPS_FEATURE_BACKING_STORE_INPUT,
|
||||
VIR_DOMAIN_CAPS_FEATURE_BACKUP,
|
||||
VIR_DOMAIN_CAPS_FEATURE_S390_PV,
|
||||
|
||||
VIR_DOMAIN_CAPS_FEATURE_LAST
|
||||
} virDomainCapsFeature;
|
||||
|
@ -6340,6 +6340,21 @@ virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCaps *qemuCaps,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virQEMUCapsFillDomainFeatureS390PVCaps(virQEMUCaps *qemuCaps,
|
||||
virDomainCaps *domCaps)
|
||||
{
|
||||
if (ARCH_IS_S390(qemuCaps->arch)) {
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT) &&
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_S390_PV_GUEST) &&
|
||||
virQEMUCapsGetKVMSupportsSecureGuest(qemuCaps))
|
||||
domCaps->features[VIR_DOMAIN_CAPS_FEATURE_S390_PV] = VIR_TRISTATE_BOOL_YES;
|
||||
else
|
||||
domCaps->features[VIR_DOMAIN_CAPS_FEATURE_S390_PV] = VIR_TRISTATE_BOOL_NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps,
|
||||
virArch hostarch,
|
||||
@ -6388,6 +6403,7 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps,
|
||||
virQEMUCapsFillDomainDeviceFSCaps(qemuCaps, filesystem);
|
||||
virQEMUCapsFillDomainFeatureGICCaps(qemuCaps, domCaps);
|
||||
virQEMUCapsFillDomainFeatureSEVCaps(qemuCaps, domCaps);
|
||||
virQEMUCapsFillDomainFeatureS390PVCaps(qemuCaps, domCaps);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -212,6 +212,7 @@
|
||||
<genid supported='no'/>
|
||||
<backingStoreInput supported='no'/>
|
||||
<backup supported='no'/>
|
||||
<s390-pv supported='no'/>
|
||||
<sev supported='no'/>
|
||||
</features>
|
||||
</domainCapabilities>
|
||||
|
@ -212,6 +212,7 @@
|
||||
<genid supported='no'/>
|
||||
<backingStoreInput supported='no'/>
|
||||
<backup supported='no'/>
|
||||
<s390-pv supported='no'/>
|
||||
<sev supported='no'/>
|
||||
</features>
|
||||
</domainCapabilities>
|
||||
|
@ -219,6 +219,7 @@
|
||||
<genid supported='no'/>
|
||||
<backingStoreInput supported='no'/>
|
||||
<backup supported='no'/>
|
||||
<s390-pv supported='no'/>
|
||||
<sev supported='no'/>
|
||||
</features>
|
||||
</domainCapabilities>
|
||||
|
@ -229,6 +229,7 @@
|
||||
<genid supported='no'/>
|
||||
<backingStoreInput supported='no'/>
|
||||
<backup supported='no'/>
|
||||
<s390-pv supported='no'/>
|
||||
<sev supported='no'/>
|
||||
</features>
|
||||
</domainCapabilities>
|
||||
|
@ -244,6 +244,7 @@
|
||||
<genid supported='no'/>
|
||||
<backingStoreInput supported='yes'/>
|
||||
<backup supported='no'/>
|
||||
<s390-pv supported='no'/>
|
||||
<sev supported='no'/>
|
||||
</features>
|
||||
</domainCapabilities>
|
||||
|
@ -246,6 +246,7 @@
|
||||
<genid supported='no'/>
|
||||
<backingStoreInput supported='yes'/>
|
||||
<backup supported='no'/>
|
||||
<s390-pv supported='no'/>
|
||||
<sev supported='no'/>
|
||||
</features>
|
||||
</domainCapabilities>
|
||||
|
@ -247,6 +247,7 @@
|
||||
<genid supported='no'/>
|
||||
<backingStoreInput supported='yes'/>
|
||||
<backup supported='no'/>
|
||||
<s390-pv supported='yes'/>
|
||||
<sev supported='no'/>
|
||||
</features>
|
||||
</domainCapabilities>
|
||||
|
@ -17,6 +17,8 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "virhostcpu.h"
|
||||
#include "virmock.h"
|
||||
#include "qemu/qemu_capabilities.h"
|
||||
|
||||
int
|
||||
virHostCPUGetKVMMaxVCPUs(void)
|
||||
@ -29,3 +31,18 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool (*real_virQEMUCapsGetKVMSupportsSecureGuest)(virQEMUCaps *qemuCaps);
|
||||
|
||||
bool
|
||||
virQEMUCapsGetKVMSupportsSecureGuest(virQEMUCaps *qemuCaps)
|
||||
{
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT) &&
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_S390_PV_GUEST))
|
||||
return true;
|
||||
|
||||
if (!real_virQEMUCapsGetKVMSupportsSecureGuest)
|
||||
VIR_MOCK_REAL_INIT(virQEMUCapsGetKVMSupportsSecureGuest);
|
||||
|
||||
return real_virQEMUCapsGetKVMSupportsSecureGuest(qemuCaps);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user