Kieran Mansley
2008-Feb-08 14:30 UTC
[Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0
Generate error if frontend plugin tries to connect on dom0 diff -r bb5ece87256b drivers/xen/netfront/accel.c --- a/drivers/xen/netfront/accel.c +++ b/drivers/xen/netfront/accel.c @@ -446,6 +446,9 @@ int netfront_accelerator_loaded(int vers { struct netfront_accelerator *accelerator; + if (is_initial_xendomain()) + return -EINVAL; + if (version != NETFRONT_ACCEL_VERSION) { if (version > NETFRONT_ACCEL_VERSION) { /* Caller has higher version number, leave it _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kieran Mansley
2008-Feb-08 16:47 UTC
Re: [Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0
On Fri, 2008-02-08 at 14:30 +0000, Kieran Mansley wrote:> Generate error if frontend plugin tries to connect on dom0Forgot the: Signed-off-by: Kieran Mansley <kmansley@solarflare.com>> diff -r bb5ece87256b drivers/xen/netfront/accel.c > --- a/drivers/xen/netfront/accel.c > +++ b/drivers/xen/netfront/accel.c > @@ -446,6 +446,9 @@ int netfront_accelerator_loaded(int vers > { > struct netfront_accelerator *accelerator; > > + if (is_initial_xendomain()) > + return -EINVAL; > + > if (version != NETFRONT_ACCEL_VERSION) { > if (version > NETFRONT_ACCEL_VERSION) { > /* Caller has higher version number, leave it > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2008-Feb-11 14:52 UTC
Re: [Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0
Kieran Mansley writes ("[Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0"):> Generate error if frontend plugin tries to connect on dom0If you''re doing something with driver domains you might have frontends in dom0 and backends in the driver domain. I don''t think any of our current toolstack supports this but it would seem wrong to go out of our way to break it in the netfront driver. Or have I misunderstood the point of the change ? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kieran Mansley
2008-Feb-11 15:33 UTC
Re: [Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0
On Mon, 2008-02-11 at 14:52 +0000, Ian Jackson wrote:> Kieran Mansley writes ("[Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0"): > > Generate error if frontend plugin tries to connect on dom0 > > If you''re doing something with driver domains you might have frontends > in dom0 and backends in the driver domain. I don''t think any of our > current toolstack supports this but it would seem wrong to go out of > our way to break it in the netfront driver. > > Or have I misunderstood the point of the change ?It''s there to mirror the existing check in netfront.c:netif.init(): if (is_initial_xendomain()) return 0; i.e. If that test has failed, you''ve got no useful netfront functionality, so having a plugin for it isn''t much use, but netfront is still present and the plugin could try and connect. I''m just making it consistent. In addition, the acceleration plugin stuff in netfront is only initialised if you get past that test, so making sure it can only be used if it''s been initialised is a good idea. I''d be happy if someone wanted to remove these tests and make netfront work in dom0 but I didn''t want to make that more invasive change just now. Kieran _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel