Statistics
| Branch: | Revision:

root / block @ 363c3c85

# Date Author Comment
363c3c85 09/21/2011 04:16 pm Nick Thomas

block/curl: Don't finish AIOCBs too early

The previous behaviour was to finish AIOCBs inside curl_aio_readv()
if the data was cached. This caused the following failed assertion
at hw/ide/pci.c:314: bmdma_cmd_writeb

"Assertion `bm->bus->dma->aiocb == ((void *)0)' failed."...

c84dcdc1 09/21/2011 04:16 pm Nick Thomas

block/curl: Implement a flush function on the fd handlers

Signed-off-by: Nick Thomas <>
Signed-off-by: Kevin Wolf <>

16a06b24 09/20/2011 03:34 pm Sage Weil

rbd: allow escaping in config string

The config string is variously delimited by =, @, and /, depending on the
field. Allow these characters to be escaped by preceeding them with \.

Signed-off-by: Sage Weil <>
Signed-off-by: Kevin Wolf <>

f9fe18ec 09/20/2011 01:27 pm Sage Weil

rbd: ignore failures when reading from default conf location

If we are reading from the default config location, ignore any failures.
It is perfectly legal for the user to specify exactly the options they need
and to not rely on any config file.

Signed-off-by: Sage Weil <>...

9e1fbcde 09/20/2011 01:27 pm Sage Weil

rbd: update comment heading

Properly document the configuration string syntax and semantics. Remove
(out of date) details about the librbd implementation.

Signed-off-by: Sage Weil <>
Signed-off-by: Kevin Wolf <>

7a3f5fe9 09/20/2011 01:27 pm Sage Weil

rbd: call flush, if available

librbd recently added async writeback and flush support. If the new
rbd_flush() call is available, call it.

Signed-off-by: Sage Weil <>
Signed-off-by: Kevin Wolf <>

b3c0bfb6 09/20/2011 01:27 pm Fam Zheng

VMDK: fix leak of extent_file

Release extent_file on error in vmdk_parse_extents. Added closing files
in freeing extents.

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

b90fb4b8 09/19/2011 12:34 pm Paolo Bonzini

nbd: support feature negotiation

nbd supports writing flags in bytes 24...27 of the header,
and uses that for the read-only flag. Add support for it
in qemu-nbd.

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

074abad3 09/19/2011 12:34 pm Kevin Wolf

raw-posix: Fix bdrv_flush error return values

bdrv_flush is supposed to use 0/-errno return values

Signed-off-by: Kevin Wolf <>

b2bedb21 09/16/2011 04:25 pm Stefan Weil

Remove blanks before \n in output strings

Those blanks violate the coding conventions, see
scripts/checkpatch.pl.

Blanks missing after colons in the changed lines were added.

This patch does not try to fix tabs, long lines and other
problems in the changed lines, therefore checkpatch.pl reports...

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

nbd: Clean up use of block_int.h

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

05140499 09/12/2011 04:17 pm Frediano Ziglio

qcow2: initialize metadata before inserting in cluster_allocs

QCow2Meta structure was inserted into list before many fields are
initialized. Currently is not a problem cause all occur in a lock
but if qcow2_alloc_clusters would in a future unlock this lock...

dea43a65 09/12/2011 04:17 pm Frediano Ziglio

qcow2: align cluster_data to block to improve performance using O_DIRECT

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

ee18e730 09/12/2011 04:17 pm Frediano Ziglio

qcow2: fix range check

QCowL2Meta::offset is not cluster aligned but only sector aligned
however nb_clusters count cluster from cluster start.
This fix range check. Note that old code have no corruption issues
related to this check cause it only cause intersection to occur...

dfe80b07 09/12/2011 04:17 pm Sage Weil

rbd: clean up, fix style

No assignment in condition. Remove duplicate ret > 0 check.

Signed-off-by: Sage Weil <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

