Hi,

What about the existing callbacks?  Could handle_destroy do?

For hot-unplug it should do.

--- a/vl.c
+++ b/vl.c
@@ -3914,6 +3914,7 @@ int main(int argc, char **argv, char **envp)
      main_loop();
      quit_timers();
      net_cleanup();
+    usb_cleanup();

      return 0;
  }

Figure we'd have to clean up the qdev tree on exit.  Gerd?

Hmm, yes. Question is how to do that best. There is qdev_free(). Today this is used for hot-unplug only. Using it on exit() too could have unwanted guest-visible side effects as it doesn't just release ressources, but also unplugs the device if possible.

Maybe it is better to add a exit notifier ...

cheers,
  Gerd

Reply via email to