if (dwRet != 0) {
/* child process is terminated with some problem.
So qemu process will terminate, too. immediately. */
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
}
if (CloseHandle(pi.hProcess) != 0) {
if (ret != 0) {
/* child process is terminated with some problem.
So qemu process will terminate, too. immediately. */
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
}
}
#define RESUME_KEY_SEND_INTERVAL 500 /* milli-seconds */
#define CLOSE_POWER_KEY_INTERVAL 1200 /* milli-seconds */
#define DATA_DELIMITER "#" /* in detail info data */
-#define TIMEOUT_FOR_SHUTDOWN 10 /* seconds */
static int requested_shutdown_qemu_gracefully = 0;
maru_display_update();
}
-void shutdown_qemu_gracefully(void)
+void shutdown_qemu_gracefully(unsigned int sec)
{
if (is_requested_shutdown_qemu_gracefully() != 1) {
requested_shutdown_qemu_gracefully = 1;
INFO("shutdown_qemu_gracefully was called\n");
QemuThread thread_id;
- qemu_thread_create(&thread_id, "shutdown_thread", run_timed_shutdown_thread,
- NULL, QEMU_THREAD_DETACHED);
+ qemu_thread_create(&thread_id, "shutdown_thread",
+ run_timed_shutdown_thread, (void *)sec, QEMU_THREAD_DETACHED);
} else {
INFO("shutdown_qemu_gracefully was called twice\n");
qemu_system_shutdown_request();
{
send_shutdown_to_emuld();
- int sleep_interval_time = 1000; /* milli-seconds */
+ const int sleep_interval_time = 1000; /* milli-seconds */
+ const int timeout_for_shutdown = (const int)args;
int i;
- for (i = 0; i < TIMEOUT_FOR_SHUTDOWN; i++) {
+ for (i = 0; i < timeout_for_shutdown; i++) {
#ifdef CONFIG_WIN32
Sleep(sleep_interval_time);
#else
extern int ret_hax_init;
+#define TIMEOUT_FOR_SHUTDOWN 10 /* seconds */
+
typedef struct Framebuffer {
unsigned char* data;
unsigned int data_length;
void do_guestmemory_dump(void);
void request_close(void);
-void shutdown_qemu_gracefully(void);
+void shutdown_qemu_gracefully(unsigned int sec);
int is_requested_shutdown_qemu_gracefully(void);
#endif /* MARUSKIN_OPERATION_H_ */
perror("create listen socket error : ");
print_fail_log();
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
return NULL;
}
}
print_fail_log();
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
return NULL;
}
}
print_fail_log();
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
return NULL;
}
if (shutdown_qemu) {
print_fail_log();
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
}
return NULL;
ERR("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
maru_register_exit_msg(MARU_EXIT_HB_TIME_EXPIRED, NULL);
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
}
return NULL;
QMessageBox::No);
if (r == QMessageBox::Yes) {
/* force close */
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
} else {
event->ignore();
}
if (btn->text().compare("&Yes") == 0) {
qDebug() << "exit!";
/* force close */
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(1);
} else {
qDebug() << "cancel";
}
extern void maru_hwkey_event(int event_type, int keycode);
extern void do_rotation_event(int rotation_type);
extern void do_host_kbd_enable(bool on);
-extern void shutdown_qemu_gracefully(void);
+extern void shutdown_qemu_gracefully(unsigned int sec);
extern void request_close(void);
void* tizen_close_thread(void* data);
#endif
if (data == 1) {
/* force close */
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(10);
} else {
request_close();
}
no_shutdown = 0;
#ifdef CONFIG_MARU
- shutdown_qemu_gracefully();
+ shutdown_qemu_gracefully(TIMEOUT_FOR_SHUTDOWN);
#else
qemu_system_shutdown_request();
#endif