Statistics
| Branch: | Revision:

root / block.h @ 4f690853

History | View | Annotate | Download (8.5 kB)

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

221f715d 03/28/2009 07:28 pm aliguori

new scsi-generic abstraction, use SG_IO (Christoph Hellwig)

Okay, I started looking into how to handle scsi-generic I/O in the
new world order.

I think the best is to use the SG_IO ioctl instead of the read/write
interface as that allows us to support scsi passthrough on disk/cdrom...

7d780669 03/12/2009 09:57 pm aliguori

Add specialized block driver scsi generic API (Avi Kivity)

When a scsi device is backed by a scsi generic device instead of an
ordinary host block device, the block API is abused in a couple of annoying
ways:

- nb_sectors is negative, and specifies a byte count instead of a sector count...
b7ea8c26 03/11/2009 10:05 pm aliguori

Revert r6405

This series is broken by design as it requires expensive IO operations at
open time causing very long delays when starting a virtual machine for the
first time.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6815 c046a42c-6fe2-441c-8c8c-71466251a162

70240ca6 03/11/2009 10:05 pm aliguori

Revert r6407

This series is broken by design as it requires expensive IO operations at
open time causing very long delays when starting a virtual machine for the
first time.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6813 c046a42c-6fe2-441c-8c8c-71466251a162

376253ec 03/06/2009 01:01 am aliguori

monitor: Rework API (Jan Kiszka)

Refactor the monitor API and prepare it for decoupled terminals:
term_print functions are renamed to monitor_* and all monitor services
gain a new parameter (mon) that will once refer to the monitor instance
the output is supposed to appear on. However, the argument remains...

c0f4ce77 03/06/2009 01:01 am aliguori

monitor: Rework early disk password inquiry (Jan Kiszka)

Reading the passwords for encrypted hard disks during early startup is
broken (I guess for quiet a while now):
- No monitor terminal is ready for input at this point
- Forcing all mux'ed terminals into monitor mode can confuse other...

045df330 03/06/2009 01:00 am aliguori

block: Introduce bdrv_get_encrypted_filename (Jan Kiszka)

Introduce bdrv_get_encrypted_filename service to allow more informative
password prompting.

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

51de9760 03/06/2009 01:00 am aliguori

block: Improve bdrv_iterate (Jan Kiszka)

Make bdrv_iterate more useful by passing the BlockDriverState to the
iterator instead of the device name.

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

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6703 c046a42c-6fe2-441c-8c8c-71466251a162

1987530f 01/22/2009 08:57 pm aliguori

qcow2 format: keep 'num_free_bytes', and show it upon 'info blockstats' (Uri Lublin)

'num_free_bytes' is the number of non-allocated bytes below highest-allocation.
It's useful, together with the highest-allocation, to figure out how
fragmented the image is, and how likely it will run out-of-space soon....

c4218205 01/22/2009 08:57 pm aliguori

block-qcow2: export highest_allocated through BlockDriverInfo and get_info() (Uri Lublin)

Signed-off-by: Uri Lublin <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6405 c046a42c-6fe2-441c-8c8c-71466251a162

3b69e4b9 01/22/2009 06:59 pm aliguori

Vectored block device API (Avi Kivity)

Most devices that are capable of DMA are also capable of scatter-gather.
With the memory mapping API, this means that the device code needs to be
able to access discontiguous host memory regions.

For block devices, this translates to vectored I/O. This patch implements...

4dc822d7 12/04/2008 11:39 pm aliguori

Use writeback caching by default with qcow2

qcow2 writes a cluster reference count on every cluster update. This causes
performance to crater when using anything but cache=writeback. This is most
noticeable when using savevm. Right now, qcow2 isn't a reliable format...

f3d54fc4 11/25/2008 11:50 pm aliguori

Abstract out geometry detection code from IDE for reuse

Virtio will want to use the geometry detection code. It doesn't belong
in ide.c anyway.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5797 c046a42c-6fe2-441c-8c8c-71466251a162

