mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
[LXC] Cleanup devices on container shutdown
This commit is contained in:
parent
8f789f1b2f
commit
5fb17bcc1e
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user