Statistics
| Branch: | Revision:

root / block @ c0424934

# Date Author Comment
1f8bcac0 04/23/2012 10:27 pm Anthony Liguori

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

  • kwolf/for-anthony: (38 commits)
    qemu-iotests: Fix test 031 for qcow2 v3 support
    qemu-iotests: Add -o and make v3 the default for qcow2
    qcow2: Zero write support
    qemu-iotests: Test backing file COW with zero clusters...
621f0589 04/20/2012 04:57 pm Kevin Wolf

qcow2: Zero write support

Signed-off-by: Kevin Wolf <>

76dc9e0c 04/20/2012 04:57 pm Kevin Wolf

qcow2: Ignore reserved bits in refcount table entries

Signed-off-by: Kevin Wolf <>

afdf0abe 04/20/2012 04:57 pm Kevin Wolf

qcow2: Ignore reserved bits in check_refcounts

Also don't infer the cluster type directly from the L2 entries, but use
qcow2_get_cluster_type() to keep everything in a single place.

Signed-off-by: Kevin Wolf <>

6744cbab 04/20/2012 04:57 pm Kevin Wolf

qcow2: Version 3 images

This adds the basic infrastructure to qcow2 to handle version 3 images.
It includes code to create v3 images, allow header updates for v3 images
and checks feature bits.

It still misses support for zero clusters, so this is not a fully...

6377af48 04/20/2012 04:57 pm Kevin Wolf

qcow2: Support reading zero clusters

This adds support for reading zero clusters in version 3 images.

Signed-off-by: Kevin Wolf <>

cfcc4c62 04/20/2012 04:57 pm Kevin Wolf

qcow2: Support for feature table header extension

Instead of printing an ugly bitmask, qemu can now print a more helpful
string even for yet unknown features.

Signed-off-by: Kevin Wolf <>

8e37f681 04/20/2012 04:57 pm Kevin Wolf

qcow2: Ignore reserved bits in L1/L2 entries

This changes the still existing places that assume that the only flags
are QCOW_OFLAG_COPIED and QCOW_OFLAG_COMPRESSED to properly mask out
reserved bits.

It does not convert bdrv_check yet.

Signed-off-by: Kevin Wolf <>

c7a4c37a 04/20/2012 04:57 pm Kevin Wolf

qcow2: Refactor qcow2_free_any_clusters

Zero clusters will add another cluster type. Refactor the open-coded
cluster type detection into a switch of QCOW2_CLUSTER_* options so that
the detection is in a single place. This makes it easier to add new
cluster types....

143550a8 04/20/2012 04:57 pm Kevin Wolf

qcow2: Simplify count_cow_clusters

count_cow_clusters() tries to reuse existing functions, and all it
achieves is to make things much more complicated than they really are:
Everything needs COW, unless it's a normal cluster with refcount 1.

This patch implements the obvious way of doing this, and by using...

90b27759 04/20/2012 04:57 pm Kevin Wolf

qcow2: Save disk size in snapshot header

This allows that different snapshots of an image can have different
sizes, which is a requirement for enabling image resizing even with
images that have internal snapshots.

We don't do the actual support for it now, but make sure that the...

68d000a3 04/20/2012 04:57 pm Kevin Wolf

qcow2: Ignore reserved bits in get_cluster_offset

With this change, reading from a qcow2 image ignores all reserved bits
that are set in an L1 or L2 table entry.

Now get_cluster_offset() assigns *cluster_offset only the offset without
any other flags. The cluster type is not longer encoded in the offset,...

2bfcc4a0 04/20/2012 04:57 pm Kevin Wolf

qcow2: Ignore reserved bits in count_contiguous_clusters()

Until now, count_contiguous_clusters() has an argument that allowed to
specify flags that should be ignored in the comparison, i.e. that are
allowed to change between contiguous clusters.

This patch changes the function so that it ignores all flags by default...

b0b6862e 04/20/2012 04:57 pm Kevin Wolf

qcow2: Fail write_compressed when overwriting data

qcow2_alloc_compressed_cluster_offset() already fails if the copied flag
is set, because qcow2_write_compressed() doesn't perform COW as it would
have to do to allow this.

However, what we really want to check here is whether the cluster is...

f24423bd 04/20/2012 04:56 pm Kevin Wolf

qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at()

Refcount block allocation and refcount table growth rely on
s->free_cluster_index pointing to somewhere after the current
allocation. Change qcow2_alloc_cluster_at() to fulfill this
assumption....

