Statistics
| Branch: | Revision:

root / block @ c2271403

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

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

6f321e93 05/18/2011 03:38 pm Stefan Hajnoczi

qed: Periodically flush and clear need check bit

One strategy to limit the startup delay of consistency check when
opening image files is to ensure that the file is marked dirty for as
little time as possible.

QED currently marks the image dirty when the first allocating write...

a1c7273b 05/08/2011 12:02 pm Stefan Weil

Fix typos in comments and code (occured -> occurred and related)

The code changed here is an unused data type name (evt_flush_occurred).

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

ebabb67a 05/06/2011 10:19 am Stefan Weil

Fix typo in code and comments

Replace writeable -> writable

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

d2d979c6 05/03/2011 12:29 pm Nick Thomas

NBD: Avoid leaking a couple of strings when the NBD device is closed

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

19dfc44a 04/27/2011 05:21 pm Stefan Hajnoczi

qed: Fix consistency check on 32-bit hosts

The qed_bytes_to_clusters() function is normally used with size_t
lengths. Consistency check used it with file size length and therefore
failed on 32-bit hosts when the image file is 4 GB or more.

Make qed_bytes_to_clusters() explicitly 64-bit and update consistency...

2d56a546 04/13/2011 01:31 pm Mitnick Lyu

vpc.c: Use get_option_parameter() does the search

Use get_option_parameter() to instead of duplicating the loop, and
use BDRV_SECTOR_SIZE to instead of 512

Signed-off-by: Mitnick Lyu <>
Signed-off-by: Kevin Wolf <>

21df65b6 04/13/2011 01:06 pm Anthony Liguori

qed: Add support for zero clusters

Zero clusters are similar to unallocated clusters except instead of reading
their value from a backing file when one is available, the cluster is always
read as zero.

This implements read support only. At this stage, QED will never write a...

33897dc7 04/07/2011 02:51 pm Nick Thomas

NBD device: Separate out parsing configuration and opening sockets.

We also change the way the file parameter is parsed so IPv6 IP
addresses can be used, e.g.: "drive=nbd:[::1]:5000"

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

4ff9786c 04/03/2011 10:42 pm Stefan Weil

Fix trivial "endianness bugs"

Replace endianess -> endianness.

Signed-off-by: Stefan Weil <>
Signed-off-by: Aurelien Jarno <>

8cffde73 04/01/2011 11:23 pm Michael Tokarev

get rid of private bitmap functions in block/sheepdog.c, use generic ones

qemu now has generic bitmap functions,
so don't redefine them in sheepdog.c,
use common header instead. A small cleanup.

Here's only one function which is actually
used in sheepdog and gets replaced with...

40a892b7 03/15/2011 02:21 pm Stefan Weil

block/vdi: Don't ignore immediate read/write failures

This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640cadd
which fixed qcow2:

Returning -EIO is far from optimal, but at least it's an error code.

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

5614c188 03/15/2011 02:21 pm Stefan Weil

block/qcow: Don't ignore immediate read/write and other failures

This patch is similar to 171e3d6b9997c98a97d0c525867f7cd9b640cadd
which fixed qcow2:

Returning -EIO is far from optimal, but at least it's an error code.

In addition to read/write failures, -EIO is also returned when...

16fde5f2 02/10/2011 02:24 pm Kevin Wolf

qcow2: Fix order in L2 table COW

When copying L2 tables (this happens only with internal snapshots), the order
wasn't completely safe, so that after a crash you could end up with a L2 table
that has too low refcount, possibly leading to corruption in the long run....

10b758e8 02/10/2011 02:23 pm Kevin Wolf

qed: Report error for unsupported features

Instead of just returning -ENOTSUP, generate a more detailed error.

Unfortunately we don't have a helpful text for features that we don't know yet,
so just print the feature mask. It might be useful at least if someone asks for...

e8cdcec1 02/10/2011 02:23 pm Kevin Wolf

qcow2: Report error for version > 2

The qcow2 driver is now declared responsible for any QCOW image that has
version 2 or greater (before this, version 3 would be detected as raw).

For everything newer than version 2, an error is reported.

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

e0d9c6f9 02/10/2011 02:23 pm Chunqiang Tang

QCOW2: bug fix - read base image beyond its size

This patch fixes the following bug in QCOW2. For a QCOW2 image that is larger
than its base image, when handling a read request straddling over the end of the
base image, the QCOW2 driver attempts to read beyond the end of the base image...

3ab4c7e9 02/10/2011 02:23 pm Kevin Wolf

qcow2: Fix error handling for immediate backing file read failure

Requests could return success even though they failed when bdrv_aio_readv
returned NULL for a backing file read.

Reported-by: Chunqiang Tang <>
Signed-off-by: Kevin Wolf <>

8af36488 02/10/2011 02:23 pm Kevin Wolf

qcow2: Fix error handling for reading compressed clusters

When reading a compressed cluster failed, qcow2 falsely returned success.

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

4f3669ea 02/07/2011 11:07 am Stefan Weil

block/vdi: Fix wrong size in conditionally used memset, memcmp

Error report from cppcheck:
block/vdi.c:122: error: Using sizeof for array given as function argument returns the size of pointer.
block/vdi.c:128: error: Using sizeof for array given as function argument returns the size of pointer....

e1a7107f 02/07/2011 10:44 am Kevin Wolf

qcow2: Really use cache=unsafe for image creation

For cache=unsafe we also need to set BDRV_O_CACHE_WB, otherwise we have some
strange unsafe writethrough mode.

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

1869a653 01/31/2011 11:05 am Blue Swirl

qcow2-refcount: remove write-only variables

