From d7234f4d7e373a708e1df9ab565a71b71b189025 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Wed, 17 Mar 2010 17:59:26 -0500 Subject: Convert atexit users to exit_notifier All of these users have global state so we really don't see a benefit from exit_notifier. However, using exit_notifier means that there's one less justification for having global state in the first place. Signed-off-by: Anthony Liguori --- hw/xen_machine_pv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/xen_machine_pv.c') diff --git a/hw/xen_machine_pv.c b/hw/xen_machine_pv.c index 162f88db33..abfa02c951 100644 --- a/hw/xen_machine_pv.c +++ b/hw/xen_machine_pv.c @@ -42,6 +42,7 @@ static void xen_init_pv(ram_addr_t ram_size, CPUState *env; DriveInfo *dinfo; int i; + static Notifier exit_notifier = { .notify = xen_config_cleanup }; /* Initialize a dummy CPU */ if (cpu_model == NULL) { @@ -105,7 +106,7 @@ static void xen_init_pv(ram_addr_t ram_size, } /* config cleanup hook */ - atexit(xen_config_cleanup); + exit_notifier_addr(&exit_notifier); /* setup framebuffer */ xen_init_display(xen_domid); -- cgit v1.2.3