Skip to contentSkip to conversation

Prevent frontend network accelerator plugin loading in dom0

PATCH In review Kieran Mansley 2 participants 4 messages Feb 8, 2008 – Feb 11, 2008 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Prevent frontend network accelerator plugin loading in dom0

Generate error if frontend plugin tries to connect on dom0

drivers/xen/netfront/accel.c +3 -0
diff -r bb5ece87256b 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
#1 lore raw
Quoted 1 line · Kieran Mansley

Generate error if frontend plugin tries to connect on dom0

Forgot the:

Quoted 20 lines

diff -r bb5ece87256b drivers/xen/netfront/accel.c

drivers/xen/netfront/accel.c +3 -0
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
In reply to Kieran Mansley

Kieran Mansley writes ("[Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0"):

Quoted 1 line

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 ?

Ian.

#3 lore raw
Quoted 9 lines · Ian Jackson

Kieran Mansley writes ("[Xen-devel] [PATCH] Prevent frontend network accelerator plugin loading in dom0"):

Quoted 1 line

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