QEMU With E2K User Support
Go to file
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
audio audio: Drop superfluous conditionals around g_free() 2014-06-13 12:34:54 +02:00
backends hostmem: add properties for NUMA memory policy 2014-06-19 18:44:21 +03:00
block sheepdog: fix NULL dereference in sd_create 2014-06-23 16:36:13 +08:00
bsd-user bsd-user: Fix syscall format, add strace support for more syscalls 2014-06-11 00:25:06 +01:00
default-configs pc: implement pc-dimm device abstraction 2014-06-19 16:41:47 +03:00
disas
docs block: asynchronously stop the VM on I/O errors 2014-06-23 16:36:13 +08:00
dtc@bc895d6d09
fpu
fsdev
gdb-xml
hw block: m25p80: Support read only bdrvs. 2014-06-21 16:40:14 +08:00
include vl: allow other threads to do qemu_system_vmstop_request 2014-06-23 16:36:13 +08:00
libcacard Merge remote-tracking branch 'remotes/bonzini/configure' into staging 2014-06-11 15:36:48 +01:00
libdecnumber libdecnumber: Fix decNumberSetBCD 2014-06-16 13:24:29 +02:00
linux-headers linux-headers: update linux headers to kvm/next 2014-06-16 13:24:41 +02:00
linux-user target-mips: implement UserLocal Register 2014-06-18 18:10:47 +02:00
net Add the vhost-user netdev backend to the command line 2014-06-19 18:44:18 +03:00
pc-bios PPC: Add u-boot firmware for e500 2014-06-16 13:24:35 +02:00
pixman@97336fad32
po
qapi qapi/string-output-visitor: fix bugs 2014-06-19 18:44:22 +03:00
qga qga: Fix handle fd leak in acquire_privilege() 2014-06-03 15:07:59 -05:00
qobject json-parser: drop superfluous assignment for token variable 2014-06-11 10:10:29 -04:00
qom qom: introduce object_property_get_enum and object_property_get_uint16List 2014-06-19 18:44:19 +03:00
roms PPC: Add u-boot firmware for e500 2014-06-16 13:24:35 +02:00
scripts linux-headers: include psci.h 2014-06-16 13:24:41 +02:00
slirp slirp: Remove unused zero_ethaddr[] variable 2014-06-10 19:39:34 +04:00
stubs block: asynchronously stop the VM on I/O errors 2014-06-23 16:36:13 +08:00
sysconfigs/target
target-alpha softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
target-arm target-arm: Introduce per-CPU field for PSCI version 2014-06-19 18:33:04 +01:00
target-cris target-cris/translate.c: Remove _t_gen_mov_TN_env and _t_gen_mov_env_TN 2014-06-09 01:04:44 +02:00
target-i386 target-i386: Use Common ShiftRows and InvShiftRows Tables 2014-06-16 13:24:33 +02:00
target-lm32 vl: allow other threads to do qemu_system_vmstop_request 2014-06-23 16:36:13 +08:00
target-m68k softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
target-microblaze target-microblaze: Delete unused sign_extend() function 2014-06-10 19:39:34 +04:00
target-mips target-mips: copy CP0_Config1 into DisasContext 2014-06-20 22:14:13 +02:00
target-moxie softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
target-openrisc softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
target-ppc PPC: KVM: Make pv hcall endian agnostic 2014-06-16 13:24:46 +02:00
target-s390x s390x/kvm: inject via flic 2014-06-10 09:50:27 +02:00
target-sh4 softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
target-sparc softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
target-unicore32 softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
target-xtensa softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
tcg tcg/optimize: Don't special case TCG_OPF_CALL_CLOBBER 2014-06-18 11:39:02 -07:00
tests tests: simplify code 2014-06-19 18:44:22 +03:00
trace glib-compat.h: add new thread API emulation on top of pre-2.31 API 2014-06-10 07:44:01 +02:00
ui vnc: cleanups and fixes 2014-06-20 16:57:28 +01:00
util QemuOpts: check NULL opts in qemu_opt_get functions 2014-06-21 16:40:14 +08:00
.exrc
.gitignore
.gitmodules PPC: Add u-boot firmware for e500 2014-06-16 13:24:35 +02:00
.mailmap
.travis.yml trace: Multi-backend tracing 2014-06-09 15:43:40 +02:00
aio-posix.c
aio-win32.c
arch_init.c migration: catch unknown flags in ram_load 2014-06-16 04:55:27 +02:00
async.c aio: fix qemu_bh_schedule() bh->ctx race condition 2014-06-04 09:56:06 +02:00
balloon.c
block-migration.c block: fix wrong order in live block migration setup 2014-06-04 11:22:39 +02:00
block.c block: asynchronously stop the VM on I/O errors 2014-06-23 16:36:13 +08:00
blockdev-nbd.c
blockdev.c blockdev: Remove unused DriveInfo reference count 2014-06-16 17:23:19 +08:00
blockjob.c block: Move op_blocker check from block_job_create to its caller 2014-05-28 14:28:46 +02:00
bt-host.c
bt-vhci.c
Changelog
CODING_STYLE
configure Merge remote-tracking branch 'remotes/kvm/uq/master' into staging 2014-06-20 19:25:18 +01:00
COPYING
COPYING.LIB
coroutine-gthread.c glib-compat.h: add new thread API emulation on top of pre-2.31 API 2014-06-10 07:44:01 +02:00
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
cpu-exec.c
cpus.c vl: allow other threads to do qemu_system_vmstop_request 2014-06-23 16:36:13 +08:00
cputlb.c softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
device_tree.c
device-hotplug.c blockdev: Remove unused DriveInfo reference count 2014-06-16 17:23:19 +08:00
disas.c monitor: QEMU Monitor Instruction Disassembly Incorrect for PowerPC LE Mode 2014-06-16 13:24:26 +02:00
dma-helpers.c
dump.c dump: Make DumpState and endian conversion routines available for arch-specific dump code 2014-06-16 13:24:36 +02:00
exec.c hostmem: add property to map memory with MAP_SHARED 2014-06-19 18:44:20 +03:00
gdbstub.c
HACKING
hmp-commands.hx Add the vhost-user netdev backend to the command line 2014-06-19 18:44:18 +03:00
hmp.c hmp: add info memdev 2014-06-19 18:44:21 +03:00
hmp.h hmp: add info memdev 2014-06-19 18:44:21 +03:00
iohandler.c
ioport.c
iothread.c
kvm-all.c Merge remote-tracking branch 'remotes/kvm/uq/master' into staging 2014-06-20 19:25:18 +01:00
kvm-stub.c Add kvm_eventfds_enabled function 2014-06-19 16:41:54 +03:00
LICENSE
main-loop.c
MAINTAINERS Merge remote-tracking branch 'remotes/kvm/uq/master' into staging 2014-06-20 19:25:18 +01:00
Makefile trace: Multi-backend tracing 2014-06-09 15:43:40 +02:00
Makefile.objs
Makefile.target NUMA: move numa related code to new file numa.c 2014-06-19 18:44:18 +03:00
memory_mapping.c
memory.c hostmem: add property to map memory with MAP_SHARED 2014-06-19 18:44:20 +03:00
migration-exec.c
migration-fd.c
migration-rdma.c rdma: Fix block during rdma migration 2014-06-16 04:55:27 +02:00
migration-tcp.c
migration-unix.c
migration.c migration: catch unknown flags in ram_load 2014-06-16 04:55:27 +02:00
module-common.c
monitor.c qmp: add ACPI_DEVICE_OST event handling 2014-06-19 18:44:22 +03:00
nbd.c
numa.c numa: handle mmaped memory allocation failure correctly 2014-06-19 18:44:22 +03:00
os-posix.c
os-win32.c
page_cache.c migration: Plug memory leak in migrate-set-cache-size command 2014-06-10 19:54:43 +04:00
qapi-schema.json qmp: add query-acpi-ospm-status command 2014-06-19 18:44:22 +03:00
qdev-monitor.c qdev: Implement named GPIOs 2014-05-28 17:36:21 +02:00
qdict-test-data.txt
qemu-bridge-helper.c
qemu-char.c Add G_IO_HUP handler for socket chardev 2014-06-19 16:41:55 +03:00
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c
qemu-doc.texi
qemu-file.c
qemu-img-cmds.hx
qemu-img.c cleanup QEMUOptionParameter 2014-06-16 17:23:21 +08:00
qemu-img.texi qemu-img: Document check exit codes 2014-06-04 11:30:32 +02:00
qemu-io-cmds.c
qemu-io.c trace: Multi-backend tracing 2014-06-09 15:43:40 +02:00
qemu-log.c
qemu-nbd.c qemu-nbd: Don't use qerror_report() 2014-05-28 14:28:46 +02:00
qemu-nbd.texi
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx numa: add -numa node,memdev= option 2014-06-19 18:44:19 +03:00
qemu-seccomp.c
qemu-tech.texi
qemu-timer.c
qemu.nsi
qemu.sasl
qmp-commands.hx qmp: add query-acpi-ospm-status command 2014-06-19 18:44:22 +03:00
qmp.c qmp: add query-acpi-ospm-status command 2014-06-19 18:44:22 +03:00
qtest.c qtest: fix hex2nib for capital characters 2014-06-10 19:39:34 +04:00
README
rules.mak rules.mak: remove $(sort) from extract-libs 2014-06-16 16:01:50 +01:00
savevm.c migration: introduce self_announce_delay() 2014-06-19 16:41:54 +03:00
softmmu_template.h softmmu: move softmmu_template.h out of include/ 2014-06-05 16:10:33 +02:00
spice-qemu-char.c
tcg-runtime.c tcg: Push tcg-runtime routines into exec/helper-* 2014-05-28 09:33:54 -07:00
tci.c Merge remote-tracking branch 'remotes/bonzini/softmmu-smap' into staging 2014-06-05 21:06:14 +01:00
thread-pool.c aio: Fix use-after-free in cancellation path 2014-05-28 14:28:46 +02:00
thunk.c
tpm.c
trace-events trace: pc: add PC_DIMM slot & address allocation 2014-06-19 16:41:50 +03:00
translate-all.c memory: move preallocation code out of exec.c 2014-06-19 18:44:19 +03:00
translate-all.h
user-exec.c softmmu: introduce cpu_ldst.h 2014-06-05 16:10:33 +02:00
VERSION
version.rc
vl.c vl: allow other threads to do qemu_system_vmstop_request 2014-06-23 16:36:13 +08:00
vmstate.c
xbzrle.c
xen-common-stub.c
xen-common.c
xen-hvm-stub.c
xen-hvm.c xen: replace ffsl with ctzl 2014-06-11 00:25:06 +01:00
xen-mapcache.c

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team