bafbd6a1 04/19/2012 05:37 pm Paolo Bonzini

aio: remove process_queue callback and qemu_aio_process_queue

Both unused after the previous patch.

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

fc19f8a0 04/19/2012 05:36 pm Paolo Bonzini

nbd: consistently check for <0 or >=0

This prepares for the following patch, which changes -1 return values
to negative errno.

Signed-off-by: Paolo Bonzini <>

185b4338 04/19/2012 05:36 pm Paolo Bonzini

nbd: consistently return negative errno values

In the next patch we need to look at the return code of nbd_wr_sync.
To avoid percolating the socket_error() ugliness all around, let's
handle errors by returning negative errno values.

Signed-off-by: Paolo Bonzini <>

7fe7b68b 04/19/2012 05:36 pm Paolo Bonzini

nbd: do not block in nbd_wr_sync if no data at all is available

Right now, nbd_wr_sync will hang if no data at all is available on the
socket and the other side is not going to provide any. Relax this by
making it loop only for writes or partial reads. This fixes a race...

dd3e8ac4 04/19/2012 05:36 pm Paolo Bonzini

nbd: avoid out of bounds access to recv_coroutine array

This can happen with a buggy or malicious server.

Reported-by: Michael Tokarev <>
Signed-off-by: Paolo Bonzini <>

8dc0a5e7 04/19/2012 05:03 pm Kevin Wolf

qcow2: Fix error handling in qcow2_alloc_cluster_offset

If do_alloc_cluster_offset() fails, the error handling code tried to
remove the request from the in-flight queue, to which it wasn't added
yet, resulting in a NULL pointer dereference.

m->nb_clusters really only becomes != 0 when the request is in the list....

2795ecf6 04/19/2012 05:03 pm Kevin Wolf

qcow2: Fix return value of alloc_refcount_block

Someone forgot something in commit 29c1a730... Documenting the right
return value is not enough, you also need to actually return it in the
code.

This bug sometimes causes error return values even when everything has...

4e35b92a 04/19/2012 04:48 pm Stefan Weil

block: Fix spelling in comment (ineffcient -> inefficient)

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

bb5d8dd7 04/10/2012 04:16 pm Anthony Liguori

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

  • kwolf/for-anthony: (46 commits)
    qed: remove incoming live migration blocker
    qed: honor BDRV_O_INCOMING for incoming live migration
    migration: clear BDRV_O_INCOMING flags on end of incoming live migration...
50d30c26 04/05/2012 05:29 pm Benoît Canet

qed: remove incoming live migration blocker

Signed-off-by: Benoit Canet <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

2d1f3c23 04/05/2012 05:29 pm Benoît Canet

qed: honor BDRV_O_INCOMING for incoming live migration

From original commit with Patchwork-id: 31108 by
Stefan Hajnoczi <>

"The QED image format includes a file header bit to mark images dirty.
QED normally checks dirty images on open and fixes inconsistent...

c82954e5 04/05/2012 05:28 pm Benoît Canet

qed: add bdrv_invalidate_cache to be called after incoming live migration

The QED image is reopened to flush metadata and check consistency.

Signed-off-by: Benoit Canet <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

5a67a104 04/05/2012 04:11 pm Marcelo Tosatti

block stream: close unused files and update ->backing_hd

Close the now unused images that were part of the previous backing file
chain and adjust ->backing_hd, backing_filename and backing_format
properly.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=801449...

d68dbee8 04/05/2012 03:54 pm Dong Xu Wang

qed: track dirty flag status

Signed-off-by: Dong Xu Wang <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

47622c44 04/05/2012 03:54 pm Liu Yuan

sheepdog: implement SD_OP_FLUSH_VDI operation

Flush operation is supposed to flush the write-back cache of
sheepdog cluster.

By issuing flush operation, we can assure the Guest of data
reaching the sheepdog cluster storage.

Cc: Kevin Wolf <>...

eb092180 04/05/2012 03:54 pm Liu Yuan

sheepdog: fix send req helpers

We should return if reading of the header fails.

Cc: Kevin Wolf <>
Cc: MORITA Kazutaka <>
Signed-off-by: Liu Yuan <>
Acked-by: MORITA Kazutaka <>...

c088b691 04/05/2012 03:54 pm Zhang Shengju

block/vpc: write checksum back to footer after check

