qemu-e2k/include/sysemu
Eric Blake aedbe19297 shutdown: Prepare for use of an enum in reset/shutdown_request
We want to track why a guest was shutdown; in particular, being able
to tell the difference between a guest request (such as ACPI request)
and host request (such as SIGINT) will prove useful to libvirt.
Since all requests eventually end up changing shutdown_requested in
vl.c, the logical change is to make that value track the reason,
rather than its current 0/1 contents.

Since command-line options control whether a reset request is turned
into a shutdown request instead, the same treatment is given to
reset_requested.

This patch adds an internal enum ShutdownCause that describes reasons
that a shutdown can be requested, and changes qemu_system_reset() to
pass the reason through, although for now nothing is actually changed
with regards to what gets reported.  The enum could be exported via
QAPI at a later date, if deemed necessary, but for now, there has not
been a request to expose that much detail to end clients.

For the most part, we turn 0 into SHUTDOWN_CAUSE_NONE, and 1 into
SHUTDOWN_CAUSE_HOST_ERROR; the only specific case where we have enough
information right now to use a different value is when we are reacting
to a host signal.  It will take a further patch to edit all call-sites
that can trigger a reset or shutdown request to properly pass in any
other reasons; this patch includes TODOs to point such places out.

qemu_system_reset() trades its 'bool report' parameter for a
'ShutdownCause reason', with all non-zero values having the same
effect; this lets us get rid of the weird #defines for VMRESET_*
as synonyms for bools.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170515214114.15442-3-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-05-23 13:28:17 +02:00
..
accel.h
arch_init.h nios2: Add support for Nios-II R1 2017-01-24 13:10:36 -08:00
balloon.h
block-backend.h block: Add errp to b{lk,drv}_truncate() 2017-04-28 16:02:02 +02:00
blockdev.h blockdev: Make orphaned -drive fatal 2017-02-21 13:17:45 +01:00
bt.h
char.h A large set of small patches. I have not included yet vhost-user-scsi, 2017-05-08 13:29:40 -04:00
cpus.h cpus: define QEMUTimerListNotifyCB for QEMU system emulation 2017-03-14 13:28:29 +01:00
cryptodev.h cryptodev: wrap the ready flag 2017-01-10 07:02:52 +02:00
device_tree.h
dma.h dma-helpers: explicitly pass alignment into DMA helpers 2016-10-27 16:29:13 -04:00
dump-arch.h
dump.h dump: Acquire BQL around vm_start() in dump thread 2017-05-05 12:10:00 +02:00
hax.h target/i386: Add Intel HAX files 2017-01-19 22:07:46 +01:00
hostmem.h hostmem: introduce host_memory_backend_mr_inited() 2017-04-20 15:22:41 -03:00
hw_accel.h Plumb the HAXM-based hardware acceleration support 2017-01-19 22:07:46 +01:00
iothread.h iothread: add poll-grow and poll-shrink parameters 2017-01-03 16:38:50 +00:00
kvm_int.h
kvm.h spapr: Add ibm,processor-radix-AP-encodings to the device tree 2017-04-26 12:00:41 +10:00
memory_mapping.h
numa.h numa: remove node_cpu bitmaps as they are no longer used 2017-05-11 16:08:50 -03:00
os-posix.h build: include sys/sysmacros.h for major() and minor() 2017-03-14 10:08:22 +00:00
os-win32.h log: Add locking to large logging blocks 2016-11-01 10:29:03 -06:00
qtest.h
replay.h replay: add record/replay for audio passthrough 2017-03-01 15:11:44 +01:00
reset.h hw: move reset handlers from vl.c to hw/core 2017-01-16 17:52:35 +01:00
rng-random.h
rng.h
seccomp.h
sysemu.h shutdown: Prepare for use of an enum in reset/shutdown_request 2017-05-23 13:28:17 +02:00
tpm_backend_int.h
tpm_backend.h
tpm.h
watchdog.h
xen-mapcache.h xen/mapcache: store dma information in revmapcache entries for debugging 2017-05-16 11:49:09 -07:00