eb93d5d9 09/12/2011 04:17 pm Sage Weil

rbd: fix leak in qemu_rbd_open failure paths

Fix leak of s->snap in failure path. Simplify error paths for the whole
function.

Reported-by: Stefan Hajnoczi <>
Signed-off-by: Sage Weil <>
Reviewed-by: Stefan Hajnoczi <>...

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

7c7e9df0 09/12/2011 04:17 pm Sage Weil

rbd: allow client id to be specified in config string

Allow the client id to be specified in the config string via 'id=' so that
users can control who they authenticate as. Currently they are stuck with
the default ('admin'). This is necessary for anyone using authentication...

a7912369 09/12/2011 04:17 pm Frediano Ziglio

qcow2: removed unused depends_on field

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

bb45ded9 09/06/2011 01:33 pm Fam Zheng

VMDK: bugfix, opening vSphere 4 exported image

The vSphere 4 exported image is streamOptimized extent, which is not
quite correctly handled. Ignore rdgOffset when RGD flag bit not set.

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

f16f509d 09/06/2011 01:33 pm Fam Zheng

VMDK: bugfix, open Haiku vmdk image

Haiku provides a specially formed vmdk image, which let qemu abort. It a
combination of sparse header and flat data (i.e. with not l1/l2 table at
all). The fix is turn to descriptor when sparse header is zero in field
'capacity'....

6c031aac 09/06/2011 01:31 pm Fam Zheng

VMDK: creating streamOptimized subformat

Creating streamOptimized subformat. Added subformat option
'streamOptimized', to create a image with compression enabled and each
cluster with a GrainMarker.

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

2b2c8c5d 09/06/2011 01:30 pm Fam Zheng

VMDK: read/write compressed extent

Add support for reading/writing compressed extent.

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

432bb170 09/06/2011 01:27 pm Fam Zheng

VMDK: Opening compressed extent.

Added flags field for compressed/streamOptimized extents, open and save
image configuration.

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

dd3f6ee2 09/06/2011 01:25 pm Fam Zheng

VMDK: separate vmdk_read_extent/vmdk_write_extent

Factor out read/write extent code, since there will be more things to
take care of once reading/writing compressed clusters is introduced.

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

86c6b429 09/06/2011 01:22 pm Fam Zheng

VMDK: add twoGbMaxExtentSparse support

Add twoGbMaxExtentSparse support. Introduce vmdk_free_last_extent.

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

6398de51 09/06/2011 01:20 pm Fam Zheng

VMDK: enable twoGbMaxExtentFlat

Enable the createType 'twoGbMaxExtentFlat'. The supporting code is
already in.

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

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

block/raw: Fix to forward method bdrv_media_changed()

Block driver "raw" forwards most methods to the underlying block
driver. However, it doesn't implement method bdrv_media_changed().
Makes bdrv_media_changed() always return -ENOTSUP.

I believe -fda /dev/fd0 gives you raw over host_floppy, and disk...

c30e624d 09/06/2011 12:23 pm Frediano Ziglio

linux aio: some comments

Add some notes about Linux AIO explaining why we don't use AIO in
some situations.

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

8e217d53 09/06/2011 12:23 pm Kevin Wolf

qcow2: Properly initialise QcowL2Meta

Dependency list pointers filled with random garbage from the stack aren't a
good idea.

Signed-off-by: Kevin Wolf <>

0fa9131a 09/06/2011 12:23 pm Kevin Wolf

qcow2: Fix error cases to run depedent requests

Requests depending on a failed request would end up waiting forever. This fixes
the error path to continue dependent requests even when the request has failed.

Signed-off-by: Kevin Wolf <>

541dc0d4 09/03/2011 01:45 pm Stefan Weil

Use new macro QEMU_PACKED for packed structures

Most changes were made using these commands:

git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'...

2f4b7593 08/25/2011 04:23 pm Frediano Ziglio

qcow2: remove unused qcow2_create_refcount_update function

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

