|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [PATCH 2/6] Provide a mechanism to register domain owner
On 12/09/09 14:43, Konrad Rzeszutek Wilk wrote:
. and also to find the domain owner based on the PCI device and
to unregister a domain owner of a PCI device.
Could you fix this up a bit?
+int xen_register_device_domain_owner(struct pci_dev *dev, domid_t domain)
+{
+ struct xen_device_domain_owner *owner;
+ unsigned long flags;
+ int rc = 0;
+
+ spin_lock_irqsave(&dev_domain_list_spinlock, flags);
Are you expecting interrupt routines could also hold the lock?
+ if (find_device(dev)) {
+ rc = -EEXIST;
+ goto out;
+ }
+ owner = kzalloc(sizeof(struct xen_device_domain_owner), GFP_KERNEL);
This can block, so you can't do it while holding the lock. Its probably
best to allocate it first on the assumption that it will be used (it
seems probable that duplicate registrations are at least unlikely, and
possibly a bug).
Thanks,
J
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] Re: [PATCH 4/6] [pciback] Register the owner (domain) of the PCI device., (continued)
- [Xen-devel] Re: [PATCH 2/6] Provide a mechanism to register domain owner of a PCI device.,
Jeremy Fitzhardinge <=
[Xen-devel] [PATCH PCIBACK], Konrad Rzeszutek Wilk
|
|
|
|
|