History | View | Annotate | Download (18.8 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>
block: Error parameter for create functions
Add an Error ** parameter to bdrv_create and its associated functions toallow more specific error messages.
block: Image file option amendment
This patch adds the "amend" option to qemu-img which allows changingimage options on existing image files. It also adds the generic bdrvimplementation which is basically just a wrapper for the image formatspecific function....
block: remove bdrv_is_allocated_above/bdrv_co_is_allocated_above distinction
Now that bdrv_is_allocated detects coroutine context, the two canuse the same code.
Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
block: introduce bdrv_get_block_status API
For now, bdrv_get_block_status is just another name for bdrv_is_allocated.The next patches will add more flags.
This also touches all block drivers with a mostly mechanical rename. Thesole exception is cow; because it calls cow_co_is_allocated from the read...
block: define get_block_status return value
Define the return value of get_block_status. Bits 0, 1, 2 and 9-62are valid; bit 63 (the sign bit) is reserved for errors. Bits 3-8are left for future extensions.
The return code is compatible with the old is_allocated API: if a driver...
block: implement reference count for BlockDriverState
Introduce bdrv_ref/bdrv_unref to manage the lifecycle ofBlockDriverState. They are unused for now but will used to replacebdrv_delete() later.
Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: make bdrv_delete() static
Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is nolonger public and should be called by bdrv_unref() if refcnt isdecreased to 0.
This is an identical change because effectively, there's no multiplereference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets...
block: make bdrv_co_is_allocated static
bdrv_is_allocated can detect coroutine context and go through a fastpath, similar to other block layer functions.
Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Enable the new throttling code in the block layer.
Signed-off-by: Benoit Canet <benoit@irqsave.net>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
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>
block: add bdrv_write_zeroes()
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Add return value for bdrv_flush_all()
bdrv_flush() can fail, and bdrv_flush_all() should return an error aswell if this happens for a block device. It returns the first errorreturn now, but still at least tries to flush the remaining devices even...
block: Don't parse protocol from file.filename
One of the major reasons for doing something new for -blockdev andblockdev-add was that the old block layer code parses filenames insteadof just taking them literally. So we should really leave it untouched...
block: change default of .has_zero_init to 0
.has_zero_init defaults to 1 for all formats and protocols.
this is a dangerous default since this means that allnew added drivers need to manually overwrite it to 0 ifthey do not ensure that a device is zero initialized...
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: move snapshot code in block.c to block/snapshot.c
All snapshot related code, except bdrv_snapshot_dump() andbdrv_is_snapshot(), is moved to block/snapshot.c. bdrv_snapshot_dump()will be moved to another file later. bdrv_is_snapshot() is not related...
block: move qmp and info dump related code to block/qapi.c
This patch is a pure code move patch, except following modification:1 get_human_readable_size() is changed to static function.2 dump_human_image_info() is renamed to bdrv_image_info_dump().3 in qmp_query_block() and qmp_query_blockstats, use bdrv_next(bs)...
block: drop bs_snapshots global variable
The bs_snapshots global variable points to the BlockDriverState whichwill be used to save vmstate. This is really a savevm.c concept but wasmoved into block.c:bdrv_snapshots() when it became clear that hotplugcould result in a dangling pointer....
block: add block driver read only whitelist
We may want to include a driver in the whitelist for read only taskssuch as diagnosing or exporting guest data (with libguestfs as a goodexample). This patch introduces a readonly whitelist option, and forbackward compatibility, the old configure option --block-drv-whitelist...
block: Add driver-specific options for backing files
Options starting in "backing." are passed to the backing file now. Ifyou don't need to specify the filename for the backing file, you can addit on the command line instead of in the image file:
$ qemu-nbd -t /tmp/test.img...
block: Introduce bdrv_writev_vmstate
block: Introduce bdrv_pwritev() for qcow2_save_vmstate
Directly pass the QEMUIOVector on instead of linearising it.
block: Add options QDict to bdrv_file_open() prototypes
The new parameter is unused yet.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
block: Add options QDict to bdrv_open() prototype
It doesn't do anything yet except storing the options QDict in theBlockDriverState.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>...
block: implement BDRV_O_UNMAP
It is better to present homogeneous hardware independent of the storagetechnology that is chosen on the host, hence we make discard a hostparameter; the user can choose whether to pass it down to the imageformat and protocol, or to ignore it....
qemu-img: add compressed clusters to BlockFragInfo
Show how many clusters are compressed. This can be used to monitor howmany compressed clusters remain and whether to recompress the image.
Suggested-by: Cole Robinson <crobinso@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Add synchronous wrapper for bdrv_co_is_allocated_above
There's no synchronous wrapper for bdrv_co_is_allocated_above functionso it's not possible to check for sector allocation in an image witha backing file.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>...
qemu-img: Add "Quiet mode" option
There can be a need to turn output to stdout off. This patch adds a -q optionthat enable "Quiet mode". In Quiet mode, only errors are printed out.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
qemu-img: find the image end offset during check
This patch adds the support for reporting the image end offset (inbytes). This is particularly useful after a conversion (or a rebase)where the destination is a block device in order to find the firstunused byte at the end of the image....
block: allow customizing the granularity of the dirty bitmap
Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: implement dirty bitmap using HBitmap
This actually uses the dirty bitmap in the block layer, and convertsmirroring to use an HBitmapIter.
Reviewed-by: Laszlo Ersek <lersek@redhat.com> (except block/mirror.c parts)Reviewed-by: Eric Blake <eblake@redhat.com>...
block: make round_to_clusters public
This is needed in the following patch.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: make qiov_is_aligned() public
The qiov_is_aligned() function checks whether a QEMUIOVector meets aBlockDriverState's alignment requirements. This is needed byvirtio-blk-data-plane so:
1. Move the function from block/raw-posix.c to block/block.c....
raw-posix: add raw_get_aio_fd() for virtio-blk-data-plane
The raw_get_aio_fd() function allows virtio-blk-data-plane to get thefile descriptor of a raw image file with Linux AIO enabled. Thisinterface is really a layering violation that can be resolved once the...
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block: move include files to include/block/