Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255272
b: refs/heads/master
c: 6221a9b
h: refs/heads/master
v: v3
  • Loading branch information
Konrad Rzeszutek Wilk committed Jul 20, 2011
1 parent 01bbbc0 commit a83b506
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8bfd4e023f5fb5793d7d7483b6e17e04933c53e9
refs/heads/master: 6221a9b2a11acfb54e7b41da425e961b31e88553
2 changes: 2 additions & 0 deletions trunk/drivers/xen/xen-pciback/pci_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ static void pcistub_device_release(struct kref *kref)

dev_dbg(&psdev->dev->dev, "pcistub_device_release\n");

xen_unregister_device_domain_owner(psdev->dev);

/* Clean-up the device */
pciback_reset_device(psdev->dev);
pciback_config_free_dyn_fields(psdev->dev);
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/xen/xen-pciback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/workqueue.h>
#include <xen/xenbus.h>
#include <xen/events.h>
#include <asm/xen/pci.h>
#include <linux/workqueue.h>
#include "pciback.h"

Expand Down Expand Up @@ -221,6 +222,15 @@ static int pciback_export_device(struct pciback_device *pdev,
if (err)
goto out;

dev_dbg(&dev->dev, "registering for %d\n", pdev->xdev->otherend_id);
if (xen_register_device_domain_owner(dev,
pdev->xdev->otherend_id) != 0) {
dev_err(&dev->dev, "device has been assigned to another " \
"domain! Over-writting the ownership, but beware.\n");
xen_unregister_device_domain_owner(dev);
xen_register_device_domain_owner(dev, pdev->xdev->otherend_id);
}

/* TODO: It'd be nice to export a bridge and have all of its children
* get exported with it. This may be best done in xend (which will
* have to calculate resource usage anyway) but we probably want to
Expand Down Expand Up @@ -251,6 +261,9 @@ static int pciback_remove_device(struct pciback_device *pdev,
goto out;
}

dev_dbg(&dev->dev, "unregistering for %d\n", pdev->xdev->otherend_id);
xen_unregister_device_domain_owner(dev);

pciback_release_pci_dev(pdev, dev);

out:
Expand Down

0 comments on commit a83b506

Please sign in to comment.