qemu_command: use confidential-guest-support if available

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Pavel Hrdina 2021-06-10 15:24:19 +02:00
parent b560d1c876
commit 241969d465

View File

@ -6974,8 +6974,13 @@ qemuBuildMachineCommandLine(virCommand *cmd,
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_LOADPARM))
qemuAppendLoadparmMachineParm(&buf, def);
if (def->sev)
virBufferAddLit(&buf, ",memory-encryption=sev0");
if (def->sev) {
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT)) {
virBufferAddLit(&buf, ",confidential-guest-support=sev0");
} else {
virBufferAddLit(&buf, ",memory-encryption=sev0");
}
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
if (priv->pflash0)