diff --git a/vl.c b/vl.c
index a3ab384..842f987 100644
--- a/vl.c
+++ b/vl.c
@@ -3749,6 +3749,9 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
+    /* clean up network at qemu process termination */
+    atexit(&net_cleanup);
+
     /* init the bluetooth world */
     if (foreach_device_config(DEV_BT, bt_parse))
         exit(1);
@@ -3999,7 +4002,6 @@ int main(int argc, char **argv, char **envp)
     main_loop();
     bdrv_close_all();
     pause_all_vcpus();
-    net_cleanup();
     res_free();
 
     return 0;
