Mihir Nanavati
2010-Jul-30 15:00 UTC
[Xen-devel] [PATCH] libxl: Allow PV guests to add a PCI device without an IOMMU
Added a check which allows adding and removal of PCI devices for PV guests in the absence of an IOMMU Signed-off-by: Mihir Nanavati <mihirn@cs.ubc.ca> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2010-Jul-30 15:47 UTC
Re: [Xen-devel] [PATCH] libxl: Allow PV guests to add a PCI device without an IOMMU
Mihir Nanavati writes ("[Xen-devel] [PATCH] libxl: Allow PV guests to add a PCI device without an IOMMU"):> Added a check which allows adding and removal of PCI devices for PV > guests in the absence of an IOMMU+ if (rc < 0 && (hvm || ENOSYS != errno)) { ^^^^^^^^^^^^^^^^ Nowadays we have compilers which spot the mistake that this unnatural and hard-to-read idiom is intended to avoid. As to the substance I''m not sure I''m confident that it''s right ... Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Mihir Nanavati
2010-Jul-30 16:27 UTC
Re: [Xen-devel] [PATCH] libxl: Allow PV guests to add a PCI device without an IOMMU
Stylistically, I''d be happy to follow any suggestions you have - would just switching it to errno != ENOSYS be sufficient? I think the content is ok - in HVM it effectively becomes if(rc < 0) and in PV guests it becomes if(rc < 0 && errno != ENOSYS) which should be correct. Or am I missing something? ~M On Fri, Jul 30, 2010 at 4:47 PM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:> Mihir Nanavati writes ("[Xen-devel] [PATCH] libxl: Allow PV guests to add a PCI device without an IOMMU"): >> Added a check which allows adding and removal of PCI devices for PV >> guests in the absence of an IOMMU > > + if (rc < 0 && (hvm || ENOSYS != errno)) { > ^^^^^^^^^^^^^^^^ > Nowadays we have compilers which spot the mistake that this > unnatural and hard-to-read idiom is intended to avoid. > > As to the substance I''m not sure I''m confident that it''s right ... > > Ian. > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini
2010-Aug-03 16:10 UTC
Re: [Xen-devel] [PATCH] libxl: Allow PV guests to add a PCI device without an IOMMU
On Fri, 30 Jul 2010, Mihir Nanavati wrote:> Stylistically, I''d be happy to follow any suggestions you have - would > just switching it to > errno != ENOSYS be sufficient? > > I think the content is ok - in HVM it effectively becomes if(rc < 0) > and in PV guests it becomes if(rc < 0 && errno != ENOSYS) which should > be correct. Or am I missing something? >I think the patch is correct, I''ll apply it fixing the style. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel