Statistics
| Branch: | Revision:

root / block @ b4160af1

# Date Author Comment
55aff7f1 01/31/2014 11:05 pm Jeff Cody

block: remove QED .bdrv_make_empty implementation

The QED .bdrv_make_empty() implementation does nothing but return
-ENOTSUP, which causes problems in bdrv_commit(). Since the function
stub exists for QED, it is called, which then always returns an error....

14b4a8b9 01/31/2014 11:05 pm Jeff Cody

block: remove qcow2 .bdrv_make_empty implementation

The QCOW2 .bdrv_make_empty implementation always returns 0 for success,
but does not actually do anything.

The proper way to not support an optional driver function stub is to
just not implement it, so let's remove the stub....

f43aa8e1 01/31/2014 11:05 pm Peter Lieven

block/vmdk: add basic .bdrv_check support

this adds a basic vmdk corruption check. it should detect severe
table corruptions and file truncation.

Signed-off-by: Peter Lieven <>
Reviewed-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>

f50159fa 01/31/2014 11:05 pm Markus Armbruster

block/vhdx: Error checking fixes

Errors are inadvertently ignored in a few places. Has always been
broken. Spotted by Coverity.

Signed-off-by: Markus Armbruster <>
Reviewed-by: Jeff Cody <>
Signed-off-by: Stefan Hajnoczi <>

e9f526ab 01/25/2014 01:50 am Anthony Liguori

Merge remote-tracking branch 'bonzini/scsi-next' into staging

  • bonzini/scsi-next:
    scsi: Support TEST UNIT READY in the dummy LUN0
    block: add .bdrv_reopen_prepare() stub for iscsi
    virtio-scsi: Prevent assertion on missed events
    virtio-scsi: Cleanup of I/Os that never started...
9e1cb96d 01/24/2014 06:40 pm Kevin Wolf

qemu-iotests: Test pwritev RMW logic

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

2c9880c4 01/24/2014 06:40 pm Paolo Bonzini

iscsi: Set bs->request_alignment

The iSCSI backend already gets the block size from the READ CAPACITY
command it sends. Save it so that the generic block layer gets it
too.

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

b35ee7fb 01/24/2014 06:40 pm Kevin Wolf

blkdebug: Make required alignment configurable

The new 'align' option of blkdebug can be used in order to emulate
backends with a required 4k alignment on hosts which only really require
512 byte alignment.

Signed-off-by: Kevin Wolf <>

c25f53b0 01/24/2014 06:40 pm Paolo Bonzini

raw: Probe required direct I/O alignment

Add a bs->request_alignment field that contains the required
offset/length alignment for I/O requests and fill it in the raw block
drivers. Use ioctls if possible, else see what alignment it takes for
O_DIRECT to succeed....

793ed47a 01/24/2014 06:40 pm Kevin Wolf

block: Switch BdrvTrackedRequest to byte granularity

Signed-off-by: Kevin Wolf <>
Reviewed-by: Max Reitz <>
Reviewed-by: Benoit Canet <>

d34682cd 01/24/2014 06:40 pm Kevin Wolf

block: Move initialisation of BlockLimits to bdrv_refresh_limits()

This function separates filling the BlockLimits from bdrv_open(), which
allows it to call it from other operations which may change the limits
(e.g. modifications to the backing file chain or bdrv_reopen)...

355ef4ac 01/24/2014 06:40 pm Kevin Wolf

block: Update BlockLimits when they might have changed

When reopening with different flags, or when backing files disappear
from the chain, the limits may change. Make sure they get updated in
these cases.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Wenchao Xia <>...

4da83585 01/24/2014 05:12 pm Jeff Cody

block: resize backing image during active layer commit, if needed

If the top image to commit is the active layer, and also larger than
the base image, then an I/O error will likely be returned during
block-commit.

For instance, if we have a base image with a virtual size 10G, and a...

c13163fb 01/24/2014 05:07 pm Benoît Canet

qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes.

Signed-off-by: Benoit Canet <>
Reviewed-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

212a5a8f 01/24/2014 05:07 pm Benoît Canet

block: Create authorizations mechanism for external snapshot and resize.

Signed-off-by: Benoit Canet <>
Signed-off-by: Kevin Wolf <>

031fd1be 01/24/2014 05:07 pm Peter Maydell

block/curl: Implement the libcurl timer callback interface

