Statistics
| Branch: | Revision:

root / block.h @ 2a2af967

History | View | Annotate | Download (17 kB)

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

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

block: add bdrv_find_backing_image

Add bdrv_find_backing_image: given a BlockDriverState pointer, and an id,
traverse the backing image chain to locate the id.

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

c2c9a466 12/15/2011 01:40 pm Kevin Wolf

qcow2: Allow >4 GB VM state

This is a compatible extension to the snapshot header format that allows
saving a 64 bit VM state size.

Signed-off-by: Kevin Wolf <>

e7d81004 12/14/2011 01:09 pm Stefan Weil

Fix spelling in comments, documentation and messages

accidently->accidentally
annother->another
choosen->chosen
consideres->considers
decriptor->descriptor
developement->development
paramter->parameter
preceed->precede
preceeding->preceding
priviledge->privilege...

922453bc 12/05/2011 03:56 pm Stefan Hajnoczi

block: convert qemu_aio_flush() calls to bdrv_drain_all()

Many places in QEMU call qemu_aio_flush() to complete all pending
asynchronous I/O. Most of these places actually want to drain all block
requests but there is no block layer API to do so.

This patch introduces the bdrv_drain_all() API to wait for requests...

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

060f51c9 12/05/2011 03:51 pm Stefan Hajnoczi

block: add bdrv_co_is_allocated() interface

This patch introduces the public bdrv_co_is_allocated() interface which
can be used to query image allocation status while the VM is running.

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

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

025ccaa7 11/11/2011 03:02 pm Paolo Bonzini

block: add eject request callback

Recent versions of udev always keep the tray locked so that the kernel
can observe "eject request" events (aka tray button presses) even on
discs that aren't mounted. Add support for these events in the ATAPI
and SCSI cd drive device models....

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

58e21ef5 10/27/2011 04:48 pm Luiz Capitulino

block: Rename the BlockIOStatus enum values

The biggest change is to rename its prefix from BDRV_IOS to
BLOCK_DEVICE_IO_STATUS.

Next commit will convert the query-block command to the QAPI
and that's how the enumeration is going to be generated.

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

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

7b6f9300 09/12/2011 04:17 pm Markus Armbruster

block: New bdrv_set_buffer_alignment()

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

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

7d4b4ba5 09/12/2011 04:17 pm Markus Armbruster

block: New change_media_cb() parameter load

To let device models distinguish between eject and load.

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

2c6942fa 09/12/2011 04:17 pm Markus Armbruster

block: Clean up remaining users of "removable"

BlockDriverState member removable is a confused mess. It is true when
an ide-cd, scsi-cd or floppy qdev is attached, or when the
BlockDriverState was created with -drive if={floppy,sd} or -drive
if={ide,scsi,xen,none},media=cdrom ("created removable"), except when...

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

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

block: Show whether the virtual tray is open in info block

Need to ask the device, so this requires new BlockDevOps member
is_tray_open().

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

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

block: Leave enforcing tray lock to device models

The device model knows best when to accept the guest's eject command.
No need to detour through the block layer.

bdrv_eject() can't fail anymore. Make it void.

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

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

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

c3993cdc 08/23/2011 03:15 pm Stefan Hajnoczi

block: parse cache mode flags in a single place

This patch introduces bdrv_parse_cache_flags() which sets open flags
given a cache mode. Previously this was duplicated in blockdev.c and
qemu-img.c.

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

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

5bf3f8e4 08/01/2011 01:10 pm Frediano Ziglio

block: Removed unused function bdrv_write_sync

Signed-off-by: Frediano Ziglio <>
Signed-off-by: Kevin Wolf <>

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

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

d22b2f41 04/07/2011 02:51 pm Ryan Harper

Do not delete BlockDriverState when deleting the drive

When removing a drive from the host-side via drive_del we currently have
the following path:

drive_del
qemu_aio_flush()
bdrv_close() // zaps bs->drv, which makes any subsequent I/O get
// dropped. Works as designed...

5bbdbb46 02/20/2011 11:33 am Blue Swirl

fdc: move floppy geometry guessing to block.c

Other geometry guessing functions already reside in block.c.

Remove some unused or debugging only fields.

Signed-off-by: Blue Swirl <>

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

f88e1a42 12/17/2010 05:11 pm Jes Sorensen

qemu-img.c: Re-factor img_create()

This patch re-factors img_create() moving the code doing the actual
work into block.c where it can be shared with QEMU. This is needed to
be able to create images from QEMU to be used for live snapshots.

