From d0a073a186e4a81ae81435bd5b7286b657a69bfd Mon Sep 17 00:00:00 2001 From: Dominik Dingel Date: Thu, 12 Mar 2015 13:53:49 +0100 Subject: kvm: encapsulate HAS_DEVICE for vm attrs More and more virtual machine specifics between kvm and qemu will be transferred with vm attributes. So we encapsulate the common logic in a generic function. Additionally we need only to check during initialization if kvm supports virtual machine attributes. Cc: Paolo Bonzini Suggested-by: Thomas Huth Reviewed-by: Thomas Huth Signed-off-by: Dominik Dingel Signed-off-by: Jens Freimann Message-Id: <1426164834-38648-2-git-send-email-jfrei@linux.vnet.ibm.com> Acked-by: Paolo Bonzini Signed-off-by: Cornelia Huck --- include/sysemu/kvm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/sysemu/kvm.h') diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 3792463..197e6c0 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -225,6 +225,18 @@ int kvm_vcpu_ioctl(CPUState *cpu, int type, ...); int kvm_device_ioctl(int fd, int type, ...); /** + * kvm_vm_check_attr - check for existence of a specific vm attribute + * @s: The KVMState pointer + * @group: the group + * @attr: the attribute of that group to query for + * + * Returns: 1 if the attribute exists + * 0 if the attribute either does not exist or if the vm device + * interface is unavailable + */ +int kvm_vm_check_attr(KVMState *s, uint32_t group, uint64_t attr); + +/** * kvm_create_device - create a KVM device for the device control API * @KVMState: The KVMState pointer * @type: The KVM device type (see Documentation/virtual/kvm/devices in the -- cgit v1.1