mirror of
https://github.com/mii443/qemu.git
synced 2025-08-31 11:29:26 +00:00
KVM: Add helper to run KVM_CHECK_EXTENSION on vm fd
We now can call KVM_CHECK_EXTENSION on the kvm fd or on the vm fd, whereas the vm version is more accurate when it comes to PPC KVM. Add a helper to make the vm version available that falls back to the non-vm variant if the vm one is not available yet to stay compatible. Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
13
kvm-all.c
13
kvm-all.c
@ -493,6 +493,19 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int kvm_vm_check_extension(KVMState *s, unsigned int extension)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = kvm_vm_ioctl(s, KVM_CHECK_EXTENSION, extension);
|
||||
if (ret < 0) {
|
||||
/* VM wide version not implemented, use global one instead */
|
||||
ret = kvm_check_extension(s, extension);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,
|
||||
bool assign, uint32_t size, bool datamatch)
|
||||
{
|
||||
|
Reference in New Issue
Block a user