Signed-off-by: Jes Sorensen <>...

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

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

ceb25e5c 09/08/2010 01:39 pm Kevin Wolf

block: Fix BDRV_O_CACHE_MASK

BDRV_O_CACHE_MASK should have been extended when cache=unsafe introduced a new
flag BDRV_O_NO_FLUSH. There are currently no users that would change their
behaviour because of this, but let's clean it up before things break.

Signed-off-by: Kevin Wolf <>

199630b6 07/26/2010 02:39 pm Blue Swirl

Fix -snapshot deleting images on disk change

Block device change command did not copy BDRV_O_SNAPSHOT flag. Thus
the new image did not have this flag and the file got deleted during
opening.

Fix by copying BDRV_O_SNAPSHOT flag.

Signed-off-by: Blue Swirl <>...

e076f338 07/06/2010 06:05 pm Kevin Wolf

qemu-img check: Distinguish different kinds of errors

People think that their images are corrupted when in fact there are just some
leaked clusters. Differentiating several error cases should make the messages
more comprehensible.

Signed-off-by: Kevin Wolf <>

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

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

savevm: Survive hot-unplug of snapshot device

savevm.c keeps a pointer to the snapshot block device. If you manage
to get that device deleted, the pointer dangles, and the next snapshot
operation will crash & burn. Unplugging a guest device that uses it...

7d0d6950 07/02/2010 02:18 pm Markus Armbruster

block: Fix virtual media change for if=none

BlockDriverState member removable controls whether virtual media
change (monitor commands change, eject) is allowed. It is set when
the "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.

The type hint is only set by drive_init(). It sets BDRV_TYPE_FLOPPY...

f08145fe 06/22/2010 03:38 pm Kevin Wolf

block: Add bdrv_(p)write_sync

Add new functions that write and flush the written data to disk immediately.
This is what needs to be used for image format metadata to maintain integrity
for cache=... modes that don't use O_DSYNC. (Actually, we only need barriers,...

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

6ab4b5ab 06/15/2010 10:41 am Markus Armbruster

block: Decouple block device "commit all" from DriveInfo

do_commit() and mux_proc_byte() iterate over the list of drives
defined with drive_init(). This misses host block devices defined by
other means. Such means don't exist now, but will be introduced later...

2f399b0a 06/15/2010 10:41 am Markus Armbruster

block: New bdrv_next()

This is a more flexible alternative to bdrv_iterate().

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

feeee5ac 06/15/2010 10:41 am Miguel Di Ciurcio Filho

savevm: Really verify if a drive supports snapshots

Both bdrv_can_snapshot() and bdrv_has_snapshot() does not work as advertized.

First issue: Their names implies different porpouses, but they do the same thing
and have exactly the same code. Maybe copied and pasted and forgotten?...

2bc93fed 06/04/2010 12:43 pm MORITA Kazutaka

close all the block drivers before the qemu process exits

This patch calls the close handler of the block driver before the qemu
process exits.

This is necessary because the sheepdog block driver releases the lock
of VM images in the close handler.

Signed-off-by: MORITA Kazutaka <>...

c63782cb 05/28/2010 02:14 pm Jes Sorensen

block.h: Make BDRV_SECTOR_SIZE 64 bit safe

C defaults to int, so make definition of BDRV_SECTOR_SIZE 64 bit
safe as it and BDRV_SECTOR_MASK may be used against 64 bit addresses.

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

b50cbabc 05/28/2010 02:14 pm MORITA Kazutaka

add support for protocol driver create_options

This patch enables protocol drivers to use their create options which
are not supported by the format. For example, protcol drivers can use
a backing_file option with raw format.

Signed-off-by: MORITA Kazutaka <>...

016f5cf6 05/26/2010 09:05 pm Alexander Graf

Add cache=unsafe parameter to -drive

Usually the guest can tell the host to flush data to disk. In some cases we
don't want to flush though, but try to keep everything in cache.

So let's add a new cache value to -drive that allows us to set the cache
policy to most aggressive, disabling flushes. We call this mode "unsafe",...

3abbc4d9 05/17/2010 11:20 am Stefan Hajnoczi

block: Remove semicolon in BDRV_SECTOR_MASK macro

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

84a12e66 05/03/2010 11:07 am Christoph Hellwig

block: separate raw images from the file protocol

We're running into various problems because the "raw" file access, which
is used internally by the various image formats is entangled with the
"raw" image format, which maps the VM view 1:1 to a file system....

