qemu/migration
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
..
block.c migration/block: use blk_pwrite_zeroes for each zero cluster 2017-04-21 10:36:12 +01:00
colo-comm.c COLO: Add 'x-colo-lost-heartbeat' command to trigger failover 2016-10-30 15:17:39 +05:30
colo-failover.c COLO: Implement the process of failover for primary VM 2016-10-30 15:17:39 +05:30
colo.c shutdown: Prepare for use of an enum in reset/shutdown_request 2017-05-23 13:28:17 +02:00
exec.c migration: setup bi-directional I/O channel for exec: protocol 2017-05-04 10:00:38 +02:00
fd.c migration: set name for all I/O channels created 2016-10-27 09:13:10 +02:00
Makefile.objs migration: Move page_cache.c to migration/ 2017-05-17 12:04:59 +02:00
migration.c migration: Move check_migratable() into qdev.c 2017-05-17 12:04:59 +02:00
page_cache.c migration: Move page_cache.c to migration/ 2017-05-17 12:04:59 +02:00
page_cache.h migration: Move page_cache.c to migration/ 2017-05-17 12:04:59 +02:00
postcopy-ram.c migration: Move postcopy stuff to postcopy-ram.c 2017-05-17 12:04:59 +02:00
postcopy-ram.h migration: Move postcopy stuff to postcopy-ram.c 2017-05-17 12:04:59 +02:00
qemu-file-channel.c migration: introduce a new QEMUFile impl based on QIOChannel 2016-05-26 11:31:24 +05:30
qemu-file.c add 'release-ram' migrate capability 2017-02-13 17:27:13 +00:00
qjson.c qjson: free str 2016-08-08 00:00:24 +04:00
ram.c HMP pull 2017-05-18 13:36:15 +01:00
rdma.c sockets: Prepare inet_parse() for flattened SocketAddress 2017-05-09 09:14:40 +02:00
savevm.c shutdown: Prepare for use of an enum in reset/shutdown_request 2017-05-23 13:28:17 +02:00
socket.c sockets: Limit SocketAddressLegacy to external interfaces 2017-05-09 09:14:40 +02:00
tls.c migration: to_dst_file at that point is NULL 2017-05-04 10:00:38 +02:00
trace-events migration: Extra tracing 2017-05-04 10:41:23 +02:00
vmstate.c vmstate: fix failed iotests case 68 and 91 2017-03-16 08:59:52 +01:00
xbzrle.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00