After validation check, the 'checksum' is not written back
to footer, which leave it with zero.

This results in errors while loadding it under Microsoft's
Hyper-V environment, and also errors from utilities like...

3d46a75a 04/05/2012 03:54 pm Paolo Bonzini

vdi: basic conversion to coroutines

Even a basic conversion changing the bdrv_aio_readv/bdrv_aio_writev calls
to bdrv_co_readv/bdrv_co_writev, and callbacks to goto statements can
eliminate a lot of code. This is because error handling is simplified
and indirections through bottom halves can go away....

0c7bfc32 04/05/2012 03:54 pm Paolo Bonzini

vdi: move end-of-I/O handling at the end

The next step is to take code that only triggers after the first operation,
and move it at the end of vdi_aio_read_cb and vdi_aio_write_cb.

Acked-by: Stefan Weil <>
Signed-off-by: Paolo Bonzini <>...

4de659e8 04/05/2012 03:54 pm Paolo Bonzini

vdi: merge aio_read_cb and aio_write_cb into callers

Now inline the former AIO callbacks into vdi_co_readv and vdi_co_writev.
While many cleanups are possible, the code now really looks synchronous.

Acked-by: Stefan Weil <>
Signed-off-by: Paolo Bonzini <>...

bfc45fc1 04/05/2012 03:54 pm Paolo Bonzini

vdi: move aiocb fields to locals

Most of the AIOCB really holds local variables that need to persist
across callback invocation. It can go away now.

Acked-by: Stefan Weil <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

a7a43aa1 04/05/2012 03:54 pm Paolo Bonzini

vdi: leave bounce buffering to block layer

vdi.c really works as if it implemented bdrv_read and bdrv_write. However,
because only vector I/O is supported by the asynchronous callbacks, it
went through extra pain to bounce-buffer the I/O. This can be handled...

4eea78e6 04/05/2012 03:54 pm Paolo Bonzini

vdi: do not create useless iovecs

Reads and writes to the underlying file can also occur with the simple
non-vectored I/O interfaces.

Acked-by: Stefan Weil <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

eb9566d1 04/05/2012 03:54 pm Paolo Bonzini

vdi: change goto to loop

Finally reindent all code and change goto statements to a loop.

Acked-by: Stefan Weil <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

3e914655 04/05/2012 03:54 pm Paolo Bonzini

block: fix streaming/closing race

Streaming can issue I/O while qcow2_close is running. This causes the
L2 caches to become very confused or, alternatively, could cause a
segfault when the streaming coroutine is reentered after closing its
block device. The fix is to cancel streaming jobs when closing their...

9f25eccc 04/05/2012 03:54 pm Paolo Bonzini

block: set job->speed in block_set_speed

There is no need to do this in every implementation of set_speed
(even though there is only one right now).

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

11c9c615 04/05/2012 03:54 pm Dong Xu Wang

qed: image fragmentation statistics

Signed-off-by: Dong Xu Wang <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

3948d1d4 04/05/2012 03:54 pm Kevin Wolf

qcow2: Remove unused parameter in get_cluster_table()

Since everything goes through the cache, callers don't use the L2 table
offset any more.

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

29cdb251 04/05/2012 03:54 pm Paolo Bonzini

block: push recursive flushing up from drivers

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

fb7c8e8a 04/03/2012 11:34 am Stefan Weil

block/curl: Replace usleep by g_usleep

The function usleep is not available for all supported platforms:
at least some versions of MinGW don't support it.

usleep was also declared obsolete by POSIX.1-2001.

The function g_usleep is part of glib2.0, so it is available for...

bf319ece 03/12/2012 04:14 pm Kevin Wolf

qcow2: Factor out count_cow_clusters

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

256900b1 03/12/2012 04:14 pm Kevin Wolf

qcow2: Add qcow2_alloc_clusters_at()

This function allows to allocate clusters at a given offset in the image
file. This is useful if you want to allocate the second part of an area
that must be contiguous.

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

250196f1 03/12/2012 04:14 pm Kevin Wolf

qcow2: Reduce number of I/O requests

If the first part of a write request is allocated, but the second isn't
and it can be allocated so that the resulting area is contiguous, handle
it at once. This is a common case for sequential writes.

After this patch, alloc_cluster_offset() only checks if the clusters are...

14fe292d 03/12/2012 04:14 pm Stefan Hajnoczi

qed: do not evict in-use L2 table cache entries

