Statistics
| Branch: | Revision:

root / block_int.h @ 6fd2a026

History | View | Annotate | Download (12.9 kB)

# Date Author Comment
32c81a4a 09/28/2012 08:40 pm Paolo Bonzini

block: introduce block job error

The following behaviors are possible:

'report': The behavior is the same as in 1.1. An I/O error,
respectively during a read or a write, will complete the job immediately
with an error code.

'ignore': An I/O error, respectively during a read or a write, will be...

1d809098 09/28/2012 08:40 pm Paolo Bonzini

stream: add on-error argument

This patch adds support for error management to streaming.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

92aa5c6d 09/28/2012 08:40 pm Paolo Bonzini

iostatus: move BlockdevOnError declaration to QAPI

This will let block-stream reuse the enum. Places that used the enums
are renamed accordingly.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

ff06f5f3 09/28/2012 08:14 pm Paolo Bonzini

iostatus: rename BlockErrorAction, BlockQMPEventAction

We want to remove knowledge of BLOCK_ERR_STOP_ENOSPC from drivers;
drivers should only be told whether to stop/report/ignore the error.
On the other hand, we want to keep using the nicer BlockErrorAction...

2f0c9fe6 09/28/2012 08:14 pm Paolo Bonzini

block: move job APIs to separate files

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

7e03a934 09/28/2012 08:08 pm Paolo Bonzini

block: fix documentation of block_job_cancel_sync

Do this in a separate commit before we move the functions to
blockjob.h.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

747ff602 09/28/2012 07:23 pm Jeff Cody

block: add live block commit functionality

This adds the live commit coroutine. This iteration focuses on the
commit only below the active layer, and not the active layer itself.

The behaviour is similar to block streaming; the sectors are walked
through, and anything that exists above 'base' is committed back down...

dc1c13d9 09/24/2012 04:15 pm Jeff Cody

block: remove keep_read_only flag from BlockDriverState struct

The keep_read_only flag is no longer used, in favor of the bdrv
flag BDRV_O_ALLOW_RDWR.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

e971aa12 09/24/2012 04:15 pm Jeff Cody

block: Framework for reopening files safely

This is based on Supriya Kannery's bdrv_reopen() patch series.

This provides a transactional method to reopen multiple
images files safely.

Image files are queue for reopen via bdrv_reopen_queue(), and the
reopen occurs when bdrv_reopen_multiple() is called. Changes are...

9aeaddff 08/13/2012 07:20 pm Luiz Capitulino

block: block_int: include qerror.h

Several block/ files are relying on qerror.h being provided by
qapi-types.h. Fix this, as a future commit will change qapi-types.h
not to provide qerror.h.

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>

bfe8043e 08/06/2012 11:39 pm Stefan Hajnoczi

qcow2: implement lazy refcounts

Lazy refcounts is a performance optimization for qcow2 that postpones
refcount metadata updates and instead marks the image dirty. In the
case of crash or power failure the image will be left in a dirty state
and repaired next time it is opened....

2b584959 07/17/2012 05:48 pm Markus Armbruster

block: Geometry and translation hints are now useless, purge them

There are two producers of these hints: drive_init() on behalf of
-drive, and hd_geometry_guess().

The only consumer of the hint is hd_geometry_guess().

The callers of hd_geometry_guess() call it only when drive_init()...

4534ff54 06/15/2012 03:03 pm Kevin Wolf

qemu-img check -r for repairing images

The QED block driver already provides the functionality to not only
detect inconsistencies in images, but also fix them. However, this
functionality cannot be manually invoked with qemu-img, but the
check happens only automatically during bdrv_open()....

eba25057 05/30/2012 09:48 am Jim Meyering

block: prevent snapshot mode $TMPDIR symlink attack

In snapshot mode, bdrv_open creates an empty temporary file without
checking for mkstemp or close failure, and ignoring the possibility
of a buffer overrun given a surprisingly long $TMPDIR.
Change the get_tmp_filename function to return int (not void),...

e023b2e2 05/10/2012 11:32 am Paolo Bonzini

block: fix snapshot on QED

QED's opaque data includes a pointer back to the BlockDriverState.
This breaks when bdrv_append shuffles data between bs_new and bs_top.
To avoid this, add a "rebind" function that tells the driver about
the new relationship between the BlockDriverState and its opaque....

4513eafe 05/10/2012 11:32 am Paolo Bonzini

block: add block_job_sleep_ns

This function abstracts the pretty complex semantics of the "busy"
member of BlockJob.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

