diff options
author | Sheng Yang <sheng@linux.intel.com> | 2009-05-21 17:08:49 -0700 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2009-05-28 19:37:44 -0300 |
commit | 16cb057048e0362f67c420a5f2c4176ff863077d (patch) | |
tree | 05aeb401a164f573d982d3ca0e2b153437759482 /libkvm | |
parent | 39b39d3cfb1dea043d65f1dd6b5d477ffe40a76e (diff) |
kvm: libkvm: add ioctl wrappers for KVM_SET_MSIX_ENTRY_NR and KVM_SET_MSIX_ENTRY
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
(cherry picked from commit 53dc8b3b16251e3753da65f7a295f3e58cf7219c)
Signed-off-by: Chris Wright <chrisw@redhat.com>
Bugzilla: 498085
Message-Id: <1242950943-30180-12-git-send-email-chrisw@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Upstream-status: applied
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Don Dutile <ddutile@redhat.com>
Diffstat (limited to 'libkvm')
-rw-r--r-- | libkvm/libkvm.c | 25 | ||||
-rw-r--r-- | libkvm/libkvm.h | 7 |
2 files changed, 32 insertions, 0 deletions
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 83dfa801..d8726e15 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -1410,3 +1410,28 @@ int kvm_get_irq_route_gsi(kvm_context_t kvm) return KVM_IOAPIC_NUM_PINS; } +#ifdef KVM_CAP_DEVICE_MSIX +int kvm_assign_set_msix_nr(kvm_context_t kvm, + struct kvm_assigned_msix_nr *msix_nr) +{ + int ret; + + ret = ioctl(kvm->vm_fd, KVM_ASSIGN_SET_MSIX_NR, msix_nr); + if (ret < 0) + return -errno; + + return ret; +} + +int kvm_assign_set_msix_entry(kvm_context_t kvm, + struct kvm_assigned_msix_entry *entry) +{ + int ret; + + ret = ioctl(kvm->vm_fd, KVM_ASSIGN_SET_MSIX_ENTRY, entry); + if (ret < 0) + return -errno; + + return ret; +} +#endif diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h index 49163eb6..f68e5b64 100644 --- a/libkvm/libkvm.h +++ b/libkvm/libkvm.h @@ -838,4 +838,11 @@ int kvm_commit_irq_routes(kvm_context_t kvm); * \param kvm Pointer to the current kvm_context */ int kvm_get_irq_route_gsi(kvm_context_t kvm); + +#ifdef KVM_CAP_DEVICE_MSIX +int kvm_assign_set_msix_nr(kvm_context_t kvm, + struct kvm_assigned_msix_nr *msix_nr); +int kvm_assign_set_msix_entry(kvm_context_t kvm, + struct kvm_assigned_msix_entry *entry); +#endif #endif |