mirror_qemu/include
Fam Zheng fbe40ff780 block: Introduce op_blockers to BlockDriverState
BlockDriverState.op_blockers is an array of lists with BLOCK_OP_TYPE_MAX
elements. Each list is a list of blockers of an operation type
(BlockOpType), that marks this BDS as currently blocked for a certain
type of operation with reason errors stored in the list. The rule of
usage is:

 * BDS user who wants to take an operation should check if there's any
   blocker of the type with bdrv_op_is_blocked().

 * BDS user who wants to block certain types of operation, should call
   bdrv_op_block (or bdrv_op_block_all to block all types of operations,
   which is similar to the existing bdrv_set_in_use()).

 * A blocker is only referenced by op_blockers, so the lifecycle is
   managed by caller, and shouldn't be lost until unblock, so typically
   a caller does these:

   - Allocate a blocker with error_setg or similar, call bdrv_op_block()
     to block some operations.
   - Hold the blocker, do his job.
   - Unblock operations that it blocked, with the same reason pointer
     passed to bdrv_op_unblock().
   - Release the blocker with error_free().

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-05-28 14:28:46 +02:00
..
block block: Introduce op_blockers to BlockDriverState 2014-05-28 14:28:46 +02:00
disas disas: Implement disassembly output for A64 2014-02-08 14:50:48 +00:00
exec tcg-mips: Enable direct chaining of TBs 2014-05-24 08:48:37 -07:00
fpu softfloat: Introduce float32_to_uint64_round_to_zero 2014-04-08 11:20:00 +02:00
hw input: switch hid mouse and tablet to the new input layer api. 2014-05-26 08:42:43 +02:00
migration migration: expose xbzrle cache miss rate 2014-05-05 22:15:03 +02:00
monitor monitor: add Error-propagating monitor_handle_fd_param2() 2014-05-08 14:19:58 -04:00
net net: remove implicit peer from offload API 2014-02-25 14:31:05 +01:00
qapi purge error_is_set() 2014-05-22 18:14:01 +01:00
qemu bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc 2014-05-24 00:07:29 +04:00
qom cpu: Avoid QOM casts for CPU() 2014-03-31 19:28:38 +02:00
sysemu s390x/virtio-ccw: wire up irq routing and irqfds 2014-05-20 13:05:58 +02:00
ui input: bind devices and input routing 2014-05-26 08:42:43 +02:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h linux-user/elfload.c: Support ARM HWCAP2 flags 2014-05-02 21:59:36 +03:00
glib-compat.h glib: fix g_poll early timeout on windows 2014-05-09 20:57:35 +02:00
qemu-common.h util: add qemu_iovec_is_zero 2014-05-19 12:20:19 +02:00
qemu-io.h qemu-io: Fix warnings from static code analysis 2014-03-13 14:42:24 +01:00
trace.h build: some simplifications for "trace/Makefile.objs" 2013-01-12 18:42:51 +01:00