diff options
author | David Vrabel <david.vrabel@citrix.com> | 2013-10-07 08:55:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-08 16:15:51 -0400 |
commit | dc62ccaccfb139d9b04bbc5a2688a4402adbfab3 (patch) | |
tree | 90b274b080f228ea5a58fd5ca17eec4727419503 /drivers/net/xen-netback | |
parent | 3c01352db3868aab6c6e6402c2cfb781f7755504 (diff) |
xen-netback: transition to CLOSED when removing a VIF
If a guest is destroyed without transitioning its frontend to CLOSED,
the domain becomes a zombie as netback was not grant unmapping the
shared rings.
When removing a VIF, transition the backend to CLOSED so the VIF is
disconnected if necessary (which will unmap the shared rings etc).
This fixes a regression introduced by
279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy
the netdev until the vif is shut down).
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Paul Durrant <Paul.Durrant@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index b45bce20ad76..1b08d8798372 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *); | |||
39 | static void connect(struct backend_info *); | 39 | static void connect(struct backend_info *); |
40 | static void backend_create_xenvif(struct backend_info *be); | 40 | static void backend_create_xenvif(struct backend_info *be); |
41 | static void unregister_hotplug_status_watch(struct backend_info *be); | 41 | static void unregister_hotplug_status_watch(struct backend_info *be); |
42 | static void set_backend_state(struct backend_info *be, | ||
43 | enum xenbus_state state); | ||
42 | 44 | ||
43 | static int netback_remove(struct xenbus_device *dev) | 45 | static int netback_remove(struct xenbus_device *dev) |
44 | { | 46 | { |
45 | struct backend_info *be = dev_get_drvdata(&dev->dev); | 47 | struct backend_info *be = dev_get_drvdata(&dev->dev); |
46 | 48 | ||
49 | set_backend_state(be, XenbusStateClosed); | ||
50 | |||
47 | unregister_hotplug_status_watch(be); | 51 | unregister_hotplug_status_watch(be); |
48 | if (be->vif) { | 52 | if (be->vif) { |
49 | kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); | 53 | kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); |