The L2 table cache reduces QED metadata reads that would be required
when translating LBAs to offsets into the image file. Since requests
execute in parallel it is possible to share an L2 table between multiple...

3cce16f4 03/12/2012 04:14 pm Kevin Wolf

qcow2: Add some tracing

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

259b2173 03/12/2012 04:14 pm Kevin Wolf

qcow2: Add error messages in qcow2_truncate

qemu-img resize has some limitations with qcow2, but the user is only
told that "this image format does not support resize". Quite confusing,
so add some more detailed error_report() calls and change "this image...

75d12341 03/07/2012 03:03 pm Stefan Weil

block/vmdk: Fix warning from splint (comparision of unsigned value)

l1_entry_sectors will never be less than 0.

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

423477e5 02/29/2012 01:48 pm Kevin Wolf

qcow2: Fix build with DEBUG_EXT enabled

Signed-off-by: Kevin Wolf <>

fd29b4bb 02/29/2012 01:48 pm Kevin Wolf

qcow2: Fix offset in qcow2_read_extensions

The spec says that the length of extensions is padded to 8 bytes, not
the offset. Currently this is the same because the header size is a
multiple of 8, so this is only about compatibility with future changes
to the header size....

64ca6aee 02/29/2012 01:48 pm Kevin Wolf

qcow2: Reject too large header extensions

Image files that make qemu-img info read several gigabytes into the
unknown header extensions list are bad. Just fail opening the image
if an extension claims to be larger than the header extension area.

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

f36f3949 02/22/2012 09:23 pm Luiz Capitulino

block: bdrv_eject(): Make eject_flag a real bool

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>
Acked-by: Kevin Wolf <>

24da78db 02/09/2012 05:17 pm Charles Arnold

vpc: Add support for Fixed Disk type

The Virtual Hard Disk Image Format Specification allows for three
types of hard disk formats, Fixed, Dynamic, and Differencing. Qemu
currently only supports Dynamic disks. This patch adds support for
the Fixed Disk format....

ecd880d9 02/09/2012 05:17 pm Kevin Wolf

vpc: Round up image size during fixed image creation

The geometry calculation algorithm from the VHD spec rounds the image
size down if it doesn't exactly match a geometry. During image
conversion, this causes the image to be truncated. For dynamic images,...

e24e49e6 02/09/2012 05:17 pm Kevin Wolf

qcow2: Update whole header at once

In order to switch the backing file, qcow2 issues multiple write
requests that only changed a part of the image header. Any failure after
the first one would leave the header in an corrupted state. With this
patch, the whole header is written at once, so we can't fail in the...

75bab85c 02/09/2012 05:17 pm Kevin Wolf

qcow2: Keep unknown header extension when rewriting header

If we want header extensions to work as compatible extensions, we can't
destroy yet unknown header extensions when rewriting the header (e.g.
for changing the backing file). Save all unknown header extensions in a...

6d1acda8 02/09/2012 05:17 pm MORITA Kazutaka

sheepdog: fix co_recv coroutine context

The co_recv coroutine has two things that will try to enter it:

1. The select(2) read callback on the sheepdog socket.
2. The aio_add_request() blocking operations, including a coroutine
mutex.

This patch fixes it by setting NULL to co_recv before sending data....

6e4f59bd 02/09/2012 05:17 pm Stefan Hajnoczi

qed: replace is_write with flags field

Per-request attributes like read/write are currently implemented as bool
fields in the QEDAIOCB struct. This becomes unwiedly as the number of
attributes grows. For example, the qed_aio_setup() function would have...

0e71be19 02/09/2012 05:17 pm Stefan Hajnoczi

qed: add .bdrv_co_write_zeroes() support

Zero writes are a dedicated interface for writing regions of zeroes into
the image file. If clusters are not yet allocated it is possible to use
an efficient metadata representation which keeps the image file compact...

f9dadc98 02/09/2012 05:17 pm Ronnie Sahlberg

iSCSI: add configuration variables for iSCSI

This patch adds configuration variables for iSCSI to set
initiator-name to use when logging in to the target,
which type of header-digest to negotiate with the target
and username and password for CHAP authentication....

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

block: add support for partial streaming

Add support for streaming data from an intermediate section of the
image chain (see patch and documentation for details).

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

641543b7 01/26/2012 03:49 pm Stefan Weil

