# HG changeset patch # User root@xxxxxxxxxxxxxxxxxxxxx # Node ID c066abe3893a03e4b3697ac6c661271a5e9afae7 # Parent 829517be689f95d3d935ab1af17d0c31ee4950fc Today if frontend device does not finish initialization the backend vif still in dom0 forever. The problems are: - netif_disconnect only clean up devices with connected status. When a device has a problem it will not have that status and will not be cleaned up. - free_netif_callback must be able to unregister devices not completely initialized. Today's code test if it has an irq assigned, if not it just return. Before a complete initialization netif does not have an irq number. Both situations occur today when trying to create more than 3 vif in a single domU. This patch fix uncleaned vif backend devices when frontend does not finish initialization properly. Signed-off-by: Murillo F. Bernardes diff -r 829517be689f -r c066abe3893a linux-2.6-xen-sparse/drivers/xen/netback/interface.c --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c Fri Dec 23 15:42:46 2005 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c Mon Dec 26 22:13:53 2005 @@ -248,12 +248,11 @@ netif_t *netif = (netif_t *)arg; /* Already disconnected? */ - if (!netif->irq) - return; - - unbind_from_irqhandler(netif->irq, netif); - netif->irq = 0; - + if (netif->irq) { + unbind_from_irqhandler(netif->irq, netif); + netif->irq = 0; + } + unregister_netdev(netif->dev); if (netif->tx.sring) { @@ -303,6 +302,10 @@ netif_put(netif); return 0; /* Caller should not send response message. */ } + else { + free_netif(netif); + return 0; + } return 1; }