-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KVM: x86: move device assignment out of kvm_host.h
Create a new header, and hide the device assignment functions there. Move struct kvm_assigned_dev_kernel to assigned-dev.c by modifying arch/x86/kvm/iommu.c to take a PCI device struct. Based on a patch by Radim Krcmar <rkrcmark@redhat.com>. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
- Loading branch information
Paolo Bonzini
committed
Nov 24, 2014
1 parent
b65d6e1
commit c9eab58
Showing
6 changed files
with
64 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef ARCH_X86_KVM_ASSIGNED_DEV_H | ||
#define ARCH_X86_KVM_ASSIGNED_DEV_H | ||
|
||
#include <linux/kvm_host.h> | ||
|
||
#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT | ||
int kvm_assign_device(struct kvm *kvm, struct pci_dev *pdev); | ||
int kvm_deassign_device(struct kvm *kvm, struct pci_dev *pdev); | ||
|
||
int kvm_iommu_map_guest(struct kvm *kvm); | ||
int kvm_iommu_unmap_guest(struct kvm *kvm); | ||
|
||
long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, | ||
unsigned long arg); | ||
|
||
void kvm_free_all_assigned_devices(struct kvm *kvm); | ||
#else | ||
static inline int kvm_iommu_unmap_guest(struct kvm *kvm) | ||
{ | ||
return 0; | ||
} | ||
|
||
static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, | ||
unsigned long arg) | ||
{ | ||
return -ENOTTY; | ||
} | ||
|
||
static inline void kvm_free_all_assigned_devices(struct kvm *kvm) {} | ||
#endif /* CONFIG_KVM_DEVICE_ASSIGNMENT */ | ||
|
||
#endif /* ARCH_X86_KVM_ASSIGNED_DEV_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters