[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/10] kvm: shorten the parameter list for get_real_
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] [PATCH 09/10] kvm: shorten the parameter list for get_real_device() |
Date: |
Wed, 28 Aug 2013 17:33:37 +0300 |
From: Wei Yang <address@hidden>
get_real_device() has 5 parameters with the last 4 is contained in the first
structure.
This patch removes the last 4 parameters and directly use them from the first
parameter.
Acked-by: Alex Williamson <address@hidden>
Signed-off-by: Wei Yang <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/i386/kvm/pci-assign.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index ff33dc8..73941b2 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -568,8 +568,7 @@ static int get_real_device_id(const char *devpath, uint16_t
*val)
return get_real_id(devpath, "device", val);
}
-static int get_real_device(AssignedDevice *pci_dev, uint16_t r_seg,
- uint8_t r_bus, uint8_t r_dev, uint8_t r_func)
+static int get_real_device(AssignedDevice *pci_dev)
{
char dir[128], name[128];
int fd, r = 0, v;
@@ -582,7 +581,8 @@ static int get_real_device(AssignedDevice *pci_dev,
uint16_t r_seg,
dev->region_number = 0;
snprintf(dir, sizeof(dir), "/sys/bus/pci/devices/%04x:%02x:%02x.%x/",
- r_seg, r_bus, r_dev, r_func);
+ pci_dev->host.domain, pci_dev->host.bus,
+ pci_dev->host.slot, pci_dev->host.function);
snprintf(name, sizeof(name), "%sconfig", dir);
@@ -1769,8 +1769,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
memcpy(dev->emulate_config_write, dev->emulate_config_read,
sizeof(dev->emulate_config_read));
- if (get_real_device(dev, dev->host.domain, dev->host.bus,
- dev->host.slot, dev->host.function)) {
+ if (get_real_device(dev)) {
error_report("pci-assign: Error: Couldn't get real device (%s)!",
dev->dev.qdev.id);
goto out;
--
1.7.10.4
- [Qemu-devel] [PATCH v3 00/10] [PULL] qemu-kvm.git uq/master queue, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 05/10] kvm: x86: fix setting IA32_FEATURE_CONTROL with nested VMX disabled, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 06/10] kvm: Simplify kvm_handle_io, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 02/10] target-i386: remove tabs from target-i386/cpu.h, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 01/10] Initialize IA32_FEATURE_CONTROL MSR in reset and migration, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 08/10] kvm: i386: fix LAPIC TSC deadline timer save/restore, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 09/10] kvm: shorten the parameter list for get_real_device(),
Gleb Natapov <=
- [Qemu-devel] [PATCH 03/10] kvm: migrate vPMU state, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 04/10] kvm: add KVM_IRQFD_FLAG_RESAMPLE support, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 07/10] kvm-all.c: max_cpus should not exceed KVM vcpu limit, Gleb Natapov, 2013/08/28
- [Qemu-devel] [PATCH 10/10] kvm-stub: fix compilation, Gleb Natapov, 2013/08/28