Statistics
| Branch: | Revision:

root / block / raw_bsd.c @ feature-archipelago

History | View | Annotate | Download (6.2 kB)

# Date Author Comment
84d18f06 02/17/2014 06:57 pm Markus Armbruster

Use error_is_set() only when necessary

error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out. Unnecessarily hard for
optimizers, static checkers, and human readers. Dumb it down to
obvious.

Gets rid of several dozen Coverity false positives....

ad6aef43 02/09/2014 10:12 am Kevin Wolf

raw: Fix BlockLimits passthrough

raw copies over the BlockLimits of bs->file during bdrv_open().
However, since commit d34682cd it is immediately overwritten during
bdrv_refresh_limits(). This caused all fields except for
opt_transfer_length and opt_mem_alignment (which happen to be correctly...

aa7bfbff 11/28/2013 11:30 am Peter Lieven

block: add flags to bdrv_*_write_zeroes

Reviewed-by: Eric Blake <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

04f19e4d 11/28/2013 11:30 am Peter Lieven

block/raw: copy BlockLimits on raw_open

Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

b94a2610 10/29/2013 02:10 pm Kevin Wolf

block: Avoid unecessary drv->bdrv_getlength() calls

The block layer generally keeps the size of an image cached in
bs->total_sectors so that it doesn't have to perform expensive
operations to get the size whenever it needs it.

This doesn't work however when using a backend that can change its size...

92f1deec 10/11/2013 05:50 pm Max Reitz

block/raw_bsd: Employ error parameter

Propagate errors in raw_create rather than directly reporting and
afterwards discarding them.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

92bc50a5 10/11/2013 05:49 pm Peter Lieven

block/get_block_status: avoid redundant callouts on raw devices

if a raw device like an iscsi target or host device is used
the current implementation makes a second call out to get
the block status of bs->file.

Signed-off-by: Peter Lieven <>
Reviewed-by: Eric Blake <>...

d5124c00 09/12/2013 11:12 am Max Reitz

bdrv: Use "Error" for creating images

Add an Error ** parameter to BlockDriver.bdrv_create to allow more
specific error messages.

Signed-off-by: Max Reitz <>

cc84d90f 09/12/2013 11:12 am Max Reitz

block: Error parameter for create functions

Add an Error ** parameter to bdrv_create and its associated functions to
allow more specific error messages.

Signed-off-by: Max Reitz <>

015a1036 09/12/2013 11:12 am Max Reitz

bdrv: Use "Error" for opening images

Add an Error ** parameter to BlockDriver.bdrv_open and
BlockDriver.bdrv_file_open to allow more specific error messages.

Signed-off-by: Max Reitz <>

b6b8a333 09/06/2013 04:25 pm Paolo Bonzini

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. The
sole exception is cow; because it calls cow_co_is_allocated from the read...

bdad13b9 09/06/2013 04:25 pm Paolo Bonzini

block: make bdrv_co_is_allocated static

bdrv_is_allocated can detect coroutine context and go through a fast
path, similar to other block layer functions.

Reviewed-by: Eric Blake <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

e1c66c6d 08/30/2013 04:28 pm Laszlo Ersek

add skeleton for BSD licensed "raw" BlockDriver

On 08/05/13 15:03, Paolo Bonzini wrote:

----- Original Message -----

From: "Laszlo Ersek" <>
To: "Paolo Bonzini" <>
Sent: Monday, August 5, 2013 2:43:46 PM...

9eaafd90 08/30/2013 04:28 pm Laszlo Ersek

raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev()

On 08/05/13 15:03, Paolo Bonzini wrote:

[...]

1) BlockDriver is a struct in which these function members are
interesting:

.bdrv_reopen_prepare
.bdrv_co_readv
.bdrv_co_writev...

1565262c 08/30/2013 04:28 pm Laszlo Ersek

raw_bsd: add raw_create()

On 08/05/13 15:03, Paolo Bonzini wrote:

[...]

2) This is also a simple forwarder function:

.bdrv_create

but there is no BlockDriverState argument so the forwarded-to function
does not have a bs->file argument either. The forwarded-to function is...

01dd96d8 08/30/2013 04:28 pm Laszlo Ersek

raw_bsd: introduce "special members"

On 08/05/13 15:03, Paolo Bonzini wrote:

[...]

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...

ff369a48 08/30/2013 04:28 pm Laszlo Ersek

raw_bsd: add raw_create_options

On 08/05/13 15:03, Paolo Bonzini wrote:

[...]

4) There is another member, .create_options, which is an array of
QEMUOptionParameter structs, terminated by an all-zero item. The only
option you need is for the virtual disk size. You will find something...

775d6afd 08/30/2013 04:28 pm Laszlo Ersek

raw_bsd: register bdrv_raw

On 08/05/13 15:03, Paolo Bonzini wrote:

[...]

5) Formats are registered with bdrv_register (takes a BlockDriver*). You
also need to pass the caller of bdrv_register to block_init.

Fill in the BlockDriver structure with the raw_*() functions that have...

7a6d3fc5 08/30/2013 04:28 pm Laszlo Ersek

switch raw block driver from "raw.o" to "raw_bsd.o"

"Incoming" function prototypes and "outgoing" function calls must match
reality. Implemented using the "struct BlockDriver" definition in
"include/block/block_int.h", and gcc errors & warnings.

v1->v2:...