f2feebbd 05/03/2010 11:07 am Kevin Wolf

block: bdrv_has_zero_init

This fixes the problem that qemu-img's use of no_zero_init only considered the
no_zero_init flag of the format driver, but not of the underlying protocols.

Between the raw/file split and this fix, converting to host devices is broken....

85de0ba5 04/23/2010 05:21 pm Kevin Wolf

block.h: bdrv_create2 doesn't exist any more

The bdrv_create2 implementation has disappeared long ago. Remove its
prototype from the header file, too.

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

8252278a 04/23/2010 05:08 pm Kevin Wolf

qcow2: Trigger blkdebug events

This adds blkdebug events to qcow2 to allow injecting I/O errors in specific
places.

Signed-off-by: Kevin Wolf <>

d6e9098e 04/23/2010 05:08 pm Kevin Wolf

Replace calls of old bdrv_open

What is known today as bdrv_open2 becomes the new bdrv_open. All remaining
callers of the old function are converted to the new one. In some places they
even know the right format, so they should have used bdrv_open2 from the...

6db95603 04/23/2010 05:08 pm Christoph Hellwig

block: get rid of the BDRV_O_FILE flag

BDRV_O_FILE is only used to communicate between bdrv_file_open and bdrv_open.
It affects two things: first bdrv_open only searches for protocols using
find_protocol instead of all image formats and host drivers. We can easily...

2582bfed 02/10/2010 07:57 pm Luiz Capitulino

block: BLOCK_IO_ERROR QMP event

This commit introduces the bdrv_mon_event() function, which
should be called by block subsystems (eg. IDE) when a I/O
error occurs, so that an QMP event is emitted.

The following information is currently provided in the event:...

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

9a2d77ad 01/26/2010 11:42 pm Christoph Hellwig

block: kill BDRV_O_CREAT

The BDRV_O_CREAT option is unused inside qemu and partially duplicates
the bdrv_create method. Remove it, and the -C option to qemu-io which
isn't used in qemu-iotests anyway.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

37226ad9 01/26/2010 11:42 pm Naphtali Sprei

No need anymoe for bdrv_set_read_only

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

f5edb014 01/20/2010 04:25 pm Naphtali Sprei

Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.

Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...

b783e409 01/14/2010 01:14 am Kevin Wolf

block: Introduce BDRV_O_NO_BACKING

If an image references a backing file that doesn't exist, qemu-img info fails
to open this image. Exactly in this case the info would be valuable, though:
the user might want to find out which file is missing.

This patch introduces a BDRV_O_NO_BACKING flag to ignore the backing file when...

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

d15e5465 12/12/2009 03:59 pm Luiz Capitulino

block: Convert bdrv_info() to QObject

Each block device information is stored in a QDict and the
returned QObject is a QList of all devices.

This commit should not change user output.

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

218a536a 12/12/2009 03:59 pm Luiz Capitulino

block: Convert bdrv_info_stats() to QObject

Each device statistic information is stored in a QDict and
the returned QObject is a QList of all devices.

This commit should not change user output.

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

23bd90d2 12/03/2009 06:48 pm Jan Kiszka

block migration: Increase dirty chunk size to 1M

4K is too small for efficiently saving and restoring multi-GB block
devices.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

a55eb92c 12/03/2009 06:48 pm Jan Kiszka

block migration: Fix coding style and whitespaces

No functional changes.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

6ea44308 12/03/2009 06:48 pm Jan Kiszka

block migration: Rework constants API

Instead of duplicating the definition of constants or introducing
trivial retrieval functions move the SECTOR constants into the public
block API. This also obsoletes sector_per_block in BlkMigState.

Signed-off-by: Jan Kiszka <>...

7cd1e32a 11/17/2009 04:03 pm lirans@il.ibm.com

Expose a mechanism to trace block writes

To support live migration without shared storage we need to be able to trace
writes to disk while migrating. This Patch expose dirty block tracking per
device to be polled from upper layer.

Changes from v4:
- Register dirty tracking for each block device....

eb852011 11/09/2009 04:43 pm Markus Armbruster

Configurable block format whitelist

We have code for a quite a few block formats. While I trust that all
of these formats are useful at least for some people in some
circumstances, some of them are of a kind that friends don't let
friends use in production....

59f2689d 11/09/2009 04:43 pm Naphtali Sprei

Added readonly flag to -drive command

This is a slightly revised patch for adding readonly flag to the -drive command.
Even though this patch is "stand-alone", it assumes a previous related patch (in Anthony staging tree), that passes
the readonly attribute of the drive to the guest OS, applied first....