fa4478d5 05/10/2012 11:32 am Paolo Bonzini

block: wait for job callback in block_job_cancel_sync

The limitation on not having I/O after cancellation cannot really be
kept. Even streaming has a very small race window where you could
cancel a job and have it report completion. If this window is hit,...

fd7f8c65 04/27/2012 05:44 pm Stefan Hajnoczi

block: use Error mechanism instead of -errno for block_job_create()

The block job API uses -errno return values internally and we convert
these to Error in the QMP functions. This is ugly because the Error
should be created at the point where we still have all the relevant...

9e6636c7 04/27/2012 05:44 pm Stefan Hajnoczi

block: use Error mechanism instead of -errno for block_job_set_speed()

There are at least two different errors that can occur in
block_job_set_speed(): the job might not support setting speeds or the
value might be invalid.

Use the Error mechanism to report the error where it occurs....

882ec7ce 04/27/2012 05:44 pm Stefan Hajnoczi

block: change block-job-set-speed argument from 'value' to 'speed'

Signed-off-by: Stefan Hajnoczi <>
Acked-by: Kevin Wolf <>
Signed-off-by: Luiz Capitulino <>

c83c66c3 04/27/2012 05:44 pm Stefan Hajnoczi

block: add 'speed' optional parameter to block-stream

Allow streaming operations to be started with an initial speed limit.
This eliminates the window of time between starting streaming and
issuing block-job-set-speed. Users should use the new optional 'speed'...

6744cbab 04/20/2012 04:57 pm Kevin Wolf

qcow2: Version 3 images

This adds the basic infrastructure to qcow2 to handle version 3 images.
It includes code to create v3 images, allow header updates for v3 images
and checks feature bits.

It still misses support for zero clusters, so this is not a fully...

3e914655 04/05/2012 03:54 pm Paolo Bonzini

block: fix streaming/closing race

Streaming can issue I/O while qcow2_close is running. This causes the
L2 caches to become very confused or, alternatively, could cause a
segfault when the streaming coroutine is reentered after closing its
block device. The fix is to cancel streaming jobs when closing their...

dc534f8f 04/05/2012 03:54 pm Paolo Bonzini

block: document job API

I am not sure that these are really proper GtkDoc, but they follow
the existing documentation in block_int.h.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

85e8dab1 04/05/2012 03:54 pm Paolo Bonzini

aio: move BlockDriverAIOCB to qemu-aio.h

And remove several block_int.h inclusions that should not be there.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

8802d1fd 02/29/2012 04:48 pm Jeff Cody

qapi: Introduce blockdev-group-snapshot-sync command

This is a QAPI/QMP only command to take a snapshot of a group of
devices. This is similar to the blockdev-snapshot-sync command, except
blockdev-group-snapshot-sync accepts a list devices, filenames, and...

56116a14 02/29/2012 01:48 pm Paolo Bonzini

block: remove unused fields in BlockDriverState

sync_aiocb is unused since commit ce1a14d (Dynamically allocate AIO
Completion Blocks., 2006-08-07).

private is unused since commit 56a1493 (drive cleanup fixes., 2009-09-25).

Signed-off-by: Paolo Bonzini <>...

b6a127a1 02/29/2012 01:48 pm Paolo Bonzini

block: drop aio_multiwrite in BlockDriver

These were never used.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

f36f3949 02/22/2012 09:23 pm Luiz Capitulino

block: bdrv_eject(): Make eject_flag a real bool

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>
Acked-by: Kevin Wolf <>

f08f2dda 02/09/2012 05:17 pm Stefan Hajnoczi

block: add .bdrv_co_write_zeroes() interface

The ability to zero regions of an image file is a useful primitive for
higher-level features such as image streaming or zero write detection.

Image formats may support an optimized metadata representation instead...

c8c3080f 01/26/2012 03:49 pm Marcelo Tosatti

block: add support for partial streaming

Add support for streaming data from an intermediate section of the
image chain (see patch and documentation for details).

Signed-off-by: Marcelo Tosatti <>
Signed-off-by: Stefan Hajnoczi <>...

470c0504 01/26/2012 12:45 pm Stefan Hajnoczi

block: make copy-on-read a per-request flag

Previously copy-on-read could only be enabled for all requests to a
block device. This means requests coming from the guest as well as
QEMU's internal requests would perform copy-on-read when enabled.

For image streaming we want to support finer-grained behavior than just...

eeec61f2 01/26/2012 12:45 pm Stefan Hajnoczi

block: add BlockJob interface for long-running operations

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

