Statistics
| Branch: | Revision:

root / block @ 24897a76

# Date Author Comment
35cb1748 02/21/2014 10:02 pm Paolo Bonzini

iscsi: fix indentation

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

f2917853 02/21/2014 10:02 pm Paolo Bonzini

iscsi: correctly propagate errors in iscsi_open

Before:
$ ./qemu-io-old
qemu-io-old> open -r -o file.driver=iscsi,file.filename=foo
Failed to parse URL : foo
qemu-io-old: can't open device (null): Could not open 'foo': Invalid argument

After:...

24897a76 02/21/2014 10:02 pm Paolo Bonzini

gluster: default scheme to gluster:// and host to localhost.

Currently, "gluster:///volname/img" and (using file. options)
"file.driver=gluster,file.filename=foo" will segfault. Also,
"//host/volname/img" will be rejected, but it is a valid URL
that should be accepted just fine with "file.driver=gluster"....

ddf5636d 02/21/2014 10:02 pm Max Reitz

block: Add reference parameter to bdrv_open()

Allow bdrv_open() to handle references to existing block devices just as
bdrv_file_open() is already capable of.

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

2e40134b 02/21/2014 10:02 pm Max Reitz

block: Make bdrv_file_open() static

Add the bdrv_open() option BDRV_O_PROTOCOL which results in passing the
call to bdrv_file_open(). Additionally, make bdrv_file_open() static and
therefore bdrv_open() the only way to call it.

Consequently, all existing calls to bdrv_file_open() have to be adjusted...

f7d9fd8c 02/21/2014 10:02 pm Max Reitz

block: Remove bdrv_open_image()'s force_raw option

This option is now unnecessary since specifying BDRV_O_PROTOCOL as flag
will do exactly the same.

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

a69d9af4 02/21/2014 10:02 pm Paolo Bonzini

nbd: produce a better error if neither host nor port is passed

Before:
$ qemu-io-old
qemu-io-old> open -r -o file.driver=nbd
qemu-io-old: can't open device (null): Could not open image: Invalid argument
$ ./qemu-io-old
qemu-io-old> open -r -o file.driver=nbd,file.host=foo,file.path=bar...

77e8b9ca 02/21/2014 10:02 pm Paolo Bonzini

nbd: correctly propagate errors

Before:
$ ./qemu-io-old
qemu-io-old> open -r -o file.driver=nbd
one of path and host must be specified.
qemu-io-old: can't open device (null): Could not open image: Invalid argument
$ ./qemu-io-old
qemu-io-old> open -r -o file.driver=nbd,file.host=foo,file.path=bar...

a71835a0 02/21/2014 10:02 pm Kevin Wolf

qcow2: Set zero flag for discarded clusters

Instead of making the backing file contents visible again after a discard
request, set the zero flag if possible (i.e. on version >= 3).

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

f67503e5 02/21/2014 10:02 pm Max Reitz

block: Change BDS parameter of bdrv_open() to **

Make bdrv_open() take a pointer to a BDS pointer, similarly to
bdrv_file_open(). If a pointer to a NULL pointer is given, bdrv_open()
will create a new BDS with an empty name; if the BDS pointer is not
NULL, that existing BDS will be reused (in the same way as bdrv_open()...

4c0c9bbe 02/20/2014 02:10 pm Peter Maydell

Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging

  • remotes/qmp-unstable/queue/qmp:
    monitor: Add object_add class argument completion.
    monitor: Add object_del id argument completion.
    monitor: Add device_add device argument completion....
84d18f06 02/17/2014 06:57 pm Markus Armbruster

Use error_is_set() only when necessary

error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out. Unnecessarily hard for
optimizers, static checkers, and human readers. Dumb it down to
obvious.

Gets rid of several dozen Coverity false positives....

cc67f4d1 02/14/2014 07:05 pm Jeff Cody

block: mirror - use local_err to avoid NULL errp

When starting a block job, commit_active_start() relies on whether *errp
is set by mirror_start_job. This allows it to determine if the mirror
job start failed, so that it can clean up any changes to open flags from...

39a611a3 02/14/2014 07:05 pm Jeff Cody

block: Don't throw away errno via error_setg

There are a handful of places in the block layer where a failure path
has a valid -errno value, yet error_setg() is used. Those instances
should instead use error_setg_errno(), to preserve as much error
information as possible....

28f106af 02/14/2014 02:38 pm Jeff Cody

block: Add notes to iSCSI's .bdrv_open and .bdrv_reopen_prepare

iSCSI currently does not need to do any actions to support the
current usage of bdrv_reopen(). However, it is important to note
a couple of things: 1.) A connection will not be re-established to...

16f0587e 02/09/2014 10:12 am Hu Tao

qcow2: remove n_start and n_end of qcow2_alloc_cluster_offset()

n_start can be actually calculated from offset. The number of
sectors to be allocated(n_end - n_start) can be passed in in
num. By removing n_start and n_end, we can save two parameters.

The side effect is there is a bug in qcow2.c:preallocate() that...

33304ec9 02/09/2014 10:12 am Hu Tao

qcow2: fix offset overflow in qcow2_alloc_clusters_at()

When cluster size is big enough it can lead to an offset overflow
in qcow2_alloc_clusters_at(). This patch fixes it.

The allocation is stopped each time at L2 table boundary
(see handle_alloc()), so the possible maximum bytes could be...

7c2bbf4a 02/09/2014 10:12 am Hu Tao

qcow2: check for NULL l2meta

In the case of a metadata preallocation with a large cluster size,
qcow2_alloc_cluster_offset() can allocate nothing and returns a
NULL l2meta. This patch checks for it and link2 l2 with only valid
l2meta.

Replace 9 and 512 with BDRV_SECTOR_BITS, BDRV_SECTOR_SIZE...

ad6aef43 02/09/2014 10:12 am Kevin Wolf

raw: Fix BlockLimits passthrough

raw copies over the BlockLimits of bs->file during bdrv_open().
However, since commit d34682cd it is immediately overwritten during
bdrv_refresh_limits(). This caused all fields except for
opt_transfer_length and opt_mem_alignment (which happen to be correctly...

eaf944a4 02/09/2014 10:12 am Kevin Wolf

blkdebug: Don't leak bs->file on failure

Reported-by: Laszlo Ersek <>
Signed-off-by: Kevin Wolf <>
Reviewed-by: Laszlo Ersek <>

6542aa9c 02/09/2014 10:12 am Peter Lieven

block: add native support for NFS

This patch adds native support for accessing images on NFS
shares without the requirement to actually mount the entire
NFS share on the host.

NFS Images can simply be specified by an url of the form:
nfs://<host>/<export>/<filename>[?param=value[&param2=value2[&...]]]...

5d259fc7 02/09/2014 10:12 am Peter Lieven

block/iscsi: always fill bs->bl.opt_transfer_length

the opt_transfer_length has nothing to do with logical
block provisioning stuff so always copy it from
the block limits VPD page.

Reported-By: Benoit Canet <>
Signed-off-by: Peter Lieven <>...

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

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