35ee5e39 08/25/2011 04:22 pm Frediano Ziglio

qcow2: use always stderr for debugging

let all DEBUG_ALLOC2 printf goes to stderr

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

2df46246 08/24/2011 03:53 pm MORITA Kazutaka

sheepdog: use coroutines

This makes the sheepdog block driver support bdrv_co_readv/writev
instead of bdrv_aio_readv/writev.

With this patch, Sheepdog network I/O becomes fully asynchronous. The
block driver yields back when send/recv returns EAGAIN, and is resumed...

ab0997e0 08/23/2011 06:41 pm Frediano Ziglio

qcow2: remove memory leak

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

f785a5ae 08/23/2011 06:41 pm Nicholas Thomas

block/curl: Handle failed reads gracefully.

Current behaviour if a read fails is for the acb to not get finished.
This causes an infinite loop in bdrv_read_em (block.c). The read failure
never gets reported to the guest and if the error condition clears, the...

f5cd8173 08/23/2011 06:41 pm Frediano Ziglio

qcow/qcow2: Allocate QCowAIOCB structure using stack

instead of calling qemi_aio_get use stack

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

430bbaaa 08/23/2011 06:41 pm Frediano Ziglio

qcow: QCowAIOCB field cleanup

remove unused field from this structure and put some of them in qcow_aio_read_cb and qcow_aio_write_cb

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

43ca85b5 08/23/2011 06:41 pm Frediano Ziglio

qcow: move some blocks of code to avoid useless variable initialization

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

27deebe8 08/23/2011 06:41 pm Frediano Ziglio

qcow: Remove QCowAIOCB

Embed qcow_aio_read_cb into qcow_co_readv and qcow_aio_write_cb into qcow_co_writev

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

122bbd1d 08/23/2011 06:41 pm Frediano Ziglio

qcow: remove old #undefined code

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

4617310c 08/23/2011 06:41 pm Frediano Ziglio

qcow2: Removed unused AIOCB fields

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

faf575c1 08/23/2011 06:41 pm Frediano Ziglio

qcow2: removed cur_nr_sectors field in QCowAIOCB

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

c2271403 08/23/2011 06:41 pm Frediano Ziglio

qcow2: remove l2meta from QCowAIOCB

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

c2bdd990 08/23/2011 06:41 pm Frediano Ziglio

qcow2: remove cluster_offset from QCowAIOCB

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

e78c69b8 08/23/2011 06:41 pm Frediano Ziglio

qcow2: remove common from QCowAIOCB

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

5ebaa27e 08/23/2011 06:41 pm Frediano Ziglio

qcow2: reindent and use while before the big jump

prepare to remove read/write callbacks

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

3fc48d09 08/23/2011 06:41 pm Frediano Ziglio

qcow2: Removed QCowAIOCB entirely

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

6cbc3031 08/23/2011 03:15 pm Philipp Hahn

qcow2: Fix DEBUG_* compilation

By introducing BlockDriverState compiling qcow2 with DEBUG_ALLOC and DEBUG_EXT
defined got broken.
Define a BdrvCheckResult structure locally which is now needed as the second
argument.

Also fix qcow2_read_extensions() needing BDRVQcowState....

d57237f2 08/23/2011 03:15 pm Devin Nakamura

qcow2: fix typo in documentation for qcow2_get_cluster_offset()

Documentation states the num is measured in clusters, but its
actually measured in sectors

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

de33b1f3 08/23/2011 03:15 pm Scott Wood

qcow: initialize coroutine mutex

commit 52b8eb60132b27ad53476490e9d7579003390cfa added a mutex,
but never initialized it. This caused a segfault.

Reported-by: Alexander Graf <>
Signed-off-by: Scott Wood <>
Signed-off-by: Kevin Wolf <>

2c993ec2 08/22/2011 06:19 pm Stefan Weil

w32: Fix qemu_ftruncate64