4f1043b4 01/26/2012 12:45 pm Stefan Hajnoczi

block: add image streaming block job

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

dbffbdcf 12/05/2011 03:51 pm Stefan Hajnoczi

block: add request tracking

The block layer does not know about pending requests. This information
is necessary for copy-on-read since overlapping requests must be
serialized to prevent races that corrupt the image.

The BlockDriverState gets a new tracked_request list field which...

53fec9d3 12/05/2011 03:51 pm Stefan Hajnoczi

block: add interface to toggle copy-on-read

The bdrv_enable_copy_on_read()/bdrv_disable_copy_on_read() functions can
be used to programmatically enable or disable copy-on-read for a block
device. Later patches add the actual copy-on-read logic.

Signed-off-by: Stefan Hajnoczi <>...

6aebab14 12/05/2011 03:51 pm Stefan Hajnoczi

block: drop .bdrv_is_allocated() interface

Now that all block drivers have been converted to
.bdrv_co_is_allocated() we can drop .bdrv_is_allocated().

Note that the public bdrv_is_allocated() interface is still available
but is in fact a synchronous wrapper around .bdrv_co_is_allocated()....

376ae3f1 12/05/2011 03:51 pm Stefan Hajnoczi

block: add .bdrv_co_is_allocated()

This patch adds the .bdrv_co_is_allocated() interface which is identical
to .bdrv_is_allocated() but runs in coroutine context. Running in
coroutine context implies that other coroutines might be performing I/O
at the same time. Therefore it must be safe to run while the following...

0563e191 12/05/2011 03:51 pm Zhi Yong Wu

block: add the blockio limits command line support

Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

98f90dba 12/05/2011 03:51 pm Zhi Yong Wu

block: add I/O throttling algorithm

Signed-off-by: Zhi Yong Wu <>
Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

0f15423c 11/21/2011 10:58 pm Anthony Liguori

block: allow migration to work with image files (v3)

Image files have two types of data: immutable data that describes things like
image size, backing files, etc. and mutable data that includes offset and
reference count tables.

Today, image formats aggressively cache mutable data to improve performance. In...

c68b89ac 11/11/2011 03:02 pm Kevin Wolf

block: Rename bdrv_co_flush to bdrv_co_flush_to_disk

There are two different types of flush that you can do: Flushing one level up
to the OS (i.e. writing data to the host page cache) or flushing it all the way
down to the disk. The existing functions flush to the disk, reflect this in the...

eb489bb1 11/11/2011 03:02 pm Kevin Wolf

block: Introduce bdrv_co_flush_to_os

qcow2 has a writeback metadata cache, so flushing a qcow2 image actually
consists of writing back that cache to the protocol and only then flushes the
protocol in order to get everything stable on disk.

This introduces a separate bdrv_co_flush_to_os to reflect the split....

d6bf279e 10/27/2011 04:48 pm Luiz Capitulino

block: iostatus: Drop BDRV_IOS_INVAL

A future commit will convert bdrv_info() to the QAPI and it won't
provide IOS_INVAL.

Luckily all we have to do is to add a new 'iostatus_enabled'
member to BlockDriverState and use it instead.

Signed-off-by: Luiz Capitulino <>

b2023818 10/27/2011 04:48 pm Luiz Capitulino

qapi: Convert query-block

Signed-off-by: Anthony Liguori <>
Signed-off-by: Luiz Capitulino <>

8b94ff85 10/21/2011 06:34 pm Paolo Bonzini

block: change flush to co_flush

Since coroutine operation is now mandatory, convert all bdrv_flush
implementations to coroutines. For qcow2, this means taking the lock.
Other implementations are simpler and just forward bdrv_flush to the
underlying protocol, so they can avoid the lock....

6db39ae2 10/21/2011 06:34 pm Paolo Bonzini

block: change discard to co_discard

Since coroutine operation is now mandatory, convert both bdrv_discard
implementations to coroutines. For qcow2, this means taking the lock
around the operation. raw-posix remains synchronous.

The bdrv_discard callback is then unused and can be eliminated....

07f07615 10/21/2011 06:34 pm Paolo Bonzini

block: unify flush implementations

Add coroutine support for flush and apply the same emulation that
we already do for read/write. bdrv_aio_flush is simplified to always
go through a coroutine.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

4265d620 10/21/2011 06:34 pm Paolo Bonzini

block: add bdrv_co_discard and bdrv_aio_discard support

This similarly adds support for coroutine and asynchronous discard.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

