Revision f64622c4 vl.c
b/vl.c | ||
---|---|---|
1215 | 1215 |
static QTAILQ_HEAD(reset_handlers, QEMUResetEntry) reset_handlers = |
1216 | 1216 |
QTAILQ_HEAD_INITIALIZER(reset_handlers); |
1217 | 1217 |
static int reset_requested; |
1218 |
static int shutdown_requested; |
|
1218 |
static int shutdown_requested, shutdown_signal = -1; |
|
1219 |
static pid_t shutdown_pid; |
|
1219 | 1220 |
static int powerdown_requested; |
1220 | 1221 |
static int debug_requested; |
1221 | 1222 |
static int vmstop_requested; |
... | ... | |
1227 | 1228 |
return r; |
1228 | 1229 |
} |
1229 | 1230 |
|
1231 |
void qemu_kill_report(void) |
|
1232 |
{ |
|
1233 |
if (shutdown_signal != -1) { |
|
1234 |
fprintf(stderr, "Got signal %d from pid %d\n", |
|
1235 |
shutdown_signal, shutdown_pid); |
|
1236 |
shutdown_signal = -1; |
|
1237 |
} |
|
1238 |
} |
|
1239 |
|
|
1230 | 1240 |
int qemu_reset_requested(void) |
1231 | 1241 |
{ |
1232 | 1242 |
int r = reset_requested; |
... | ... | |
1300 | 1310 |
qemu_notify_event(); |
1301 | 1311 |
} |
1302 | 1312 |
|
1313 |
void qemu_system_killed(int signal, pid_t pid) |
|
1314 |
{ |
|
1315 |
shutdown_signal = signal; |
|
1316 |
shutdown_pid = pid; |
|
1317 |
qemu_system_shutdown_request(); |
|
1318 |
} |
|
1319 |
|
|
1303 | 1320 |
void qemu_system_shutdown_request(void) |
1304 | 1321 |
{ |
1305 | 1322 |
shutdown_requested = 1; |
... | ... | |
1443 | 1460 |
vm_stop(VMSTOP_DEBUG); |
1444 | 1461 |
} |
1445 | 1462 |
if (qemu_shutdown_requested()) { |
1463 |
qemu_kill_report(); |
|
1446 | 1464 |
monitor_protocol_event(QEVENT_SHUTDOWN, NULL); |
1447 | 1465 |
if (no_shutdown) { |
1448 | 1466 |
vm_stop(VMSTOP_SHUTDOWN); |
Also available in: Unified diff