[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [patch 03/24] QEMU/KVM: add pci_find_bus
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [patch 03/24] QEMU/KVM: add pci_find_bus |
Date: |
Tue, 11 Mar 2008 17:11:54 -0300 |
User-agent: |
quilt/0.46-1 |
Return PCIBus pointer from bus number integer.
Signed-off-by: Marcelo Tosatti <address@hidden>
Index: kvm-userspace.hotplug2/qemu/hw/pci.c
===================================================================
--- kvm-userspace.hotplug2.orig/qemu/hw/pci.c
+++ kvm-userspace.hotplug2/qemu/hw/pci.c
@@ -675,6 +675,16 @@ static void pci_bridge_write_config(PCID
pci_default_write_config(d, address, val, len);
}
+PCIBus *pci_find_bus(int bus_num)
+{
+ PCIBus *bus = first_bus;
+
+ while (bus && bus->bus_num != bus_num)
+ bus = bus->next;
+
+ return bus;
+}
+
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
pci_map_irq_fn map_irq, const char *name)
{
Index: kvm-userspace.hotplug2/qemu/hw/pci.h
===================================================================
--- kvm-userspace.hotplug2.orig/qemu/hw/pci.h
+++ kvm-userspace.hotplug2/qemu/hw/pci.h
@@ -3,6 +3,7 @@
/* PCI includes legacy ISA access. */
#include "isa.h"
+#include <linux/pci.h>
/* PCI bus */
@@ -91,6 +92,7 @@ void pci_data_write(void *opaque, uint32
uint32_t pci_data_read(void *opaque, uint32_t addr, int len);
int pci_bus_num(PCIBus *s);
void pci_for_each_device(int bus_num, void (*fn)(PCIDevice *d));
+PCIBus *pci_find_bus(int bus_num);
void pci_info(void);
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
--
- [Qemu-devel] [patch 00/24] QEMU ACPI PCI hotplug support, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 01/24] QEMU/KVM: add devices to represent PCI slots with _EJ0 method, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 02/24] QEMU/KVM: add OperationRegion and GPE handler for add/removal notification, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 05/24] QEMU/KVM: pci hotplug GPE support, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 03/24] QEMU/KVM: add pci_find_bus,
Marcelo Tosatti <=
- [Qemu-devel] [patch 07/24] QEMU/KVM: dynamic nic info index allocation, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 06/24] QEMU/KVM: dynamic drive/drive_opt index allocation, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 04/24] QEMU/KVM: return PCIDevice on net device init and record devfn, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 09/24] QEMU/KVM: record devfn on block driver instance, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 13/24] QEMU/KVM: export get_param_value/check_params, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 10/24] QEMU/KVM: move drives_opt for external use, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 12/24] QEMU/KVM: add net_client_uninit, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 14/24] QEMU/KVM: add pci_find_device, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 15/24] QEMU/KVM: virtio_blk_init return PCIDevice pointer, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 11/24] QEMU/KVM: net/drive add/remove tweaks, Marcelo Tosatti, 2008/03/12