From: Ross Philipson Date: Thu, 26 Mar 2009 12:07:28 +0000 (-0400) Subject: FLR - intermediate checkin 4 3/26 - fix dev id show and remove to X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2c8076aa065726e7e988f3cf1b6f28368bb77650;p=xenclient%2Fkernel.git FLR - intermediate checkin 4 3/26 - fix dev id show and remove to use the type field. Changes to be committed: modified: drivers/xen/pciback/pci_stub.c --- diff --git a/drivers/xen/pciback/pci_stub.c b/drivers/xen/pciback/pci_stub.c index a17f24db..06496666 100644 --- a/drivers/xen/pciback/pci_stub.c +++ b/drivers/xen/pciback/pci_stub.c @@ -643,7 +643,7 @@ static int pcistub_device_id_add(int domain, int bus, int slot, int func, int ty return 0; } -static int pcistub_device_id_remove(int domain, int bus, int slot, int func) +static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type) { struct pcistub_device_id *pci_dev_id, *t; int devfn = PCI_DEVFN(slot, func); @@ -653,7 +653,7 @@ static int pcistub_device_id_remove(int domain, int bus, int slot, int func) spin_lock_irqsave(&device_ids_lock, flags); list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) { - if (pci_dev_id->domain == domain + if (pci_dev_id->type == type && pci_dev_id->domain == domain && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) { /* Don't break; here because it's possible the same * slot could be in the list more than once @@ -765,7 +765,7 @@ static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf, if (err) goto out; - err = pcistub_device_id_remove(domain, bus, slot, func); + err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE); out: if (!err) @@ -783,6 +783,10 @@ static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf) spin_lock_irqsave(&device_ids_lock, flags); list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) { + /* only want devices set for hid, not reset entries */ + if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE) + continue; + if (count >= PAGE_SIZE) break;