xemu/docs
Paolo Bonzini 2bd3bce8ef block: asynchronously stop the VM on I/O errors
With virtio-blk dataplane, I/O errors might occur while QEMU is
not in the main I/O thread.  However, it's invalid to call vm_stop
when we're neither in a VCPU thread nor in the main I/O thread,
even if we were to take the iothread mutex around it.

To avoid this problem, we can raise a request to the main I/O thread,
similar to what QEMU does when vm_stop is called from a CPU thread.
We know that bdrv_error_action is called from an AIO callback, and
the moment at which the callback will fire is not well-defined; it
depends on the moment at which the disk or OS finishes the operation,
which can happen at any time.  Note that QEMU is certainly not in a CPU
thread and we do not need to call cpu_stop_current() like vm_stop() does.

However, we need to ensure that any action taken by management will
result in correct detection of the error _and_ a running VM.  In particular:

- the event must be raised after the iostatus has been set, so that
"info block" will return an iostatus that matches the event.

- the VM must be stopped after the iostatus has been set, so that
"info block" will return an iostatus that matches the runstate.

The ordering between the STOP and BLOCK_IO_ERROR events is preserved;
BLOCK_IO_ERROR is documented to come first.

This makes bdrv_error_action() thread safe (assuming QMP events are,
which is attacked by a separate series).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-06-23 16:36:13 +08:00
..
qmp block: asynchronously stop the VM on I/O errors 2014-06-23 16:36:13 +08:00
specs Add vhost-user protocol documentation 2014-06-19 18:44:18 +03:00
atomics.txt add a header file for atomic operations 2013-07-04 17:42:49 +02:00
blkverify.txt blkverify: Add block driver for verifying I/O 2010-09-21 17:00:53 +02:00
bootindex.txt Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
ccid.txt libcacard: improve documentation 2014-06-10 07:44:01 +02:00
ich9-ehci-uhci.cfg usb: update documentation 2011-07-08 11:25:56 +02:00
libcacard.txt libcacard: Spelling and grammar fixes in documentation 2012-03-08 15:22:11 +00:00
live-block-ops.txt docs: describe live block operations 2012-01-26 14:49:18 +01:00
memory.txt docs/memory.txt: Fix document on MMIO operations 2014-05-07 21:00:44 +04:00
migration.txt savevm: Remove all the unneeded version_minimum_id_old (rest) 2014-05-14 15:24:51 +02:00
multiseat.txt docs/multiseat.txt: add note about spice 2014-06-04 08:40:42 +02:00
q35-chipset.cfg q35: Add PCIe switch to example q35 configuration 2013-08-21 12:39:15 +03:00
qapi-code-gen.txt qapi: skip redundant includes 2014-05-16 10:35:59 -04:00
qdev-device-use.txt docs: Fix qdev-device-use.txt typo in -chardev serial, path=COM<NUM> 2011-09-09 09:43:17 +01:00
qemupciserial.inf Docs: Introduce multiport serial support in qemupciserial.inf. 2014-03-12 10:33:23 +01:00
rdma.txt rdma: rename 'x-rdma' => 'rdma' 2014-02-25 14:30:28 +01:00
spice-port-fqdn.txt docs: add spice-port-fqdn.txt 2012-12-17 14:01:41 +01:00
tracing.txt trace: Multi-backend tracing 2014-06-09 15:43:40 +02:00
usb2.txt usb: update docs for bus name change 2013-04-03 11:39:43 +02:00
usb-storage.txt Fix typos and misspellings 2013-03-22 13:25:07 +01:00
virtio-balloon-stats.txt virtio-balloon: return empty data when no stats are available 2014-05-25 12:46:58 +03:00
vnc-ledstate-Pseudo-encoding.txt doc: document the Pseudo-encoding of LED state 2013-04-29 08:28:51 -05:00
writing-qmp-commands.txt qmp hmp: Consistently name Error * objects err, and not errp 2014-05-08 14:20:00 -04:00
xbzrle.txt Add XBZRLE documentation 2012-08-08 13:51:11 +02:00
xen-save-devices-state.txt Introduce "xen-save-devices-state" 2012-03-19 18:21:00 +00:00