summary refs log tree commit diff stats
path: root/hw/core/machine.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-05-31 13:29:53 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-06-05 11:01:06 +0200
commitdc0d28ca46c0e7ee3c055ad4da24022995bd3765 (patch)
treeea38e045d3f15d85175beac75eca1a33684dc915 /hw/core/machine.c
parentaa274c33c39e7de981dc195abe60e1a246c9d248 (diff)
downloadfocaccia-qemu-dc0d28ca46c0e7ee3c055ad4da24022995bd3765.tar.gz
focaccia-qemu-dc0d28ca46c0e7ee3c055ad4da24022995bd3765.zip
machine: allow early use of machine_require_guest_memfd
Ask the ConfidentialGuestSupport object whether to use guest_memfd
for KVM-backend private memory.  This bool can be set in instance_init
(or user_complete) so that it is available when the machine is created.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core/machine.c')
-rw-r--r--hw/core/machine.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 17292b13e6..77a356f232 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -1216,7 +1216,7 @@ bool machine_mem_merge(MachineState *machine)
 
 bool machine_require_guest_memfd(MachineState *machine)
 {
-    return machine->require_guest_memfd;
+    return machine->cgs && machine->cgs->require_guest_memfd;
 }
 
 static char *cpu_slot_to_string(const CPUArchId *cpu)