Revision 28695489
b/curses.c | ||
---|---|---|
333 | 333 |
void curses_display_init(DisplayState *ds, int full_screen) |
334 | 334 |
{ |
335 | 335 |
DisplayChangeListener *dcl; |
336 |
static Notifier notifier = { .notify = curses_atexit }; |
|
337 | 336 |
#ifndef _WIN32 |
338 | 337 |
if (!isatty(1)) { |
339 | 338 |
fprintf(stderr, "We need a terminal output\n"); |
... | ... | |
343 | 342 |
|
344 | 343 |
curses_setup(); |
345 | 344 |
curses_keyboard_setup(); |
346 |
exit_notifier_add(¬ifier);
|
|
345 |
atexit(curses_atexit);
|
|
347 | 346 |
|
348 | 347 |
#ifndef _WIN32 |
349 | 348 |
#if defined(SIGWINCH) && defined(KEY_RESIZE) |
b/hw/xen_backend.h | ||
---|---|---|
97 | 97 |
void xen_init_display(int domid); |
98 | 98 |
|
99 | 99 |
/* configuration (aka xenbus setup) */ |
100 |
void xen_config_cleanup(Notifier *notifier);
|
|
100 |
void xen_config_cleanup(void);
|
|
101 | 101 |
int xen_config_dev_blk(DriveInfo *disk); |
102 | 102 |
int xen_config_dev_nic(NICInfo *nic); |
103 | 103 |
int xen_config_dev_vfb(int vdev, const char *type); |
b/hw/xen_devconfig.c | ||
---|---|---|
17 | 17 |
QTAILQ_INSERT_TAIL(&xs_cleanup, d, list); |
18 | 18 |
} |
19 | 19 |
|
20 |
void xen_config_cleanup(Notifier *notifier)
|
|
20 |
void xen_config_cleanup(void)
|
|
21 | 21 |
{ |
22 | 22 |
struct xs_dirs *d; |
23 | 23 |
|
b/hw/xen_domainbuild.c | ||
---|---|---|
211 | 211 |
} |
212 | 212 |
|
213 | 213 |
/* normal cleanup */ |
214 |
static void xen_domain_cleanup(Notifier *notifier)
|
|
214 |
static void xen_domain_cleanup(void)
|
|
215 | 215 |
{ |
216 | 216 |
char *dom; |
217 | 217 |
|
... | ... | |
232 | 232 |
unsigned int xenstore_port = 0, console_port = 0; |
233 | 233 |
unsigned long xenstore_mfn = 0, console_mfn = 0; |
234 | 234 |
int rc; |
235 |
static Notifier exit_notifier = { .notify = xen_domain_cleanup }; |
|
236 | 235 |
|
237 | 236 |
memcpy(uuid, qemu_uuid, sizeof(uuid)); |
238 | 237 |
rc = xc_domain_create(xen_xc, ssidref, uuid, flags, &xen_domid); |
... | ... | |
241 | 240 |
goto err; |
242 | 241 |
} |
243 | 242 |
qemu_log("xen: created domain %d\n", xen_domid); |
244 |
exit_notifier_add(&exit_notifier);
|
|
243 |
atexit(xen_domain_cleanup);
|
|
245 | 244 |
if (xen_domain_watcher() == -1) { |
246 | 245 |
goto err; |
247 | 246 |
} |
b/hw/xen_machine_pv.c | ||
---|---|---|
42 | 42 |
CPUState *env; |
43 | 43 |
DriveInfo *dinfo; |
44 | 44 |
int i; |
45 |
static Notifier exit_notifier = { .notify = xen_config_cleanup }; |
|
46 | 45 |
|
47 | 46 |
/* Initialize a dummy CPU */ |
48 | 47 |
if (cpu_model == NULL) { |
... | ... | |
106 | 105 |
} |
107 | 106 |
|
108 | 107 |
/* config cleanup hook */ |
109 |
exit_notifier_add(&exit_notifier);
|
|
108 |
atexit(xen_config_cleanup);
|
|
110 | 109 |
|
111 | 110 |
/* setup framebuffer */ |
112 | 111 |
xen_init_display(xen_domid); |
b/qemu-char.c | ||
---|---|---|
713 | 713 |
fcntl(0, F_SETFL, old_fd0_flags); |
714 | 714 |
} |
715 | 715 |
|
716 |
static void term_exit_notifier(Notifier *notifier) |
|
717 |
{ |
|
718 |
term_exit(); |
|
719 |
} |
|
720 |
|
|
721 | 716 |
static void term_init(QemuOpts *opts) |
722 | 717 |
{ |
723 | 718 |
struct termios tty; |
724 |
static Notifier exit_notifier = { .notify = term_exit_notifier }; |
|
725 | 719 |
|
726 | 720 |
tcgetattr (0, &tty); |
727 | 721 |
oldtty = tty; |
... | ... | |
741 | 735 |
|
742 | 736 |
tcsetattr (0, TCSANOW, &tty); |
743 | 737 |
|
744 |
if (!term_atexit_done++) { |
|
745 |
exit_notifier_add(&exit_notifier); |
|
746 |
} |
|
738 |
if (!term_atexit_done++) |
|
739 |
atexit(term_exit); |
|
747 | 740 |
|
748 | 741 |
fcntl(0, F_SETFL, O_NONBLOCK); |
749 | 742 |
} |
b/sdl.c | ||
---|---|---|
827 | 827 |
SDL_SetCursor(guest_sprite); |
828 | 828 |
} |
829 | 829 |
|
830 |
static void sdl_cleanup(Notifier *notifier)
|
|
830 |
static void sdl_cleanup(void)
|
|
831 | 831 |
{ |
832 | 832 |
if (guest_sprite) |
833 | 833 |
SDL_FreeCursor(guest_sprite); |
... | ... | |
840 | 840 |
uint8_t data = 0; |
841 | 841 |
DisplayAllocator *da; |
842 | 842 |
const SDL_VideoInfo *vi; |
843 |
static Notifier exit_notifier = { .notify = sdl_cleanup }; |
|
844 | 843 |
|
845 | 844 |
#if defined(__APPLE__) |
846 | 845 |
/* always use generic keymaps */ |
... | ... | |
893 | 892 |
sdl_cursor_hidden = SDL_CreateCursor(&data, &data, 8, 1, 0, 0); |
894 | 893 |
sdl_cursor_normal = SDL_GetCursor(); |
895 | 894 |
|
896 |
exit_notifier_add(&exit_notifier);
|
|
895 |
atexit(sdl_cleanup);
|
|
897 | 896 |
if (full_screen) { |
898 | 897 |
gui_fullscreen = 1; |
899 | 898 |
gui_fullscreen_initial_grab = 1; |
b/vl.c | ||
---|---|---|
537 | 537 |
} |
538 | 538 |
|
539 | 539 |
#ifdef _WIN32 |
540 |
static void socket_cleanup(Notifier *obj)
|
|
540 |
static void socket_cleanup(void)
|
|
541 | 541 |
{ |
542 | 542 |
WSACleanup(); |
543 | 543 |
} |
... | ... | |
546 | 546 |
{ |
547 | 547 |
WSADATA Data; |
548 | 548 |
int ret, err; |
549 |
static Notifier notifier = { .notify = socket_cleanup }; |
|
550 | 549 |
|
551 | 550 |
ret = WSAStartup(MAKEWORD(2,2), &Data); |
552 | 551 |
if (ret != 0) { |
... | ... | |
554 | 553 |
fprintf(stderr, "WSAStartup: %d\n", err); |
555 | 554 |
return -1; |
556 | 555 |
} |
557 |
exit_notifier_add(¬ifier);
|
|
556 |
atexit(socket_cleanup);
|
|
558 | 557 |
return 0; |
559 | 558 |
} |
560 | 559 |
#endif |
... | ... | |
3803 | 3802 |
|
3804 | 3803 |
error_set_progname(argv[0]); |
3805 | 3804 |
|
3806 |
exit_notifier_init(); |
|
3807 |
|
|
3808 | 3805 |
init_clocks(); |
3809 | 3806 |
|
3810 | 3807 |
qemu_cache_utils_init(envp); |
Also available in: Unified diff