SetFilePointer returns INVALID_SET_FILE_POINTER when it fails.
In addition, GetLastError must be checked.

The first call of SetFilePointer did not use INVALID_SET_FILE_POINTER,
the second call used wrong error handling.

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

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

35d7ace7 08/05/2011 03:15 pm Kevin Wolf

qcow2: Fix L1 table size after bdrv_snapshot_goto

When loading an internal snapshot whose L1 table is smaller than the current L1
table, the size of the current L1 would be shrunk to the snapshot's L1 size in
memory, but not on disk. This lead to incorrect refcount updates and eventuelly...

68d100e9 08/02/2011 04:53 pm Kevin Wolf

qcow2: Use coroutines

Signed-off-by: Kevin Wolf <>

52b8eb60 08/02/2011 04:53 pm Kevin Wolf

qcow: Use coroutines

The old qcow format is another user of the AsyncContext infrastructure.
Converting it to coroutines (and therefore CoMutexes) allows to remove
AsyncContexts.

Signed-off-by: Kevin Wolf <>

384acbf4 08/02/2011 04:53 pm Kevin Wolf

async: Remove AsyncContext

The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancy
during an emulated bdrv_read/write (which includes a qemu_aio_wait() call and
can run AIO callbacks of different requests if it weren't for AsyncContexts)....

c1ee7d56 08/01/2011 01:10 pm Frediano Ziglio

raw-posix: Typo fix

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

f6e8ffc2 08/01/2011 01:10 pm Frediano Ziglio

raw-posix: Always check paio_init result

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

02266d54 08/01/2011 01:10 pm Markus Armbruster

block/raw-win32: Drop disabled code for removable host devices

It's been disabled since the start (commit 19cb3738, Aug 2006), and
has been untouched except for spelling fixes and such. I don't feel
like dragging it along any further.

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

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

block: Make BlockDriver method bdrv_set_locked() return void

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

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

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

block: Make BlockDriver method bdrv_eject() return void

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

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

efc8243d 08/01/2011 01:10 pm Serge E. Hallyn

block/vpc.c: Detect too-large vpc file

VHD files technically can be up to 2Tb, but virtual pc is limited
to 127G. Currently qemu-img refused to create vpc files > 127G,
but it is failing to return error when converting from a non-vpc
VHD file which is >127G. It returns success, but creates a truncated...

00aa0040 07/25/2011 05:38 pm Blue Swirl

Wrap recv to avoid warnings

Avoid warnings like these by wrapping recv():
CC slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]...

93913dfd 07/19/2011 04:39 pm Kevin Wolf

qcow2: Use Qcow2Cache in writeback mode during loadvm/savevm

In snapshotting there is no guest involved, so we can safely use a writeback
mode and do the flushes in the right place (i.e. at the very end). This
improves the time that creating/restoring an internal snapshot takes with an...

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

69b4d86d 07/19/2011 04:39 pm Fam Zheng

VMDK: move 'static' cid_update flag to bs field

Cid_update is the flag for updating CID on first write after opening the
image. This should be per image open rather than per program life cycle,
so change it from static var of vmdk_write to a field in BDRVVmdkState....

91b85bd3 07/19/2011 04:39 pm Fam Zheng

VMDK: change get_cluster_offset return type

The return type of get_cluster_offset was an offset that use 0 to denote
'not allocated', this will be no longer true for flat extents, as we see
flat extent file as a single huge cluster whose offset is 0 and length...

7fa60fa3 07/19/2011 04:39 pm Fam Zheng

VMDK: open/read/write for monolithicFlat image

Parse vmdk decriptor file and open mono flat image.
Read/write the flat extent.

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

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

VMDK: create different subformats

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

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

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

VMDK: fix coding style

Conform coding style in vmdk.c to pass scripts/checkpatch.pl checks.

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

0e69c543 07/19/2011 04:39 pm Fam Zheng

