From mboxrd@z Thu Jan 1 00:00:00 1970 From: Murillo Fernandes Bernardes Subject: [PATCH] Fix device removal on net and block frontend drivers Date: Mon, 21 Nov 2005 13:43:01 -0200 Message-ID: <200511211343.02186.mfb@br.ibm.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_GsegDY0r9ruAhmx" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_GsegDY0r9ruAhmx Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Frontend devices are not being unregistered when in closed state. The following patch fix that. Fix bug #420. Makes "05_attach_and_dettach_device_repeatedly_pos" and "09_attach_and_dettach_device_check_data_pos" tests pass. Signed-off-by: Murillo Fernandes Bernardes -- Murillo Fernandes Bernardes IBM Linux Technology Center --Boundary-00=_GsegDY0r9ruAhmx Content-Type: text/x-diff; charset="iso-8859-1"; name="frontend_unregister_device.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="frontend_unregister_device.patch" diff -r 6a666940fa04 linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Sun Nov 20 09:19:38 2005 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Mon Nov 21 14:58:42 2005 @@ -273,7 +273,6 @@ case XenbusStateInitialising: case XenbusStateInitWait: case XenbusStateInitialised: - case XenbusStateClosed: break; case XenbusStateConnected: @@ -282,6 +281,10 @@ case XenbusStateClosing: blkfront_closing(dev); + break; + + case XenbusStateClosed: + device_unregister(&dev->dev); break; } } diff -r 6a666940fa04 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Sun Nov 20 09:19:38 2005 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Mon Nov 21 14:58:42 2005 @@ -406,11 +406,14 @@ case XenbusStateInitialised: case XenbusStateConnected: case XenbusStateUnknown: - case XenbusStateClosed: break; case XenbusStateClosing: netfront_closing(dev); + break; + + case XenbusStateClosed: + device_unregister(&dev->dev); break; } } --Boundary-00=_GsegDY0r9ruAhmx Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_GsegDY0r9ruAhmx--