[LXC] Cleanup devices on container shutdown

This commit is contained in:
Dan Smith 2008-08-22 15:35:37 +00:00
parent 8f789f1b2f
commit 5fb17bcc1e
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,6 @@
Fri Aug 22 08:30:00 PDT 2008 Dan Smith <danms@us.ibm.com>
* src/lxc_driver.c: Make sure we cleanup veth devices at shutdown
Fri Aug 22 11:49:42 BST 2008 Daniel P. Berrange <berrange@redhat.com>
* python/libvir.py: Use libvirt error message as exception

View File

@ -375,6 +375,7 @@ static int lxcVMCleanup(virConnectPtr conn,
int rc = -1;
int waitRc;
int childStatus = -1;
virDomainNetDefPtr net;
while (((waitRc = waitpid(vm->pid, &childStatus, 0)) == -1) &&
errno == EINTR)
@ -404,6 +405,11 @@ static int lxcVMCleanup(virConnectPtr conn,
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;
}