[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [patch 14/24] QEMU/KVM: add pci_find_device
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [patch 14/24] QEMU/KVM: add pci_find_device |
Date: |
Tue, 11 Mar 2008 17:12:05 -0300 |
User-agent: |
quilt/0.46-1 |
Return PCIDevice from bus number and slot.
Signed-off-by: Marcelo Tosatti <address@hidden>
Index: kvm-userspace.hotplug/qemu/hw/pci.c
===================================================================
--- kvm-userspace.hotplug.orig/qemu/hw/pci.c
+++ kvm-userspace.hotplug/qemu/hw/pci.c
@@ -689,6 +689,23 @@ PCIBus *pci_find_bus(int bus_num)
return bus;
}
+PCIDevice *pci_find_device(int bus_num, int slot)
+{
+ int devfn;
+ PCIDevice *d;
+ PCIBus *bus = pci_find_bus(bus_num);
+
+ if (!bus)
+ return NULL;
+
+ for(devfn = 0; devfn < 256; devfn++) {
+ d = bus->devices[devfn];
+ if (d && PCI_SLOT(devfn) == slot)
+ return d;
+ }
+ return NULL;
+}
+
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
pci_map_irq_fn map_irq, const char *name)
{
Index: kvm-userspace.hotplug/qemu/hw/pci.h
===================================================================
--- kvm-userspace.hotplug.orig/qemu/hw/pci.h
+++ kvm-userspace.hotplug/qemu/hw/pci.h
@@ -93,6 +93,7 @@ uint32_t pci_data_read(void *opaque, uin
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);
+PCIDevice *pci_find_device(int bus_num, int slot);
void pci_info(void);
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
--
- [Qemu-devel] [patch 02/24] QEMU/KVM: add OperationRegion and GPE handler for add/removal notification, (continued)
- [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, 2008/03/12
- [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 <=
- [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
- [Qemu-devel] [patch 17/24] QEMU/KVM: add cpu_unregister_io_memory and make io mem table index dynamic, Marcelo Tosatti, 2008/03/12
[Qemu-devel] [patch 19/24] QEMU/KVM: handle SEJ notifications, Marcelo Tosatti, 2008/03/12
[Qemu-devel] [patch 20/24] QEMU/KVM: add qemu_free_irqs, Marcelo Tosatti, 2008/03/12
[Qemu-devel] [patch 22/24] QEMU/KVM: LSI SCSI and e1000 unregister callbacks, Marcelo Tosatti, 2008/03/12