Variables l2_modified and l2_size are not really used, remove them.
Spotted by GCC 4.6.0:
CC block/qcow2-refcount.o
/src/qemu/block/qcow2-refcount.c: In function 'qcow2_update_snapshot_refcount':
/src/qemu/block/qcow2-refcount.c:708:37: error: variable 'l2_modified' set but not used [-Werror=unused-but-set-variable]...

bf595021 01/31/2011 11:03 am Jes Sorensen

Reorganize struct Qcow2Cache for better struct packing

Move size after the two pointers in struct Qcow2Cache to get better
packing of struct elements on 64 bit architectures.

Signed-off-by: Jes Sorensen <>
Signed-off-by: Kevin Wolf <>

b4447363 01/31/2011 11:03 am MORITA Kazutaka

sheepdog: support creating images on remote hosts

This patch parses the input filename in sd_create(), and enables us
specifying a target server to create sheepdog images.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

5ea929e3 01/31/2011 11:03 am Kevin Wolf

qcow2: Add bdrv_discard support

This adds a bdrv_discard function to qcow2 that frees the discarded clusters.
It does not yet pass the discard on to the underlying file system driver, but
the space can be reused by future writes to the image.

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

0d09c797 01/31/2011 11:03 am Stefan Hajnoczi

qed: Images with backing file do not require QED_F_NEED_CHECK

The consistency check on open is necessary in order to fix inconsistent
table offsets left as a result of a crash mid-operation. Images with a
backing file actually flush before updating table offsets and are...

1b40bbd1 01/31/2011 11:03 am Kevin Wolf

raw-win32: Fix bdrv_flush return value

Signed-off-by: Kevin Wolf <>

c743849b 01/24/2011 05:41 pm Stefan Hajnoczi

qed: Refuse to create images on block devices

QED relies on the underlying filesystem to extend the file and maintain
its size. Check that images are not created on a block device.

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

29c1a730 01/24/2011 05:41 pm Kevin Wolf

qcow2: Use QcowCache

Use the new functions of qcow2-cache.c for everything that works on refcount
block and L2 tables.

Signed-off-by: Kevin Wolf <>

3de0a294 01/24/2011 05:41 pm Kevin Wolf

qcow2: Batch flushes for COW

qcow2 calls bdrv_flush() after performing COW in order to ensure that the
L2 table change is never written before the copy is safe on disk. Now that the
L2 table is cached, we can wait with flushing until we write out the next L2...

49381094 01/24/2011 12:08 pm Kevin Wolf

qcow2: Add QcowCache

This adds some new cache functions to qcow2 which can be used for caching
refcount blocks and L2 tables. When used with cache=writethrough they work
like the old caching code which is spread all over qcow2, so for this case we
have merely a cleanup....

653df36b 01/24/2011 12:08 pm Aurelien Jarno

qcow2: fix unaligned access

cpu_to_be64w() is called with an obviously non-aligned pointer. Use
cpu_to_be64wu() instead. It fixes unaligned accesses errors on IA64
hosts.

Cc: Kevin Wolf <>
Signed-off-by: Aurelien Jarno <>...

f0ff243a 01/12/2011 09:49 pm Blue Swirl

vpc: fix a file descriptor leak

Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/block/vpc.c:524]: (error) Resource leak: fd

Signed-off-by: Blue Swirl <>

08089edc 01/12/2011 09:48 pm Blue Swirl

vvfat: fix a file descriptor leak

Fix a file descriptor leak, reported by cppcheck:
[/src/qemu/block/vvfat.c:759]: (error) Resource leak: dir

Signed-off-by: Blue Swirl <>

6d85a57e 12/17/2010 05:15 pm Jes Sorensen

Add proper -errno error return values to qcow2_open()

In addition this adds missing braces to the function to be consistent
with the coding style.

Signed-off-by: Jes Sorensen <>
Signed-off-by: Kevin Wolf <>

7c80ab3f 12/17/2010 05:15 pm Jes Sorensen

block/qcow2.c: rename qcow_ functions to qcow2_

It doesn't really make sense for functions in qcow2.c to be named
qcow_ so convert the names to match correctly.

Signed-off-by: Jes Sorensen <>
Signed-off-by: Kevin Wolf <>

75411d23 12/17/2010 05:11 pm Stefan Hajnoczi

qed: Add QEMU Enhanced Disk image format

This patch introduces the qed on-disk layout and implements image
creation. Later patches add read/write and other functionality.

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

298800ca 12/17/2010 05:11 pm Stefan Hajnoczi

qed: Table, L2 cache, and cluster functions

This patch adds code to look up data cluster offsets in the image via
the L1/L2 tables. The L2 tables are writethrough cached in memory for
performance (each read/write requires a lookup so it is essential to
cache the tables)....

eabba580 12/17/2010 05:11 pm Stefan Hajnoczi

qed: Read/write support

This patch implements the read/write state machine. Operations are
fully asynchronous and multiple operations may be active at any time.

Allocating writes lock tables to ensure metadata updates do not
interfere with each other. If two allocating writes need to update the...

01979a98 12/17/2010 05:11 pm Stefan Hajnoczi

qed: Consistency check support

This patch adds support for the qemu-img check command. It also
introduces a dirty bit in the qed header to mark modified images as
needing a check. This bit is cleared when the image file is closed
cleanly.

If an image file is opened and it has the dirty bit set, a consistency...

dce512de 12/17/2010 05:11 pm Christoph Hellwig

raw-posix: add discard support

Add support to discard blocks in a raw image residing on an XFS filesystem
by calling the XFS_IOC_UNRESVSP64 ioctl to punch holes. Support for other
hole punching mechanisms can be added when they become available.

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