aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-07-08 17:28:34 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-07-13 13:30:00 +0200
commit8caf911d3316b6eccc503cff0d9a68cf922950f1 (patch)
treeee13b636f718e650c665bbbeecfc9f39b45ad710 /vl.c
parentf6c2e66ae8c8a03d3044dc9054aa7c16e7f817ee (diff)
net: do not use atexit for cleanup
This will be necessary in the next patch, which stops using atexit for character devices; without it, vhost-user and the redirector filter will cause a use-after-free. Relying on the ordering of atexit calls is also brittle, even now that both the network and chardev subsystems are using atexit. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/vl.c b/vl.c
index 356713ea07..cad4da2487 100644
--- a/vl.c
+++ b/vl.c
@@ -4345,9 +4345,6 @@ int main(int argc, char **argv, char **envp)
qemu_opts_del(icount_opts);
}
- /* clean up network at qemu process termination */
- atexit(&net_cleanup);
-
if (default_net) {
QemuOptsList *net = qemu_find_opts("net");
qemu_opts_set(net, NULL, "type", "nic", &error_abort);
@@ -4611,5 +4608,7 @@ int main(int argc, char **argv, char **envp)
tpm_cleanup();
#endif
+ net_cleanup();
+
return 0;
}