From 241969d465c5de4d9ebf51de7e82e1b25143ba82 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Thu, 10 Jun 2021 15:24:19 +0200 Subject: [PATCH] qemu_command: use confidential-guest-support if available Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_command.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 56d0e8bea8..1e90b59d17 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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)