void curses_display_init(DisplayState *ds, int full_screen)
{
DisplayChangeListener *dcl;
- static Notifier notifier = { .notify = curses_atexit };
#ifndef _WIN32
if (!isatty(1)) {
fprintf(stderr, "We need a terminal output\n");
curses_setup();
curses_keyboard_setup();
- exit_notifier_add(¬ifier);
+ atexit(curses_atexit);
#ifndef _WIN32
#if defined(SIGWINCH) && defined(KEY_RESIZE)
void xen_init_display(int domid);
/* configuration (aka xenbus setup) */
-void xen_config_cleanup(Notifier *notifier);
+void xen_config_cleanup(void);
int xen_config_dev_blk(DriveInfo *disk);
int xen_config_dev_nic(NICInfo *nic);
int xen_config_dev_vfb(int vdev, const char *type);
QTAILQ_INSERT_TAIL(&xs_cleanup, d, list);
}
-void xen_config_cleanup(Notifier *notifier)
+void xen_config_cleanup(void)
{
struct xs_dirs *d;
}
/* normal cleanup */
-static void xen_domain_cleanup(Notifier *notifier)
+static void xen_domain_cleanup(void)
{
char *dom;
unsigned int xenstore_port = 0, console_port = 0;
unsigned long xenstore_mfn = 0, console_mfn = 0;
int rc;
- static Notifier exit_notifier = { .notify = xen_domain_cleanup };
memcpy(uuid, qemu_uuid, sizeof(uuid));
rc = xc_domain_create(xen_xc, ssidref, uuid, flags, &xen_domid);
goto err;
}
qemu_log("xen: created domain %d\n", xen_domid);
- exit_notifier_add(&exit_notifier);
+ atexit(xen_domain_cleanup);
if (xen_domain_watcher() == -1) {
goto err;
}
CPUState *env;
DriveInfo *dinfo;
int i;
- static Notifier exit_notifier = { .notify = xen_config_cleanup };
/* Initialize a dummy CPU */
if (cpu_model == NULL) {
}
/* config cleanup hook */
- exit_notifier_add(&exit_notifier);
+ atexit(xen_config_cleanup);
/* setup framebuffer */
xen_init_display(xen_domid);
fcntl(0, F_SETFL, old_fd0_flags);
}
-static void term_exit_notifier(Notifier *notifier)
-{
- term_exit();
-}
-
static void term_init(QemuOpts *opts)
{
struct termios tty;
- static Notifier exit_notifier = { .notify = term_exit_notifier };
tcgetattr (0, &tty);
oldtty = tty;
tcsetattr (0, TCSANOW, &tty);
- if (!term_atexit_done++) {
- exit_notifier_add(&exit_notifier);
- }
+ if (!term_atexit_done++)
+ atexit(term_exit);
fcntl(0, F_SETFL, O_NONBLOCK);
}
SDL_SetCursor(guest_sprite);
}
-static void sdl_cleanup(Notifier *notifier)
+static void sdl_cleanup(void)
{
if (guest_sprite)
SDL_FreeCursor(guest_sprite);
uint8_t data = 0;
DisplayAllocator *da;
const SDL_VideoInfo *vi;
- static Notifier exit_notifier = { .notify = sdl_cleanup };
#if defined(__APPLE__)
/* always use generic keymaps */
sdl_cursor_hidden = SDL_CreateCursor(&data, &data, 8, 1, 0, 0);
sdl_cursor_normal = SDL_GetCursor();
- exit_notifier_add(&exit_notifier);
+ atexit(sdl_cleanup);
if (full_screen) {
gui_fullscreen = 1;
gui_fullscreen_initial_grab = 1;
}
#ifdef _WIN32
-static void socket_cleanup(Notifier *obj)
+static void socket_cleanup(void)
{
WSACleanup();
}
{
WSADATA Data;
int ret, err;
- static Notifier notifier = { .notify = socket_cleanup };
ret = WSAStartup(MAKEWORD(2,2), &Data);
if (ret != 0) {
fprintf(stderr, "WSAStartup: %d\n", err);
return -1;
}
- exit_notifier_add(¬ifier);
+ atexit(socket_cleanup);
return 0;
}
#endif
error_set_progname(argv[0]);
- exit_notifier_init();
-
init_clocks();
qemu_cache_utils_init(envp);