History | View | Annotate | Download (12.8 kB)
block: Allow bdrv_flush to return errors
This changes bdrv_flush to return 0 on success and -errno in case of failure.It's a requirement for implementing proper error handle in users of bdrv_flush.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
blkdebug: fix enum comparison
The signedness of enum types depend on the compiler implementation.Therefore the check for negative values may or may not be meaningful.
Fix by explicitly casting to a signed integer.
Since the values are also checked earlier against event_names...
blkdebug: Fix set_state_opts definition
The list head was initialized to point to the wrong list, so all actions endedup being handled as inject-error even if they were set-state in fact.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blkdebug: Free QemuOpts after having read the config
Forgetting to free them means that the next instance inherits all rules andgets its own rules only additionally.
blkdebug: Initialize state as 1
state = 0 in rules means that the rule is valid for any state. Therefore it'simpossible to have a rule that works only in the initial state. This changesthe initial state from 0 to 1 to make this possible.
Move stdbool.h
Move inclusion of stdbool.h to common header files, instead of includingin an ad-hoc manner.
Signed-off-by: Paul Brook <paul@codesourcery.com>
block: Avoid unchecked casts for AIOCBs
Use container_of for one direction and &acb->common for the other one.
block: Open the underlying image file in generic code
Format drivers shouldn't need to bother with things like file names, but ratherjust get an open BlockDriverState for the underlying protocol. This patchintroduces this behaviour for bdrv_open implementation. For protocols which...
blkdebug: Add events and rules
Block drivers can trigger a blkdebug event whenever they reach a place where itcould be useful to inject an error for testing/debugging purposes.
Rules are read from a blkdebug config file and describe which action is taken...
qcow2: Trigger blkdebug events
This adds blkdebug events to qcow2 to allow injecting I/O errors in specificplaces.
blkdebug: Basic request passthrough
This isn't doing anything interesting. It creates the blkdebug block driver asa protocol which just passes everything through to raw.
blkdebug: Inject errors
Add a mechanism to inject errors instead of passing requests on. With nofurther patches applied, you can use it by setting inject_errno in gdb.