28a7282a 10/11/2011 10:41 am Luiz Capitulino

block: Keep track of devices' I/O status

This commit adds support to the BlockDriverState type to keep track
of devices' I/O status.

There are three possible status: BDRV_IOS_OK (no error), BDRV_IOS_ENOSPC
(no space error) and BDRV_IOS_FAILED (any other error). The distinction...

9e6a4c91 09/12/2011 04:17 pm Markus Armbruster

block: Drop BlockDriverState member removable

It's a confused mess (see previous commit). No users remain.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

d1a0739d 09/12/2011 04:17 pm Markus Armbruster

block: Move BlockConf & friends from block_int.h to block.h

It's convenience stuff for block device models, so block.h isn't the
ideal home either, but better than block_int.h.

Permits moving some #include "block_int.h" from device model .h into
.c.

Signed-off-by: Markus Armbruster <>...

22cf56c4 09/12/2011 04:17 pm Markus Armbruster

block: Drop tray status tracking, no longer used

Commit 4be9762a is now completely redone.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

f107639a 09/12/2011 04:17 pm Markus Armbruster

block: Drop medium lock tracking, ask device models instead

Requires new BlockDevOps member is_medium_locked(). Implement for IDE
and SCSI CD-ROMs.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

025e849a 09/12/2011 04:17 pm Markus Armbruster

block: Rename bdrv_set_locked() to bdrv_lock_medium()

While there, make the locked parameter bool.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

ba5b7ad4 09/06/2011 12:24 pm Markus Armbruster

block: Declare qemu_blockalign() in block.h, not block_int.h

Device models should be able to use it without an unclean include of
block_int.h.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

8e49ca46 09/06/2011 12:24 pm Markus Armbruster

block: Leave tracking media change to device models

hw/fdc.c is the only one that cares.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

fa879d62 09/06/2011 12:23 pm Markus Armbruster

block: Attach non-qdev devices as well

For now, this just protects against programming errors like having the
same drive back multiple non-qdev devices, or untimely bdrv_delete().
Later commits will add other interesting uses.

While there, rename BlockDriverState member peer to dev, bdrv_attach()...

0e49de52 09/06/2011 12:23 pm Markus Armbruster

block: Generalize change_cb() to BlockDevOps

So we can more easily add device model callbacks.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

145feb17 09/06/2011 12:23 pm Markus Armbruster

block: Split change_cb() into change_media_cb(), resize_cb()

Multiplexing callbacks complicates matters needlessly.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

c488c7f6 08/26/2011 07:18 pm Christoph Hellwig

block: latency accounting

Account the total latency for read/write/flush requests. This allows
management tools to average it based on a snapshot of the nr ops
counters and allow checking for SLAs or provide statistics.

Signed-off-by: Christoph Hellwig <>...

a597e79c 08/25/2011 07:18 pm Christoph Hellwig

block: explicit I/O accounting

Decouple the I/O accounting from bdrv_aio_readv/writev/flush and
make the hardware models call directly into the accounting helpers.

This means:
- we do not count internal requests from image formats in addition
to guest originating I/O...

e8045d67 08/23/2011 06:41 pm Christoph Hellwig

block: include flush requests in info blockstats

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

da1fa91d 08/02/2011 04:53 pm Kevin Wolf

block: Add bdrv_co_readv/writev

Add new block driver callbacks bdrv_co_readv/writev, which work on a
QEMUIOVector like bdrv_aio_*, but don't need a callback. The function may only
be called inside a coroutine, so a block driver implementing this interface can...

7bf37fed 08/01/2011 01:10 pm Markus Armbruster

block: Make BlockDriver method bdrv_set_locked() return void

The only caller is bdrv_set_locked(), and it ignores the value.

Callees always return 0, except for FreeBSD's cdrom_set_locked(),
which returns -ENOTSUP when the device is in a terminally wedged...

822e1cd1 08/01/2011 01:10 pm Markus Armbruster

block: Make BlockDriver method bdrv_eject() return void

Callees always return 0, except for FreeBSD's cdrom_eject(), which
returns -ENOTSUP when the device is in a terminally wedged state.

The only caller is bdrv_eject(), and it maps -ENOTSUP to 0 since...

4a1d5e1f 07/19/2011 04:39 pm Fam Zheng

block: add bdrv_get_allocated_file_size() operation

qemu-img.c wants to count allocated file size of image. Previously it
counts a single bs->file by 'stat' or Window API. As VMDK introduces
multiple file support, the operation becomes format specific with...

