History | View | Annotate | Download (17.6 kB)
block: Error parameter for open functions
Add an Error ** parameter to bdrv_open, bdrv_file_open and associatedfunctions to allow more specific error messages.
Signed-off-by: Max Reitz <mreitz@redhat.com>
bdrv: Use "Error" for opening images
Add an Error ** parameter to BlockDriver.bdrv_open andBlockDriver.bdrv_file_open to allow more specific error messages.
qcow2-refcount: Repair shared refcount blocks
If the refcount of a refcount block is greater than one, we can at leasttry to repair that problem by duplicating the affected block.
Signed-off-by: Max Reitz <mreitz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Remove filename parameter from .bdrv_file_open()
It is unused now in all block drivers.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
blkdebug: Use bdrv_open options instead of filename
block: Add options QDict to bdrv_file_open() prototypes
The new parameter is unused yet.
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block: move include files to include/block/
janitor: do not rely on indirect inclusions of or from qemu-char.h
Various header files rely on qemu-char.h including qemu-config.h ormain-loop.h, but they really do not need qemu-char.h at all (particularlyinteresting is the case of the block layer!). Clean this up, and also...
blkdebug: Allow usage without config file
As soon as new rules can be set during runtime, as introduced by thenext patch, blkdebug makes sense even without a config file.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blkdebug: Factor out remove_rule()
The cleanup work to remove a rule depends on the type of the rule. It'seasy for the existing rules as there is no data that must be cleaned upand is specific to a type yet, but the next patch will change this.
blkdebug: Implement suspend/resume of AIO requests
This allows more systematic AIO testing. The patch adds three newoperations to blkdebug:
aio: rename AIOPool to AIOCBInfo
Now that AIOPool no longer keeps a freelist, it isn't really a "pool" anymore. Rename it to AIOCBInfo and make it const since it no longerneeds to be modified.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blkdebug: process all set_state rules in the old state
Currently it is impossible to write a blkdebug script that ping-pongsbetween two states, because the second set-state rule will use thestate that is set in the first. If you have
[set-state] event = "..."...
blkdebug: remove sync i/o events
These are unused, except (by mistake more or less) in QED.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blkdebug: tiny cleanup
blkdebug: pass getlength to underlying file
This is required when using blkdebug with raw format. Unlike qcow2/QED,raw asks blkdebug for the length of the file, it doesn't get it froma header.
blkdebug: store list of active rules
This prepares for the next patch, where some active rules may actuallynot trigger depending on input to readv/writev. Store the active rulesin a SIMPLEQ (so that it can be emptied easily with QSIMPLEQ_INIT), andfetch the errno/once/immediately arguments from there....
blkdebug: optionally tie errors to a specific sector
This makes blkdebug scripts more powerful, and independent of theexact sequence of operations performed by streaming.
block: push recursive flushing up from drivers
block: replace unchecked strdup/malloc/calloc with glib
Most of the codebase as been converted to use glib memory allocationfunctions. There are still a few instances of malloc/calloc in theblock layer and qemu-io. Replace them, especially since they do not...
block: drop redundant bdrv_flush implementation
Block drivers now only need to provide either of .bdrv_co_flush,.bdrv_aio_flush() or for legacy drivers .bdrv_flush(). Removethe redundant .bdrv_flush() implementations.
[Paolo Bonzini: change raw driver to bdrv_co_flush]...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
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.