block/vdi: Zero unused parts when allocating a new block (fix #919242)

The new block was filled with zero when it was allocated by g_malloc0,
but when it was reused later and only partially used, data from the
previously allocated block were still present and written to the new...

84b0ec02 01/26/2012 03:49 pm Li Zhi Hui

qcow: Return real error code in qcow_open

Signed-off-by: Li Zhi Hui <>
Signed-off-by: Kevin Wolf <>

2b16c9ff 01/26/2012 03:49 pm Li Zhi Hui

qcow: Use bdrv functions to replace file operation

Since common file operation functions lack of error detection and use
much more I/O syscalls, so change them to bdrv series functions and
reduce I/O request.

Signed-off-by: Li Zhi Hui <>...

4f1043b4 01/26/2012 12:45 pm Stefan Hajnoczi

block: add image streaming block job

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

5094a6c0 01/26/2012 12:45 pm Stefan Hajnoczi

block: rate-limit streaming operations

This patch implements rate-limiting for image streaming. If we've
exceeded the bandwidth quota for a 100 ms time slice we sleep the
coroutine until the next slice begins.

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

bd603247 01/26/2012 12:39 pm Gregory Farnum

rbd: wire up snapshot removal and rollback functionality

Signed-off-by: Greg Farnum <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

031380d8 01/26/2012 12:39 pm Stefan Hajnoczi

block: replace unchecked strdup/malloc/calloc with glib

Most of the codebase as been converted to use glib memory allocation
functions. There are still a few instances of malloc/calloc in the
block layer and qemu-io. Replace them, especially since they do not...

6b620ca3 01/13/2012 06:55 pm Paolo Bonzini

prepare for future GPLv2+ relicensing

All files under GPLv2 will get GPLv2+ changes starting tomorrow.
event_notifier.c and exec-obsolete.h were only ever touched by Red Hat
employees and can be relicensed now.

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

8d987346 01/13/2012 12:36 pm Stefan Hajnoczi

vvfat: avoid leaking file descriptor in commit_one_file()

Reported-by: Dr David Alan Gilbert <>
Signed-off-by: Stefan Hajnoczi <>

128aa589 12/22/2011 12:53 pm Paolo Bonzini

move corking functions to osdep.c

Signed-off-by: Paolo Bonzini <>

ae255e52 12/22/2011 12:53 pm Paolo Bonzini

nbd: switch to asynchronous operation

Signed-off-by: Paolo Bonzini <>

d9b09f13 12/22/2011 12:53 pm Paolo Bonzini

nbd: split requests

qemu-nbd has a limit of slightly less than 1M per request. Work
around this in the nbd block driver.

Signed-off-by: Paolo Bonzini <>

ecda3447 12/22/2011 12:53 pm Paolo Bonzini

nbd: allow multiple in-flight requests

Allow sending up to 16 requests, and drive the replies to the coroutine
that did the request. The code is written to be exactly the same as
before this patch when MAX_NBD_REQUESTS == 1 (modulo the extra mutex
and state)....

2c7989a9 12/22/2011 12:53 pm Paolo Bonzini

nbd: add support for NBD_CMD_FLAG_FUA

Signed-off-by: Paolo Bonzini <>

1486d04a 12/22/2011 12:53 pm Paolo Bonzini

nbd: add support for NBD_CMD_FLUSH

Signed-off-by: Paolo Bonzini <>

7a706633 12/22/2011 12:53 pm Paolo Bonzini

nbd: add support for NBD_CMD_TRIM

Signed-off-by: Paolo Bonzini <>

8c5135f9 12/22/2011 12:53 pm Paolo Bonzini

sheepdog: move coroutine send/recv function to generic code

Outside coroutines, avoid busy waiting on EAGAIN by temporarily
making the socket blocking.

The API of qemu_recvv/qemu_sendv is slightly different from
do_readv/do_writev because they do not handle coroutines. It...

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

qcow2: Allow >4 GB VM state

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

Signed-off-by: Kevin Wolf <>

16d2fc00 12/15/2011 01:40 pm Li Zhi Hui

block/cow: Return real error code

Signed-off-by: Li Zhi Hui <>
Signed-off-by: Kevin Wolf <>

91977c2e 12/15/2011 01:40 pm Paolo Bonzini

block: qemu_aio_get does not return NULL

Initially done with the following semantic patch:

rule1
expression E;
statement S;
@@
E = qemu_aio_get (...);
(
- if (E == NULL) { ... } |
- if (E) { <... S ...> }
)

which however missed occurrences in linux-aio.c and posix-aio-compat.c....

28c1202b 12/15/2011 01:40 pm Li Zhi Hui

block/qcow2.c: call qcow2_free_snapshots in the function of qcow2_close

Signed-off-by: Li Zhi Hui <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

b9c53290 12/15/2011 01:40 pm Josh Durgin

rbd: always set out parameter in qemu_rbd_snap_list

The caller expects psn_tab to be NULL when there are no snapshots or
an error occurs. This results in calling g_free on an invalid address.

Reported-by: Oliver Francke <>
Signed-off-by: Josh Durgin <>...

ad54ae80 12/15/2011 01:40 pm Paolo Bonzini

block: bdrv_aio_* do not return NULL

Initially done with the following semantic patch:

rule1
expression E;
statement S;
@@
E =
(
bdrv_aio_readv | bdrv_aio_writev | bdrv_aio_flush | bdrv_aio_discard | bdrv_aio_ioctl
)
(...);
(
- if (E == NULL) { ... }...

3a93113a 12/06/2011 11:56 am Dong Xu Wang

fix typo: delete redundant semicolon

Double semicolons should be single.

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

eb5d5bea 12/05/2011 05:39 pm Anthony Liguori

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

e8ee5e4c 12/05/2011 03:51 pm Stefan Hajnoczi

coroutine: add qemu_co_queue_restart_all()

It's common to wake up all waiting coroutines. Introduce the
qemu_co_queue_restart_all() function to do this instead of looping over
qemu_co_queue_next() in every caller.

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

e94d1387 12/05/2011 03:51 pm Stefan Hajnoczi

cow: use bdrv_co_is_allocated()

Now that bdrv_co_is_allocated() is available we can use it instead of
the synchronous bdrv_is_allocated() interface. This is a follow-up that
Kevin Wolf <> pointed out after applying the series that
introduces bdrv_co_is_allocated()....

b7d5a5b8 12/05/2011 03:51 pm Stefan Hajnoczi

qed: convert to .bdrv_co_is_allocated()

The bdrv_qed_is_allocated() function is a synchronous wrapper around
qed_find_cluster(), which performs the cluster lookup. In order to
convert the synchronous function to a coroutine function we yield
instead of using qemu_aio_wait(). Note that QED's cache is already safe...

f8a2e5e3 12/05/2011 03:51 pm Stefan Hajnoczi

block: convert qcow2, qcow2, and vmdk to .bdrv_co_is_allocated()

The qcow2, qcow, and vmdk block drivers are based on coroutines. They have a
coroutine mutex which protects internal state. We can convert the
.bdrv_is_allocated() function to .bdrv_co_is_allocated() by holding the mutex...

73f703ca 12/05/2011 03:51 pm Stefan Hajnoczi

vvfat: convert to .bdrv_co_is_allocated()

It is trivial to switch from the synchronous .bdrv_is_allocated()
interface to .bdrv_co_is_allocated() since vvfat_is_allocated() does not
block.

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

e850b35a 12/05/2011 03:51 pm Stefan Hajnoczi

vdi: convert to .bdrv_co_is_allocated()

It is trivial to switch from the synchronous .bdrv_is_allocated()
interface to .bdrv_co_is_allocated() since vdi_is_allocated() does not
block.

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

81145834 12/05/2011 03:51 pm Stefan Hajnoczi

cow: convert to .bdrv_co_is_allocated()

The cow block driver does not keep internal state for cluster lookups.
This means it is safe to perform cluster lookups in coroutine context
without risk of race conditions that corrupt internal state.

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

43a0cac4 12/05/2011 03:51 pm Kevin Wolf

qcow2: Fix order of refcount updates in qcow2_snapshot_goto

The refcount updates must be moved so that in the worst case we can get
cluster leaks, but refcounts may never be too low.

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

9a476780 12/05/2011 03:51 pm Kevin Wolf

qcow2: Fix order in qcow2_snapshot_delete

First the snapshot must be deleted and only then the refcounts can be
decreased.

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

e3f652b3 12/05/2011 03:51 pm Kevin Wolf

qcow2: Fix error path in qcow2_snapshot_load_tmp

If the bdrv_read() of the snapshot's L1 table fails, return the right
error code and make sure that the old L1 table is still loaded and we
don't break the BlockDriverState completely.

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