diff options
author | Zhai, Edwin <edwin.zhai@intel.com> | 2010-01-29 01:38:44 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:36:06 -0500 |
commit | ab9f4ecbb6d39a18e300a0d10a4968c37404aa76 (patch) | |
tree | 1f7fba2feaeca2f6d643437167c7b9036c909c98 /virt/kvm/assigned-dev.c | |
parent | 6d3e435e708fa32f99b780caf6c5508a606a513b (diff) |
KVM: enable PCI multiple-segments for pass-through device
Enable optional parameter (default 0) - PCI segment (or domain) besides
BDF, when assigning PCI device to guest.
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/assigned-dev.c')
-rw-r--r-- | virt/kvm/assigned-dev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index f51e684dd238..057e2cca6af5 100644 --- a/virt/kvm/assigned-dev.c +++ b/virt/kvm/assigned-dev.c | |||
@@ -526,7 +526,8 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm, | |||
526 | r = -ENOMEM; | 526 | r = -ENOMEM; |
527 | goto out; | 527 | goto out; |
528 | } | 528 | } |
529 | dev = pci_get_bus_and_slot(assigned_dev->busnr, | 529 | dev = pci_get_domain_bus_and_slot(assigned_dev->segnr, |
530 | assigned_dev->busnr, | ||
530 | assigned_dev->devfn); | 531 | assigned_dev->devfn); |
531 | if (!dev) { | 532 | if (!dev) { |
532 | printk(KERN_INFO "%s: host device not found\n", __func__); | 533 | printk(KERN_INFO "%s: host device not found\n", __func__); |
@@ -548,6 +549,7 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm, | |||
548 | pci_reset_function(dev); | 549 | pci_reset_function(dev); |
549 | 550 | ||
550 | match->assigned_dev_id = assigned_dev->assigned_dev_id; | 551 | match->assigned_dev_id = assigned_dev->assigned_dev_id; |
552 | match->host_segnr = assigned_dev->segnr; | ||
551 | match->host_busnr = assigned_dev->busnr; | 553 | match->host_busnr = assigned_dev->busnr; |
552 | match->host_devfn = assigned_dev->devfn; | 554 | match->host_devfn = assigned_dev->devfn; |
553 | match->flags = assigned_dev->flags; | 555 | match->flags = assigned_dev->flags; |