[libvirt] [PATCH] Delete veth devices during lxcVMCleanup

This makes sure to delete veth devices after we've killed the container. In the case of a destroy or crash, this ensures the system is cleaned up properly. To be applied atop Daniel Berrange's current LXC patch stack. diff -r b18ae864eb98 -r cd0bd9a6288a src/lxc_driver.c --- a/src/lxc_driver.c Wed Aug 13 09:40:08 2008 -0700 +++ b/src/lxc_driver.c Thu Aug 14 08:50:49 2008 -0700 @@ -375,6 +375,7 @@ int rc = -1; int waitRc; int childStatus = -1; + virDomainNetDefPtr net; while (((waitRc = waitpid(vm->pid, &childStatus, 0)) == -1) && errno == EINTR) @@ -403,6 +404,11 @@ vm->pid = -1; vm->def->id = -1; vm->monitor = -1; + + for (net = vm->def->nets; net; net = net->next) { + vethInterfaceUpOrDown(net->ifname, 0); + vethDelete(net->ifname); + } return rc; }

On Thu, Aug 14, 2008 at 08:51:35AM -0700, Dan Smith wrote:
This makes sure to delete veth devices after we've killed the container. In the case of a destroy or crash, this ensures the system is cleaned up properly.
To be applied atop Daniel Berrange's current LXC patch stack.
Looks reasonable, is there anything blocking DanB patches from being commited at this point ? Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Wed, Aug 20, 2008 at 03:49:09PM +0200, Daniel Veillard wrote:
On Thu, Aug 14, 2008 at 08:51:35AM -0700, Dan Smith wrote:
This makes sure to delete veth devices after we've killed the container. In the case of a destroy or crash, this ensures the system is cleaned up properly.
To be applied atop Daniel Berrange's current LXC patch stack.
Looks reasonable, is there anything blocking DanB patches from being commited at this point ?
All my patches for LXC with exception of the pivot_root stuff are now commited, so this is good to commit. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

DB> All my patches for LXC with exception of the pivot_root stuff are DB> now commited, so this is good to commit. Done. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (3)
-
Dan Smith
-
Daniel P. Berrange
-
Daniel Veillard