KVM: Get an fd before creating the VM
authorOliver Upton <oupton@google.com>
Wed, 20 Jul 2022 09:22:49 +0000 (09:22 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Aug 2022 19:08:27 +0000 (15:08 -0400)
commit20020f4cf2f92115c34b7bbaea02fcc810709a7e
tree6dce7aba27c5e28407d732d685c909505f6672d5
parent58fc116645c53db117c8e6c7b549b228e24a6c73
KVM: Get an fd before creating the VM

Allocate a VM's fd at the very beginning of kvm_dev_ioctl_create_vm() so
that KVM can use the fd value to generate strigns, e.g. for debugfs,
when creating and initializing the VM.

Signed-off-by: Oliver Upton <oupton@google.com>
Message-Id: <20220720092259.3491733-4-oliver.upton@linux.dev>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c