e900a7b7 09/11/2009 06:19 pm Christoph Hellwig

block: add enable_write_cache flag

Add a enable_write_cache flag in the block driver state, and use it to
decide if we claim to have a volatile write cache that needs controlled
flushing from the guest. The flag is off if cache=writethrough is
defined because O_DSYNC guarantees that every write goes to stable...

b2e12bc6 09/11/2009 06:19 pm Christoph Hellwig

block: add aio_flush operation

Instead stalling the VCPU while serving a cache flush try to do it
asynchronously. Use our good old helper thread pool to issue an
asynchronous fdatasync for raw-posix. Note that while Linux AIO
implements a fdatasync operation it is not useful for us because...

40b4f539 09/11/2009 06:18 pm Kevin Wolf

Add bdrv_aio_multiwrite

One performance problem of qcow2 during the initial image growth are
sequential writes that are not cluster aligned. In this case, when a first
requests requires to allocate a new cluster but writes only to the first
couple of sectors in that cluster, the rest of the cluster is zeroed - just...

5c6c3a6c 08/28/2009 04:30 am Christoph Hellwig

raw-posix: add Linux native AIO support

Now that do have a nicer interface to work against we can add Linux native
AIO support. It's an extremly thing layer just setting up an iocb for
the io_submit system call in the submission path, and registering an...

45566e9c 07/16/2009 04:28 pm Christoph Hellwig

replace bdrv_{get, put}_buffer with bdrv_{load, save}_vmstate

The VM state offset is a concept internal to the image format. Replace
the old bdrv_{get,put}_buffer method that require an index into the
image file that is constructed from the VM state offset and an offset...

1cec71e3 07/10/2009 12:06 am Anthony Liguori

Revert "support colon in filenames"

This reverts commit 707c0dbc97cddfe8d2441b8259c6c526d99f2dd8.

Signed-off-by: Anthony Liguori <>

0aa217e4 07/10/2009 12:06 am Kevin Wolf

qcow2: Make cache=writethrough default

The performance of qcow2 has improved meanwhile, so we don't need to
special-case it any more. Switch the default to write-through caching
like all other block drivers.

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

707c0dbc 06/29/2009 09:50 pm Ram Pai

support colon in filenames

Problem: It is impossible to feed filenames with the character colon because
qemu interprets such names as a protocol. For example filename scsi:0, is
interpreted as a protocol by name "scsi".

This patch allows user to espace colon characters. For example the above...

aea2a33c 06/16/2009 11:52 pm Mark McLoughlin

Prevent CD-ROM media eject while device is locked

Section 10.8.25 ("START/STOP UNIT Command") of SFF-8020i states that
if the device is locked we should refuse to eject if the device is
locked.

ASC_MEDIA_REMOVAL_PREVENTED is the appropriate return in this case....

0e7e1989 05/22/2009 06:50 pm Kevin Wolf

Convert all block drivers to new bdrv_create

Now we can make use of the newly introduced option structures. Instead of
having bdrv_create carry more and more parameters (which are format specific in
most cases), just pass a option structure as defined by the driver itself....

5efa9d5a 05/15/2009 12:13 am Anthony Liguori

Convert block infrastructure to use new module init functionality

Signed-off-by: Anthony Liguori <>

e97fc193 04/22/2009 02:11 am aliguori

Introduce bdrv_check (Kevin Wolf)

From: Kevin Wolf <>

Introduce a new bdrv_check function pointer for block drivers. Modify qcow2 to
return an error status in check_refcounts(), so it can implement bdrv_check.

Signed-off-by: Kevin Wolf <>...

c87c0672 04/07/2009 09:43 pm aliguori

remove bdrv_aio_read/bdrv_aio_write (Christoph Hellwig)

Always use the vectored APIs to reduce code churn once we switch the BlockDriver
API to be vectored.

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

178e08a5 04/05/2009 10:10 pm aliguori

Fix savevm after BDRV_FILE size enforcement

We now enforce that you cannot write beyond the end of a non-growable file.
qcow2 files are not growable but we rely on them being growable to do
savevm/loadvm. Temporarily allow them to be growable by introducing a new...

5eb45639 03/28/2009 07:55 pm aliguori

block: support known backing format for image create and open (Uri Lublin)

Added a backing_format field to BlockDriverState.
Added bdrv_create2 and drv->bdrv_create2 to create an image with
a known backing file format.
Upon bdrv_open2 if backing format is known use it, instead of...