libcurl versions 7.16.0 and later have a timer callback interface which
must be implemented in order for libcurl to make forward progress (it
will sometimes rely on being called back on the timeout if there are...

c8059b97 01/24/2014 03:33 pm Fam Zheng

qapi: Add "backing" to BlockStats

Currently there is no way to query BlockStats of the backing chain. This
adds "backing" field into BlockStats to make it possible.

The comment of "parent" is reworded.

Signed-off-by: Fam Zheng <>
Reviewed-by: Benoit Canet <>...

46bae927 01/24/2014 03:33 pm Hu Tao

qcow2: fix wrong value of L1E_OFFSET_MASK, L2E_OFFSET_MASK and REFT_OFFSET_MASK

Accoring to qcow spec, the offset fields in l1e, l2e and ref table entry
start at bit 9. The offset is cluster offset, and the smallest possible
cluster size is 512 bytes.

Signed-off-by: Hu Tao <>...

34ceed81 01/24/2014 03:33 pm Fam Zheng

vmdk: Check for overhead when opening

Report an error if file size is even smaller than metadata.

Signed-off-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

9cd76737 01/24/2014 03:33 pm Liu Yuan

sheepdog: fix 'qemu-img map'

It was muted in the previous commit 4bc74be9. Let's revive it since nothing
prevents us to do it.

With this patch, following command will work as other formats:

$ qemu-img map sheepdog:image

Cc:
Cc: Kevin Wolf <>...

6df3bf8e 01/24/2014 03:33 pm Zhang Min

drive mirror:fix memory leak

In the function mirror_iteration() > qemu_iovec_init(),
it allocates memory for op
>qiov.iov, when the write request calls back,
but in the function mirror_iteration_done(), it only frees the op,
not free the op->qiov.iov, so this causes memory leak....

d8a7b061 01/24/2014 03:33 pm Fam Zheng

vmdk: Fix format specific information (create type) for streamOptimized

Previously the field is wrong:

$ ./qemu-img create -f vmdk -o subformat=streamOptimized /tmp/a.vmdk 1G
$ ./qemu-img info /tmp/a.vmdk
image: /tmp/a.vmdk
file format: vmdk...
4373593d 01/22/2014 01:07 pm Max Reitz

blkdebug: Allow command-line file configuration

Introduce the "image" option as an alternative to specifying the image
through the filename.

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

70b6198a 01/22/2014 01:07 pm Max Reitz

blkverify: Allow command-line configuration

Introduce the "test" and "raw" options for specifying images.

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

22511ad6 01/22/2014 01:07 pm Max Reitz

blkverify: Don't require protocol filename

If the filename is not prefixed by "blkverify:" in
blkverify_parse_filename(), the blkverify driver was not selected
through that protocol prefix, but by an explicit command line (or QMP)
option (like driver=blkverify)....

466b49f2 01/22/2014 01:07 pm Max Reitz

blkdebug: Use errp for read_config()

Use an Error variable in the read_config() function.

Signed-off-by: Max Reitz <>
Reviewed-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

d4881b9b 01/22/2014 01:07 pm Max Reitz

blkdebug: Don't require sophisticated filename

If the filename is not prefixed by "blkdebug:" in
blkdebug_parse_filename(), the blkdebug driver was not selected through
that protocol prefix, but by an explicit command line option
(file.driver=blkdebug or something similar). Contrary to the current...

85a040e5 01/22/2014 01:07 pm Max Reitz

blkdebug: Always call read_config()

Move the check whether there actually is a config file into the
read_config() function.

Signed-off-by: Max Reitz <>
Reviewed-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>...

89f2b21e 01/22/2014 01:07 pm Max Reitz

blkdebug: Use command-line in read_config()

Use qemu_config_parse_qdict() to parse the command-line options in
addition to the config file.

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

72daa72e 01/22/2014 01:07 pm Max Reitz

block: Allow reference for bdrv_file_open()

Allow specifying a reference to an existing block device (by name) for
bdrv_file_open() instead of a filename and/or options.

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

e04fb07f 01/22/2014 01:07 pm Stefan Hajnoczi

rbd: switch from pipe to QEMUBH completion notification

rbd callbacks are called from non-QEMU threads. Up until now a pipe was
used to signal completion back to the QEMU iothread.

The pipe writer code handles EAGAIN using select(2). The select(2) API...

92397116 01/22/2014 01:07 pm Peter Lieven

block/iscsi: return -ENOMEM if an async call fails immediately

if an async libiscsi call fails directly it can only be due
to an out of memory condition. All other errors are returned
through the callback.

Signed-off-by: Peter Lieven <>
Reviewed-by: Ronnie Sahlberg <>...

15744b0b 01/22/2014 01:07 pm Bharata B Rao

gluster: Convert aio routines into coroutines

Convert the read, write, flush and discard implementations from aio-based
ones to coroutine based ones.

Signed-off-by: Bharata B Rao <>
Signed-off-by: Stefan Hajnoczi <>...

7c815372 01/22/2014 01:07 pm Bharata B Rao

gluster: Implement .bdrv_co_write_zeroes for gluster

Support .bdrv_co_write_zeroes() from gluster driver by using GlusterFS API
glfs_zerofill() that off-loads the writing of zeroes to GlusterFS server.

Signed-off-by: Bharata B Rao <>...

cf7f616b 01/22/2014 01:07 pm Bharata B Rao

gluster: Add support for creating zero-filled image

GlusterFS supports creation of zero-filled file on GlusterFS volume
by means of an API called glfs_zerofill(). Use this API from QEMU to
create an image that is filled with zeroes by using the preallocation...

9f23fce7 01/22/2014 01:07 pm Liu Yuan

sheepdog: fix clone operation by 'qemu-img create -b'

We should pass base_inode->vdi_id to base_vdi_id of SheepdogVdiReq so that sheep
can create a clone instead a fresh volume.

This fixes following command:

qemu-create -b sheepdog:base sheepdog:clone
...

585ea0c8 01/22/2014 01:07 pm Fam Zheng

vmdk: Fix big flat extent IO

Local variable "n" as int64_t avoids overflow with large sector number
calculation. See test case change for failure case.

Signed-off-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

dc6afb99 01/15/2014 11:44 am Jeff Cody

block: add .bdrv_reopen_prepare() stub for iscsi

To suppport reopen(), the .bdrv_reopen_prepare() stub must exist.
iSCSI does not have anything that needs to be done to support reopen,
so we can just implement the _prepare() stub.

Signed-off-by: Jeff Cody <>...

133fe774 01/14/2014 04:10 am Edgar E. Iglesias

Merge remote branch 'luiz/queue/qmp' into qmpq

  • luiz/queue/qmp:
    migration: qmp_migrate(): keep working after syntax error
    qerror: Remove assert_no_error()
    qemu-option: Remove qemu_opts_create_nofail
    target-i386: Remove assert_no_error usage
    hw: Remove assert_no_error usages...
eedc1a5d 01/10/2014 09:05 pm Anthony Liguori

Merge remote-tracking branch 'bonzini/scsi-next' into staging

  • bonzini/scsi-next:
    scsi-disk: add UNMAP limits to block limits VPD page
    block/iscsi: use a bh to schedule co reentrance

Message-id: ...

87ea75d5 01/06/2014 10:02 pm Peter Crosthwaite

qemu-option: Remove qemu_opts_create_nofail

This is a boiler-plate _nofail variant of qemu_opts_create. Remove and
use error_abort in call sites.

null/0 arguments needs to be added for the id and fail_if_exists fields
in affected callsites due to argument inconsistency between the normal and...

f95c625c 12/20/2013 05:26 pm Fam Zheng

mirror: Don't close target

Let reference count manage target and don't call bdrv_close here.

Signed-off-by: Fam Zheng <>
Reviewed-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

5bc361b8 12/20/2013 05:26 pm Fam Zheng

mirror: Move base to MirrorBlockJob

This allows setting the base before entering mirror_run, commit will
make use of it.

Signed-off-by: Fam Zheng <>
Reviewed-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

03544a6e 12/20/2013 05:26 pm Fam Zheng

block: Add commit_active_start()

commit_active_start is implemented in block/mirror.c, It will create a
job with "commit" type and designated base in block-commit command. This
will be used for committing active layer of device.

Sync mode is removed from MirrorBlockJob because there's no proper type...

20a63d2c 12/20/2013 05:26 pm Fam Zheng

commit: Support commit active layer

If active is top, it will be mirrored to base, (with block/mirror.c
code), then the image is switched when user completes the block job.

QMP documentation is updated.

Signed-off-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>

18da7f94 12/20/2013 05:26 pm Fam Zheng

commit: Remove unused check

We support top == active for commit now, remove the check and add an
assertion here.

Signed-off-by: Fam Zheng <>
Reviewed-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

917703c1 12/20/2013 02:56 pm Fam Zheng

vmdk: Allow vmdk_create to work with protocol

This improves vmdk_create to use bdrv_* functions to replace qemu_open
and other fd functions. The error handling are improved as well. One
difference is that bdrv_pwrite will round up buffer to sectors, so for...

219c2521 12/20/2013 10:11 am Stefan Weil

block/iscsi: Fix compilation for libiscsi 1.4.0 (API change)

Function iscsi_read10_task got additional parameters starting with version
libiscsi 1.5.0.

libiscsi 1.4.0 is still widely used (Debian wheezy, jessie and other Linux
distributions currently provide packages for QEMU which use it), so we...

7e30e6a6 12/20/2013 10:11 am Jeff Cody

block: vhdx - improve error message, and .bdrv_check implementation

If there is a dirty log file to be replayed in a VHDX image, it is
replayed in .vhdx_open(). However, if the file is opened read-only,
then a somewhat cryptic error message results.

This adds a more helpful error message for the user. If an image file...

b47053bd 12/20/2013 10:11 am Fam Zheng

vmdk: Check VMFS extent line field number

VMFS extent line in description file should be with 4 fields:

RW &lt;size&gt; VMFS "file-name.vmdk"

Check the number explicitly and report error if offset is appended as
FLAT, which should be invalid format.

Reported-by: Paolo Bonzini <>...

e50d7607 12/20/2013 10:11 am Liu Yuan

sheepdog: fix dynamic grow for running qcow2 format

When running qcow2 over sheepdog, we might meet following problem

qemu-system-x86_64: shrinking is not supported

And cause IO errors to Guest. This is because we abuse bs->total_sectors, which
is manipulated by generic block layer and race with sheepdog code....

b91f9324 12/16/2013 07:44 pm Anthony Liguori

Merge remote-tracking branch 'spice/tags/pull-spice-1' into staging

Collection of little cleanups anf bugfixes.
nbd patches in preparation of spice-nbd.

  1. gpg: Signature made Mon 16 Dec 2013 01:27:45 AM PST using RSA key ID D3E87138
  2. gpg: Can't check signature: public key not found...
80d6f5ea 12/16/2013 07:43 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/tags/for-anthony' into staging

Block patches

  1. gpg: Signature made Fri 13 Dec 2013 09:47:03 AM PST using RSA key ID C88F2FD6
  2. gpg: Can't check signature: public key not found
  1. By Peter Lieven (2) and others
  2. Via Kevin Wolf...
8b9dfe90 12/16/2013 12:25 pm Peter Lieven

block/iscsi: use a bh to schedule co reentrance

this fixes a potential segfault and performance regression.

If the coroutine is reentered directly in the iscsi_co_generic_cb
iscsi_process_{read,write} are interrupted and reentered any
time later. One the one hand this could happen after an iscsi_close...

2302c1ca 12/16/2013 11:12 am Marc-André Lureau

Split nbd block client code

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Gerd Hoffmann <>

e53a18e4 12/16/2013 11:12 am Marc-André Lureau

nbd: don't change socket block during negotiate

The caller might handle non-blocking using coroutine. Leave the choice
to the caller to use a blocking or non-blocking negotiate.

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>...

e2bc625f 12/16/2013 11:12 am Marc-André Lureau

nbd: pass export name as init argument

There is no need to keep the export name around, and it seems a better
fit as an argument in the init() call.

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>...

5ad283eb 12/16/2013 11:12 am Marc-André Lureau

nbd: make nbd_client_session_close() idempotent

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Gerd Hoffmann <>

69152c09 12/16/2013 11:12 am Marc-André Lureau

nbd: finish any pending coroutine

Make sure all pending coroutines are finished when closing the session.

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Gerd Hoffmann <>

b1b27b64 12/16/2013 11:12 am Marc-André Lureau

nbd: avoid uninitialized warnings

15815 Thread 1:
15815 Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
15815 at 0x65AD5CB: send (send.c:31)
15815 by 0x37F84B: nbd_wr_sync (nbd.c:145)
15815 by 0x37F94B: write_sync (nbd.c:186)...
c547e564 12/13/2013 06:11 pm Fam Zheng

blkdebug: Use QLIST_FOREACH_SAFE to resume IO

Qemu-iotest 030 was broken.

When the coroutine runs and finishes, it will remove itself from the req
list, so let's use safe version of foreach to avoid use after free.

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

a3120dee 12/13/2013 03:49 pm Liu Yuan

sheepdog: check if '-o redundancy' is passed from user

This fix a segfault (that is caused by b3af018f3) of following command:

$ qemu-img convert some_img sheepdog:some_img

Cc:
Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>...

f671d173 12/13/2013 03:49 pm Stefan Weil

block/vvfat: Fix compiler warnings for OpenBSD

The buildbot shows these compiler warnings:

block/vvfat.c: In function 'create_short_and_long_name':
block/vvfat.c:620: warning: array size (8) smaller than bound length (11)
block/vvfat.c:620: warning: array size (8) smaller than bound length (11)...

063c3378 12/09/2013 12:28 pm Peter Lieven

block/iscsi: introduce bdrv_co_{readv, writev, flush_to_disk}

this converts read, write and flush functions from aio to coroutines
eliminating almost 200 lines of code.

The requirement for libiscsi is bumped to version 1.4.0 which was
released in may 2012....

ac95acdb 12/06/2013 05:53 pm Hu Tao

qcow2: use start_of_cluster() and offset_into_cluster() everywhere

Signed-off-by: Hu Tao <>
Reviewed-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>

1c0704a5 12/05/2013 12:45 pm Peter Lieven

block/iscsi: set bdi->cluster_size

this patch aims to set bdi->cluster_size to the internal page size
of the iscsi target so that enabled callers can align requests
properly.

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Peter Lieven <>...

7572ddc8 12/05/2013 12:45 pm Peter Lieven

block/iscsi: set bs->bl.opt_transfer_length

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

7b4c4781 12/04/2013 04:19 pm Wenchao Xia

snapshot: distinguish id and name in load_tmp

Since later this function will be used so improve it. The only caller of it
now is qemu-img, and it is not impacted by introduce function
bdrv_snapshot_load_tmp_by_id_or_name() that call bdrv_snapshot_load_tmp()...

8c116b0e 12/04/2013 04:19 pm Wenchao Xia

qemu-nbd: support internal snapshot export

Now it is possible to directly export an internal snapshot, which
can be used to probe the snapshot's contents without qemu-img
convert.

Signed-off-by: Wenchao Xia <>
Signed-off-by: Stefan Hajnoczi <>

f8413b3c 12/04/2013 12:29 pm Kevin Wolf

qcow2: Zero-initialise first cluster for new images

Strictly speaking, this is only required for has_zero_init() == false,
but it's easy enough to just do a cluster-aligned write that is padded
with zeros after the header.

This fixes that after 'qemu-img create' header extensions are attempted...

7ce21016 12/03/2013 04:26 pm Paolo Bonzini

block: handle ENOTSUP from discard in generic code

Similar to write_zeroes, let the generic code receive a ENOTSUP for
discard operations. Since bdrv_discard has advisory semantics,
we can just swallow the error.

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

97b00e28 12/03/2013 04:26 pm Paolo Bonzini

vpc, vhdx: add get_info

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

95de6d70 12/03/2013 04:26 pm Paolo Bonzini

block drivers: add discard/write_zeroes properties to bdrv_get_info implementation

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

cffb1ec6 12/03/2013 04:26 pm Paolo Bonzini

block drivers: expose requirement for write same alignment from formats

This will let misaligned but large requests use zero clusters. This
is important because the cluster size is not guest visible.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Peter Lieven <>...

4b52498e 12/03/2013 04:26 pm Peter Lieven

block/iscsi: remove .bdrv_has_zero_init

since commit 3ac21627 the default value changed to 0.

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

2af8a1a7 12/03/2013 04:26 pm Peter Lieven

block/iscsi: updated copyright

added myself to reflect recent work on the iscsi block driver.

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

fa6252b0 12/03/2013 04:26 pm Paolo Bonzini

block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP

The current check is right for MAY_UNMAP=1. For MAY_UNMAP=0, just
try and fall back to regular writes as soon as a WRITE SAME command
fails.

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

260a82e5 12/03/2013 04:26 pm Paolo Bonzini

raw-posix: implement write_zeroes with MAY_UNMAP for files

Writing zeroes to a file can be done by punching a hole if
MAY_UNMAP is set.

Note that in this case ENOTSUP is not ignored, but makes
the block layer fall back to the generic implementation.

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

d0b4503e 12/03/2013 04:26 pm Paolo Bonzini

raw-posix: implement write_zeroes with MAY_UNMAP for block devices

See the next commit for the description of the Linux kernel problem
that is worked around in raw_open_common.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

97a2ae34 12/03/2013 04:26 pm Paolo Bonzini

raw-posix: add support for write_zeroes on XFS and block devices

The code is similar to the implementation of discard and write_zeroes
with UNMAP. However, failure must be propagated up to block.c.

The stale page cache problem can be reproduced as follows:...

af057fe7 12/03/2013 10:54 am Fam Zheng

vmdk: Fix creating big description file

The buffer for description file was 4096 which only covers a few
hundred of extents. This changes the buffer to dynamic allocated with
g_strdup_printf in order to support bigger cases.

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

509d39aa 11/29/2013 06:41 pm Fam Zheng

vmdk: Allow read only open of VMDK version 3

Signed-off-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

c9fbb99d 11/29/2013 06:41 pm Kevin Wolf

block: Use BDRV_O_NO_BACKING where appropriate

If you open an image temporarily just because you want to check its size
or get it flushed, there's no real reason to open the whole backing file
chain.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Fam Zheng <>...

c31d482f 11/29/2013 02:40 pm Liu Yuan

sheepdog: refactor do_sd_create()

We can actually use BDRVSheepdogState *s to pass most of the parameters.

Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>
Signed-off-by: Liu Yuan <>
Signed-off-by: Stefan Hajnoczi <>

b3af018f 11/29/2013 02:40 pm Liu Yuan

sheepdog: support user-defined redundancy option

Sheepdog support two kinds of redundancy, full replication and erasure coding.

  1. create a fully replicated vdi with x copies
    -o redundancy=x (1 <= x <= SD_MAX_COPIES)
  1. create a erasure coded vdi with x data strips and y parity strips...
4cc70e93 11/29/2013 02:40 pm Fam Zheng

blkdebug: add "remove_break" command

This adds "remove_break" command which is the reverse of blkdebug
command "break": it removes all breakpoints with given tag and resumes
all the requests.

Signed-off-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>

21b56835 11/29/2013 02:40 pm Fam Zheng

qapi: Change BlockDirtyInfo to list

We have multiple dirty bitmaps in BDS now, switch QAPI to allow query
it (BlockInfo.dirty_bitmaps), and also drop old BlockInfo.dirty.

Signed-off-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

14b98fda 11/29/2013 02:40 pm Charlie Shepherd

COW: Speed up writes

Process a whole sector's worth of COW bits by reading a sector, setting
the bits after skipping any already set bits, then writing it out again.
Make sure we only flush once before writing metadata, and only if we
need to write metadata....

091b1108 11/29/2013 02:40 pm Charlie Shepherd

COW: Extend checking allocated bits to beyond one sector

cow_co_is_allocated() only checks one sector's worth of allocated bits
before returning. This is allowed but (slightly) inefficient, so extend
it to check all of the file's metadata sectors.

Signed-off-by: Charlie Shepherd <>...

e4654d2d 11/29/2013 02:40 pm Fam Zheng

block: per caller dirty bitmap

Previously a BlockDriverState has only one dirty bitmap, so only one
caller (e.g. a block job) can keep track of writing. This changes the
dirty bitmap to a list and creates a BdrvDirtyBitmap for each caller, the
lifecycle is managed with these new functions:...

f4a193e7 11/28/2013 12:39 pm Max Reitz

block/stream: Don't stream unbacked devices

If a block device is unbacked, a streaming blockjob should immediately
finish instead of beginning to try to stream, then noticing the backing
file does not contain even the first sector (since it does not exist)...

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

iscsi: set limits in BlockDriverState

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

01a6a238 11/28/2013 11:30 am Peter Lieven

iscsi: simplify iscsi_co_discard

now that bdrv_co_discard can handle limits we do not need
the request split logic here anymore.

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

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

iscsi: add bdrv_co_write_zeroes

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

85829722 11/28/2013 11:30 am Liu Yuan

sheepdog: implement .bdrv_get_allocated_file_size

With this patch, qemu-img info sheepdog:image will show disk size for sheepdog
images.

Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>
Cc: MORITA Kazutaka <>...

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

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

block: introduce BDRV_REQ_MAY_UNMAP request flag

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

186d4f2b 11/28/2013 11:30 am Peter Lieven

block/iscsi: add .bdrv_get_info

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

78a52ad5 11/14/2013 02:09 pm Peter Lieven

qcow2: fix possible corruption when reading multiple clusters

if multiple sectors spanning multiple clusters are read the
function count_contiguous_clusters should ensure that the
cluster type should not change between the clusters.

Especially the for-loop should break when we have one...