VMDK: bugfix, align offset to cluster in get_whole_cluster

In get_whole_cluster, the offset is not aligned to cluster when reading
from backing_hd. When the first write to child is not at the cluster
boundary, wrong address data from parent is copied to child....

01fc99d6 07/19/2011 04:39 pm Fam Zheng

VMDK: probe for monolithicFlat images

Probe as the same behavior as VMware does.
Recognize image as monolithicFlat descriptor file when the file is text
and the first effective line (not '#' leaded comment or space line) is
either 'version=1' or 'version=2'. No space or upper case charactors...

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

VMDK: separate vmdk_open by format version

Separate vmdk_open by subformats to:
  • vmdk_open_vmdk3
  • vmdk_open_vmdk4

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

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

VMDK: add field BDRVVmdkState.desc_offset

There are several occurrence of magic number 0x200 as the descriptor
offset within mono sparse image file. This is not the case for images
with separate descriptor file. So a field is added to BDRVVmdkState to
hold the correct value....

333c574d 07/19/2011 04:39 pm Fam Zheng

VMDK: flush multiple extents

Flush all the file that referenced by the image.

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

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

VMDK: introduce VmdkExtent

Introduced VmdkExtent array into BDRVVmdkState, enable holding multiple
image extents for multiple file image support.

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

a8e0fdd7 07/18/2011 05:06 pm MORITA Kazutaka

sheepdog: add full data preallocation support

This introduces qemu-img create option for sheepdog which allows the
data to be fully preallocated (note that sheepdog always preallocates
metadata).

The option is disabled by default and you need to enable it like the...

343f8568 07/05/2011 12:23 pm Johannes Stezenbach

block/raw-posix: Linux compat-ioctl warning workaround

On Linux x86_64 host with 32bit userspace, running
qemu or even just "qemu-img create -f qcow2 some.img 1G"
causes a kernel warning:

ioctl32(qemu-img:5296): Unknown cmd fd(3) cmd(00005326){t:'S';sz:0} arg(7fffffff) on some.img...

db78ef5b 06/24/2011 11:13 am Markus Armbruster

sheepdog: qemu_bh_new() can't return null pointer, drop check

Signed-off-by: Markus Armbruster <>
Signed-off-by: Stefan Hajnoczi <>

6daf194d 06/24/2011 11:13 am Markus Armbruster

Strip trailing '\n' from error_report()'s first argument

error_report() prepends location, and appends a newline. The message
constructed from the arguments should not contain a newline. Fix the
obvious offenders.

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

9e2a3701 06/15/2011 03:36 pm Kevin Wolf

qcow2: Fix in-flight list after qcow2_cache_put failure

If qcow2_cache_put returns an error during cluster allocation and the
allocation fails, it must be removed from the list of in-flight allocations.
Otherwise we'd get a loop in the list when the ACB is used for the next...

e67a64a8 06/15/2011 03:35 pm Kevin Wolf

vdi: Avoid direct AIO callback

bdrv_aio_* must not call the callback before returning to its caller. In vdi,
this could happen in some error cases. This starts the real requests processing
in a BH to avoid this situation.

Signed-off-by: Kevin Wolf <>

b11a24de 06/14/2011 06:03 pm Kevin Wolf

qcow: Avoid direct AIO callback

bdrv_aio_* must not call the callback before returning to its caller. In qcow,
this could happen in some error cases. This starts the real requests processing
in a BH to avoid this situation.

Signed-off-by: Kevin Wolf <>

42496d62 06/14/2011 06:03 pm Kevin Wolf

qcow2: Avoid direct AIO callback

bdrv_aio_* must not call the callback before returning to its caller. In qcow2,
this could happen in some error cases. This starts the real requests processing
in a BH to avoid this situation.

Signed-off-by: Kevin Wolf <>

7bf4162a 06/14/2011 11:01 am Stefan Weil

block/rbd: Remove unused local variable

