Revision fd42deeb

b/sysemu.h
6 6
#include "qemu-option.h"
7 7
#include "qemu-queue.h"
8 8
#include "qemu-timer.h"
9
#include "notify.h"
9 10

  
10 11
#ifdef _WIN32
11 12
#include <windows.h>
......
56 57
extern qemu_irq qemu_system_powerdown;
57 58
void qemu_system_reset(void);
58 59

  
60
void qemu_add_exit_notifier(Notifier *notify);
61
void qemu_remove_exit_notifier(Notifier *notify);
62

  
59 63
void do_savevm(Monitor *mon, const QDict *qdict);
60 64
int load_vmstate(const char *name);
61 65
void do_delvm(Monitor *mon, const QDict *qdict);
b/vl.c
234 234
static QEMUBootSetHandler *boot_set_handler;
235 235
static void *boot_set_opaque;
236 236

  
237
static NotifierList exit_notifiers =
238
    NOTIFIER_LIST_INITIALIZER(exit_notifiers);
239

  
237 240
int kvm_allowed = 0;
238 241
uint32_t xen_domid;
239 242
enum xen_mode xen_mode = XEN_EMULATE;
......
1740 1743
    return 0;
1741 1744
}
1742 1745

  
1746
void qemu_add_exit_notifier(Notifier *notify)
1747
{
1748
    notifier_list_add(&exit_notifiers, notify);
1749
}
1750

  
1751
void qemu_remove_exit_notifier(Notifier *notify)
1752
{
1753
    notifier_list_remove(&exit_notifiers, notify);
1754
}
1755

  
1756
static void qemu_run_exit_notifiers(void)
1757
{
1758
    notifier_list_notify(&exit_notifiers);
1759
}
1760

  
1743 1761
static const QEMUOption *lookup_opt(int argc, char **argv,
1744 1762
                                    const char **poptarg, int *poptind)
1745 1763
{
......
1804 1822
    int show_vnc_port = 0;
1805 1823
    int defconfig = 1;
1806 1824

  
1825
    atexit(qemu_run_exit_notifiers);
1807 1826
    error_set_progname(argv[0]);
1808 1827

  
1809 1828
    init_clocks();

Also available in: Unified diff