Statistics
| Branch: | Revision:

root / block / raw_bsd.c @ 34b5d2c6

History | View | Annotate | Download (5.8 kB)

# Date Author Comment
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 <>

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