f66fd6c3 07/19/2011 04:39 pm Fam Zheng

VMDK: create different subformats

Add create option 'format', with enums:
monolithicSparse
monolithicFlat
twoGbMaxExtentSparse
twoGbMaxExtentFlat
Each creates a subformat image file. The default is monolithicSparse.

Signed-off-by: Fam Zheng <>...

39aa9a12 06/15/2011 03:36 pm Devin Nakamura

Replaced tabs with spaces in block.h and block_int.h

Signed-off-by: Devin Nakamura <>
Signed-off-by: Kevin Wolf <>

8d278467 05/19/2011 11:26 am Markus Armbruster

block: Remove type hint, it's guest matter, doesn't belong here

No users of bdrv_get_type_hint() left. bdrv_set_type_hint() can make
the media removable by side effect. Make that explicit.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

db593f25 02/07/2011 01:51 pm Marcelo Tosatti

Add flag to indicate external users to block device

Certain operations such as drive_del or resize cannot be performed
while external users (eg. block migration) reference the block device.

Add a flag to indicate that.

Signed-off-by: Marcelo Tosatti <>...

db97ee6a 01/31/2011 11:03 am Christoph Hellwig

block: tell drivers about an image resize

Extend the change_cb callback with a reason argument, and use it
to tell drivers about size changes.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

75411d23 12/17/2010 05:11 pm Stefan Hajnoczi

qed: Add QEMU Enhanced Disk image format

This patch introduces the qed on-disk layout and implements image
creation. Later patches add read/write and other functionality.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

bb8bf76f 12/17/2010 05:11 pm Christoph Hellwig

block: add discard support

Add a new bdrv_discard method to free blocks in a mapping image, and a new
drive property to set the granularity for these discard. If no discard
granularity support is set discard support is disabled.

Signed-off-by: Christoph Hellwig <>...

eec77d9e 12/14/2010 04:44 pm Jes Sorensen

qemu-img: Deprecate obsolete -6 and -e options

If -6 or -e is specified, an error message is printed and we exit. It
does not print help() to avoid the error message getting lost in the
noise.

Signed-off-by: Jes Sorensen <>
Signed-off-by: Kevin Wolf <>

1ca4d09a 12/11/2010 11:32 pm Gleb Natapov

Add bootindex parameter to net/block/fd device

If bootindex is specified on command line a string that describes device
in firmware readable way is added into sorted list. Later this list will
be passed into firmware to control boot order.

Signed-off-by: Gleb Natapov <>...

205ef796 11/04/2010 01:52 pm Kevin Wolf

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 <>
Reviewed-by: Stefan Hajnoczi <>

51ef6727 10/22/2010 03:49 pm edison

Copy snapshots out of QCOW2 disk

In order to backup snapshots, created from QCOW2 iamge, we want to copy snapshots out of QCOW2 disk to a seperate storage.
The following patch adds a new option in "qemu-img": qemu-img convert -f qcow2 -O qcow2 -s snapshot_name src_img bck_img....

8b33d9ee 09/09/2010 01:09 am Anthony Liguori

Revert "Make default invocation of block drivers safer (v3)"

This reverts commit 79368c81bf8cf93864d7afc88b81b05d8f0a2c90.

Conflicts:

block.c

I haven't been able to come up with a solution yet for the corruption caused by
unaligned requests from the IDE disk so revert until a solution can be written....

336c1c12 08/03/2010 04:57 pm Kevin Wolf

block: Fix bdrv_has_zero_init

Assuming that any image on a block device is not properly zero-initialized is
actually wrong: Only raw images have this problem. Any other image format
shouldn't care about it, they initialize everything properly themselves....

4be9762a 08/03/2010 04:57 pm Markus Armbruster

block: Change bdrv_eject() not to drop the image

bdrv_eject() gets called when a device model opens or closes the tray.

If the block driver implements method bdrv_eject(), that method gets
called. Drivers host_cdrom implements it, and it opens and closes the...

55459498 07/26/2010 02:39 pm Christoph Hellwig

block: default to 0 minimal / optiomal I/O size

Currently we set them to 512 bytes unless manually specified. Unforuntaly
some brain-dead partitioning tools create unaligned partitions if they
get low enough optiomal I/O size values, so don't report any at all...

79368c81 07/15/2010 04:17 pm Anthony Liguori

Make default invocation of block drivers safer (v3)

CVE-2008-2004 described a vulnerability in QEMU whereas a malicious user could
trick the block probing code into accessing arbitrary files in a guest. To
mitigate this, we added an explicit format parameter to -drive which disabling...