4fc9af53 11/08/2008 06:27 pm aliguori

Use an option rom instead of boot sector for -kernel

Generate an option rom instead of using a hijacked boot sector for kernel
booting. This just requires adding a small option ROM header and a few more
instructions to the boot sector to take over the int19 vector and run our...

9f7965c7 10/14/2008 05:42 pm aliguori

Expand cache= option and use write-through caching by default

This patch changes the cache= option to accept none, writeback, or writethough
to control the host page cache behavior. By default, writethrough caching is
now used which internally is implemented by using O_DSYNC to open the disk...

c6ca28d6 10/06/2008 04:55 pm aliguori

Add bdrv_flush_all()

This patch adds a bdrv_flush_all() function. It's necessary to ensure that all
IO operations have been flushed to disk before completely a live migration.

N.B. we don't actually use this now. We really should flush the block drivers...

a76bab49 09/22/2008 10:17 pm aliguori

Refactor AIO to allow multiple AIO implementations

This patch refactors the AIO layer to allow multiple AIO implementations. It's
only possible because of the recent signalfd() patch.

Right now, the AIO infrastructure is pretty specific to the block raw backend....

03ff3ca3 09/15/2008 06:51 pm aliguori

Use common objects for qemu-img and qemu-nbd

Right now, we sprinkle #if defined(QEMU_IMG) && defined(QEMU_NBD) all over the
code. It's ugly and causes us to have to build multiple object files for
linking against qemu and the tools.

This patch introduces a new file, qemu-tool.c which contains enough for...

baf35cb9 09/10/2008 06:45 pm aliguori

Use signalfd() to work around signal/select race

This patch introduces signalfd() to work around the signal/select race in
checking for AIO completions. For platforms that don't support signalfd(), we
emulate it with threads.

There was a long discussion about this approach. I don't believe there are any...

75818250 07/03/2008 04:41 pm ths

Allow QEMU to connect directly to an NBD server, by Laurent Vivier.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4838 c046a42c-6fe2-441c-8c8c-71466251a162

f58c7b35 06/06/2008 12:53 am ths

New qemu-img convert -B option, by Marc Bevand.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4672 c046a42c-6fe2-441c-8c8c-71466251a162

b5eff355 03/12/2008 01:30 am aurel32

Revert fix for CVE-2008-0928. Will be fixed in a different way later.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4041 c046a42c-6fe2-441c-8c8c-71466251a162

902b27d0 03/11/2008 07:17 pm aurel32

Fix CVE-2008-0928 - insufficient block device address range checking

Qemu 0.9.1 and earlier does not perform range checks for block device
read or write requests, which allows guest host users with root
privileges to access arbitrary memory and escape the virtual machine....

985a03b0 12/24/2007 06:10 pm ths

Real SCSI device passthrough (v4), by Laurent Vivier.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3851 c046a42c-6fe2-441c-8c8c-71466251a162

33f00271 12/24/2007 04:33 pm balrog

Add "cache" parameter to "-drive" (Laurent Vivier).

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3848 c046a42c-6fe2-441c-8c8c-71466251a162

96b8f136 12/17/2007 03:35 am ths

Fix bdrv_get_geometry to return uint64_t, by Andre Przywara.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3825 c046a42c-6fe2-441c-8c8c-71466251a162

a36e69dd 12/02/2007 07:18 am ths

Collecting block device statistics, by Richard W.M. Jones.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3760 c046a42c-6fe2-441c-8c8c-71466251a162

87ecb68b 11/17/2007 07:14 pm pbrook

Break up vl.h.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162

faf07963 11/11/2007 04:51 am pbrook

Split block API from vl.h.
Remove QEMU_TOOL. Replace with QEMU_IMG and NEED_CPU_H.
Avoid linking qemu-img against whole system emulatior.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3578 c046a42c-6fe2-441c-8c8c-71466251a162