Variable 'snap' is assigned a value that is never used.
Remove snap and the related code.

Cc: Christian Brunner <>
Cc: Josh Durgin <>
Cc: Kevin Wolf <>
Signed-off-by: Stefan Weil <>...

13748cf4 06/08/2011 08:13 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/trivial-patches' into staging

fab5cf59 06/08/2011 12:56 pm Josh Durgin

rbd: allow configuration of rados from the rbd filename

The new format is rbd:pool/image[@snapshot][:option1=value1[:option2=value2...]]
Each option is used to configure rados, and may be any Ceph option, or "conf".
The "conf" option specifies a Ceph configuration file to read....

51a13528 06/08/2011 12:56 pm Josh Durgin

rbd: check return values when scheduling aio

If scheduling fails, the number of outstanding I/Os must be correct,
or there will be a hang when waiting for everything to be flushed.

Reviewed-by: Christian Brunner <>
Reported-by: Stefan Hajnoczi <>...

30cdc48c 06/08/2011 12:56 pm Josh Durgin

rbd: Add bdrv_truncate implementation

Reviewed-by: Christian Brunner <>
Signed-off-by: Josh Durgin <>
Signed-off-by: Kevin Wolf <>

80fa3341 06/08/2011 12:56 pm Kevin Wolf

qcow2: Fix memory leaks in error cases

This fixes memory leaks that may be caused by I/O errors during L1 table growth
(can happen during save_vm) and in qemu-img check.

Signed-off-by: Kevin Wolf <>

99cce9fa 06/08/2011 12:56 pm Kevin Wolf

qemu-img create: Fix displayed default cluster size

When not specifying a cluster size on the command line, qemu-img printed
a cluster size of 0:

Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864
encryption=off cluster_size=0

This patch adds the default cluster size to the QEMUOptionParameter list, so...

d1f6fd8d 06/08/2011 12:56 pm Christoph Egger

block/raw-posix: get right partition size

use the correct way to get the size of a disk device or partition

From: Adam Hamsik <>
Signed-off-by: Christoph Egger <>
Signed-off-by: Kevin Wolf <>

ad32e9c0 06/08/2011 12:56 pm Josh Durgin

rbd: use the higher level librbd instead of just librados

librbd stacks on top of librados to provide access
to rbd images.

Using librbd simplifies the qemu code, and allows
qemu to use new versions of the rbd format
with few (if any) changes.

Reviewed-by: Christian Brunner <>...

a6599793 06/08/2011 11:39 am Christoph Hellwig

block: clarify the meaning of BDRV_O_NOCACHE

Change BDRV_O_NOCACHE to only imply bypassing the host OS file cache,
but no writeback semantics. All existing callers are changed to also
specify BDRV_O_CACHE_WB to give them writeback semantics.

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

16372ff0 06/08/2011 11:39 am Alexander Graf

vmdk: fix endianness bugs

The vmdk code is sloppy when handling the header descriptor during
creation of an image. Fix all header accesses in the create path to
either store native endianness or convert it when appropriate.

Reported-by: Yury Tsarev <>...

1de1ae0a 06/08/2011 11:39 am Christoph Egger

block/raw-posix: use a character device if a block device is given

On NetBSD a userland process is better with the character device
interface. In addition, a block device can't be opened twice; if a Xen
backend opens it, qemu can't and vice-versa.

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

9bf0960a 06/08/2011 11:04 am Alexandre Raymond

Fix compilation warning due to missing header for sigaction (followup)

This patch removes all references to signal.h when qemu-common.h is included
as they become redundant.

Signed-off-by: Alexandre Raymond <>
Signed-off-by: Stefan Hajnoczi <>

77a5a000 05/18/2011 03:39 pm Stefan Hajnoczi

qed: support for growing images

The .bdrv_truncate() operation resizes images and growing is easy to
implement in QED. Simply check that the new size is valid and then
update the image_size header field to reflect the new size.

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