9ac228e0 07/06/2010 06:05 pm Kevin Wolf

qcow2/vdi: Change check to distinguish error cases

This distinguishes between harmless leaks and real corruption. Hopefully users
better understand what qemu-img check wants to tell them.

Signed-off-by: Kevin Wolf <>

f8b6cc00 07/02/2010 02:18 pm Markus Armbruster

qdev: Decouple qdev_prop_drive from DriveInfo

Make the property point to BlockDriverState, cutting out the DriveInfo
middleman. This prepares the ground for block devices that don't have
a DriveInfo.

Currently all user-defined ones have a DriveInfo, because the only way...

18846dee 07/02/2010 02:18 pm Markus Armbruster

block: Catch attempt to attach multiple devices to a blockdev

For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo
happily creates two SCSI disks connected to the same block device.
It's all downhill from there.

Device usb-storage deliberately attaches twice to the same blockdev,...

1e297c32 06/22/2010 03:38 pm Christoph Hellwig

block: fix physical_block_size calculation

Both SCSI and virtio expect the physical block size relative to the
logical block size. So get the factor first before calculating the
log2.

Reported-by: Mike Cao <>
Signed-off-by: Christoph Hellwig <>...

abd7f68d 06/15/2010 10:41 am Markus Armbruster

block: Move error actions from DriveInfo to BlockDriverState

That's where they belong semantically (block device host part), even
though the actions are actually executed by guest device code.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

294cc35f 05/03/2010 11:07 am Kevin Wolf

block: Add wr_highest_sector blockstat

This adds the wr_highest_sector blockstat which implements what is generally
known as the high watermark. It is the highest offset of a sector written to
the respective BlockDriverState since it has been opened.

The query-blockstat QMP command is extended to add this value to the result,...

66f82cee 05/03/2010 11:07 am Kevin Wolf

block: Open the underlying image file in generic code

Format drivers shouldn't need to bother with things like file names, but rather
just get an open BlockDriverState for the underlying protocol. This patch
introduces this behaviour for bdrv_open implementation. For protocols which...

b66460e4 04/23/2010 05:21 pm Stefan Hajnoczi

block: Do not export bdrv_first

The bdrv_first linked list of BlockDriverStates is currently extern so
that block migration can iterate the list. However, since there is
already a bdrv_iterate() function there is no need to expose bdrv_first.

Signed-off-by: Stefan Hajnoczi <>...

1b7bdbc1 04/23/2010 05:21 pm Stefan Hajnoczi

block: Convert bdrv_first to QTAILQ

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

8a22f02a 04/23/2010 05:21 pm Stefan Hajnoczi

block: Convert first_drv to QLIST

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

8b9b0cc2 04/23/2010 05:08 pm Kevin Wolf

blkdebug: Add events and rules

Block drivers can trigger a blkdebug event whenever they reach a place where it
could be useful to inject an error for testing/debugging purposes.

Rules are read from a blkdebug config file and describe which action is taken...

8cfacf07 03/17/2010 05:42 pm Christoph Hellwig

block: add logical_block_size property

Add a logical block size attribute as various guest side tools only
increase the filesystem sector size based on it, not the advisory
physical block size.

For scsi we already have support for a different logical block size...

4dca4b63 02/19/2010 11:32 pm Naphtali Sprei

block: more read-only changes, related to backing files

Open backing file read-only where possible
Upgrade backing file to read-write during commit, back to read-only after commit
If upgrade fail, back to read-only. If also fail, "disconnect" the drive....

428c149b 02/11/2010 12:53 am Christoph Hellwig

block: add topology qdev properties

Add three new qdev properties to export block topology information to
the guest. This is needed to get optimal I/O alignment for RAID arrays
or SSDs.

The options are:

- physical_block_size to specify the physical block size of the device,...
aaa0eb75 02/10/2010 12:56 am Liran Schour

Count dirty blocks and expose an API to get dirty count

This will manage dirty counter for each device and will allow to get the
dirty counter from above.

Signed-off-by: Liran Schour <>
Signed-off-by: Anthony Liguori <>

756e6736 01/14/2010 01:14 am Kevin Wolf

block: Add bdrv_change_backing_file

Introduce the functions needed to change the backing file of an image. The
function is implemented for qcow2.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

12c09b8c 12/03/2009 07:45 pm Kevin Wolf

qemu-img: There is more than one host device driver

I haven't heard yet of anyone using qemu-img to copy an image to a real floppy,
but it's a valid use case.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>