History | View | Annotate | Download (6.2 kB)
Use error_is_set() only when necessary
error_is_set(&var) is the same as var != NULL, but it takeswhole-program analysis to figure that out. Unnecessarily hard foroptimizers, static checkers, and human readers. Dumb it down toobvious.
Gets rid of several dozen Coverity false positives....
raw: Fix BlockLimits passthrough
raw copies over the BlockLimits of bs->file during bdrv_open().However, since commit d34682cd it is immediately overwritten duringbdrv_refresh_limits(). This caused all fields except foropt_transfer_length and opt_mem_alignment (which happen to be correctly...
block: add flags to bdrv_*_write_zeroes
Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/raw: copy BlockLimits on raw_open
Signed-off-by: Peter Lieven <pl@kamp.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: Avoid unecessary drv->bdrv_getlength() calls
The block layer generally keeps the size of an image cached inbs->total_sectors so that it doesn't have to perform expensiveoperations to get the size whenever it needs it.
This doesn't work however when using a backend that can change its size...
block/raw_bsd: Employ error parameter
Propagate errors in raw_create rather than directly reporting andafterwards discarding them.
Signed-off-by: Max Reitz <mreitz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/get_block_status: avoid redundant callouts on raw devices
if a raw device like an iscsi target or host device is usedthe current implementation makes a second call out to getthe block status of bs->file.
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Eric Blake <eblake@redhat.com>...
bdrv: Use "Error" for creating images
Add an Error ** parameter to BlockDriver.bdrv_create to allow morespecific 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.
bdrv: Use "Error" for opening images
Add an Error ** parameter to BlockDriver.bdrv_open andBlockDriver.bdrv_file_open to allow more specific error messages.
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: 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>
add skeleton for BSD licensed "raw" BlockDriver
On 08/05/13 15:03, Paolo Bonzini wrote:
----- Original Message ----- From: "Laszlo Ersek" <lersek@redhat.com>To: "Paolo Bonzini" <pbonzini@redhat.com>Sent: Monday, August 5, 2013 2:43:46 PM...
----- Original Message -----
From: "Laszlo Ersek" <lersek@redhat.com>To: "Paolo Bonzini" <pbonzini@redhat.com>Sent: Monday, August 5, 2013 2:43:46 PM...
raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev()
[...] 1) BlockDriver is a struct in which these function members areinteresting: .bdrv_reopen_prepare.bdrv_co_readv.bdrv_co_writev...
[...]
1) BlockDriver is a struct in which these function members areinteresting:
.bdrv_reopen_prepare.bdrv_co_readv.bdrv_co_writev...
raw_bsd: add raw_create()
[...] 2) This is also a simple forwarder function: .bdrv_create but there is no BlockDriverState argument so the forwarded-to functiondoes not have a bs->file argument either. The forwarded-to function is...
2) This is also a simple forwarder function:
.bdrv_create
but there is no BlockDriverState argument so the forwarded-to functiondoes not have a bs->file argument either. The forwarded-to function is...
raw_bsd: introduce "special members"
[...] 3) These members are special .format_name is the string "raw" .bdrv_open raw_open should set bs->sg to bs->file->sg and return 0.bdrv_close raw_close should do nothing...
3) These members are special
.format_name is the string "raw" .bdrv_open raw_open should set bs->sg to bs->file->sg and return 0.bdrv_close raw_close should do nothing...
raw_bsd: add raw_create_options
[...] 4) There is another member, .create_options, which is an array ofQEMUOptionParameter structs, terminated by an all-zero item. The onlyoption you need is for the virtual disk size. You will find something...
4) There is another member, .create_options, which is an array ofQEMUOptionParameter structs, terminated by an all-zero item. The onlyoption you need is for the virtual disk size. You will find something...
raw_bsd: register bdrv_raw
[...] 5) Formats are registered with bdrv_register (takes a BlockDriver*). Youalso need to pass the caller of bdrv_register to block_init.
5) Formats are registered with bdrv_register (takes a BlockDriver*). Youalso need to pass the caller of bdrv_register to block_init.
Fill in the BlockDriver structure with the raw_*() functions that have...
switch raw block driver from "raw.o" to "raw_bsd.o"
"Incoming" function prototypes and "outgoing" function calls must matchreality. Implemented using the "struct BlockDriver" definition in"include/block/block_int.h", and gcc errors & warnings.
v1->v2:...