Statistics
| Branch: | Revision:

root / block @ 57e69b7d

# Date Author Comment
57e69b7d 03/27/2010 01:00 pm Kevin Wolf

raw-posix: Better error return values for hdev_create

Now that we output an error message according to the returned error code in
qemu-img, let's return the real error codes. "Input/output error" for
everything isn't helpful.

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

43dc2a64 03/18/2010 08:41 pm Blue Swirl

Replace assert(0) with abort() or cpu_abort()

When building with -DNDEBUG, assert(0) will not stop execution
so it must not be used for abnormal termination.

Use cpu_abort() when in CPU context, abort() otherwise.

Signed-off-by: Blue Swirl <>

a6c6f76c 03/13/2010 04:18 pm Blue Swirl

Fix build with -DNDEBUG in CFLAGS

Signed-off-by: Blue Swirl <>

bef57da5 03/09/2010 07:23 pm Juan Quintela

qcow2: return errno instead of -1

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

98c2b2f4 03/09/2010 07:23 pm Juan Quintela

qcow: return errno instead of -1

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

b781cce5 03/09/2010 07:23 pm Juan Quintela

vmdk: return errno instead of -1

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

53c2e716 03/09/2010 07:23 pm Juan Quintela

vmdk: make vmdk_snapshot_create return -errno

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

a161329b 03/09/2010 07:23 pm Juan Quintela

vmdk: fix double free

fail_gd error case would also free rgd_buf that was already freed

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

3829cb46 03/09/2010 07:23 pm Juan Quintela

vmdk: share cleanup code

cleanup code is identical for error/success cases. Only difference
are goto labels.

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

48b66db9 03/09/2010 07:22 pm Juan Quintela

cow: return errno instead of -1

Remove not needed ret = 0 assignment.

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

05121aed 02/23/2010 09:23 pm Kevin Wolf

qcow2: Factor next_refcount_table_size out

When the refcount table grows, it doesn't only grow by one entry but reserves
some space for future refcount blocks. The algorithm to calculate the number of
entries stays the same with the fixes, so factor it out before replacing the...

92dcb59f 02/23/2010 09:23 pm Kevin Wolf

qcow2: Rewrite alloc_refcount_block/grow_refcount_table

The current implementation of alloc_refcount_block and grow_refcount_table has
fundamental problems regarding error handling. There are some places where an
I/O error means that the image is going to be corrupted. I have found that the...

746c3cb5 02/23/2010 09:23 pm Kevin Wolf

qcow2: More checks for qemu-img check

Implement some more refcount block related checks

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

6f745bda 02/23/2010 09:23 pm Kevin Wolf

qcow2: Fix image creation regression

When checking for errors, commit db89119d compares with the wrong values,
failing image creation even when there was no error. Additionally, if an
error has occured, we can't preallocate the image (it's likely broken)....

4805bb66 02/19/2010 11:53 pm Kevin Wolf

qcow2: Fix access after end of array

If a write requests crosses a L2 table boundary and all clusters until the
end of the L2 table are usable for the request, we must not look at the next
L2 entry because we already have arrived at the end of the array....

6265eb26 02/10/2010 10:00 pm Jim Meyering

don't dereference NULL after failed strdup

Most of these are obvious NULL-deref bug fixes, for example,
the ones in these files:

block/curl.c
net.c
slirp/misc.c

and the first one in block/vvfat.c.
The others in block/vvfat.c may not lead to an immediate segfault, but I...

f4f0d391 02/10/2010 07:56 pm Kevin Wolf

qcow2: Fix signedness bugs

Checking for return codes < 0 isn't really going to work with unsigned
types. Use signed types instead.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

48a402e6 02/08/2010 11:44 am malc

block/curl: %Z is not a valid conversion specifier

Signed-off-by: malc <>

d0f2c4c6 02/07/2010 01:03 am malc

Do not use dprintf

dprintf is already claimed by POSIX1, and on at least one system
is implemented as a macro

[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html

Signed-off-by: malc <>

053965c7 01/27/2010 12:41 am Kevin Wolf

block/raw-posix: Abort on pread beyond end of non-growable file

This shouldn't happen under any normal circumstances. However, it looks like
it's possible to achieve this with corrupted images. Without this patch
raw_pread is hanging in an endless loop in such cases....

f8a83245 01/27/2010 12:41 am Herve Poussineau

win32: pair qemu_memalign() with qemu_vfree()

Win32 suffers from a very big memory leak when dealing with SCSI devices.
Each read/write request allocates memory with qemu_memalign (ie
VirtualAlloc) but frees it with qemu_free (ie free).
Pair all qemu_memalign() calls with qemu_vfree() to prevent such leaks....

7b88e48b 01/26/2010 11:45 pm Christoph Hellwig

qcow2: rename two QCowAIOCB members

The n member is not very descriptive and very hard to grep, rename it to
cur_nr_sectors to better indicate what it is used for. Also rename
nb_sectors to remaining_sectors as that is what it is used for.

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

9a2d77ad 01/26/2010 11:42 pm Christoph Hellwig

block: kill BDRV_O_CREAT

The BDRV_O_CREAT option is unused inside qemu and partially duplicates
the bdrv_create method. Remove it, and the -C option to qemu-io which
isn't used in qemu-iotests anyway.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

058fc8c7 01/26/2010 11:42 pm Naphtali Sprei

Ask for read-write permissions when opening files

Found some places that seems needs this explicitly, now that
read-write is not the default.

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

0a7fc983 01/26/2010 11:42 pm Naphtali Sprei

Read-only device changed to opens it's file for read-only.

Signed-off-by: Naphtali Sprei <>
Signed-off-by: Anthony Liguori <>

31f38120 01/26/2010 10:59 pm Kirill A. Shutemov

block/cow.c: fix warnings with _FORTIFY_SOURCE

CC block/cow.o
cc1: warnings being treated as errors
block/cow.c: In function 'cow_create':
block/cow.c:251: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/cow.c:253: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...

3e1a8134 01/26/2010 10:59 pm Kirill A. Shutemov

block/qcow.c: fix warnings with _FORTIFY_SOURCE

CC block/qcow.o
cc1: warnings being treated as errors
block/qcow.c: In function 'qcow_create':
block/qcow.c:804: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow.c:806: error: ignoring return value of 'write', declared with attribute warn_unused_result...

1640366c 01/26/2010 10:59 pm Kirill A. Shutemov

block/vmdk.o: fix warnings with _FORTIFY_SOURCE

CC block/vmdk.o
cc1: warnings being treated as errors
block/vmdk.c: In function 'vmdk_snapshot_create':
block/vmdk.c:236: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...

2dedf83e 01/26/2010 10:59 pm Kirill A. Shutemov

block/vvfat.c: fix warnings with _FORTIFY_SOURCE

CC block/vvfat.o
cc1: warnings being treated as errors
block/vvfat.c: In function 'commit_one_file':
block/vvfat.c:2259: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...

db89119d 01/26/2010 10:59 pm Kirill A. Shutemov

block/qcow2.c: fix warnings with _FORTIFY_SOURCE

CC block/qcow2.o
cc1: warnings being treated as errors
block/qcow2.c: In function 'qcow_create2':
block/qcow2.c:829: error: ignoring return value of 'write', declared with attribute warn_unused_result
block/qcow2.c:838: error: ignoring return value of 'write', declared with attribute warn_unused_result...

fb8fa77c 01/26/2010 10:59 pm Kevin Wolf

qcow2: Fix error handling in qcow2_grow_l1_table

Return the appropriate error value instead of always using EIO. Don't free the
L1 table on errors, we still need it.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

1d36e3aa 01/26/2010 10:59 pm Kevin Wolf

qcow2: Fix error handling in qcow_save_vmstate

Don't assume success but pass the bdrv_pwrite return value on.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

1e3e8f1a 01/26/2010 10:59 pm Kevin Wolf

qcow2: Return 0/-errno in get_cluster_table

Switching to 0/-errno allows it to distinguish different error cases.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

148da7ea 01/26/2010 10:59 pm Kevin Wolf

qcow2: Return 0/-errno in qcow2_alloc_cluster_offset

Returning 0/-errno allows it to distingush different errors classes. The
cluster offset of newly allocated clusters is now returned in the QCowL2Meta
struct.

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

f2b7c8b3 01/26/2010 10:59 pm Kevin Wolf

qcow2: Fix error handling in grow_refcount_table

Return the appropriate error code instead of -EIO.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

09508d13 01/26/2010 10:59 pm Kevin Wolf

qcow2: Improve error handling in update_refcount

If update_refcount fails, try to undo any changes made so far to avoid
inconsistencies in the image file.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

7322afe7 01/26/2010 10:59 pm Kevin Wolf

qcow2: Allow updating no refcounts

There's absolutely no problem with updating the refcounts of 0 clusters.
At least snapshot code is doing this and would fail once the result of
update_refcount isn't ignored any more.

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

db3a964f 01/26/2010 10:59 pm Kevin Wolf

qcow2: Don't ignore update_refcount return value

update_refcount can return errors that need to be handled by the callers.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

5d757b56 01/26/2010 10:59 pm Kevin Wolf

qcow2: Don't ignore qcow2_alloc_clusters return value

Now that qcow2_alloc_clusters can return error codes, we must handle them in
the callers of qcow2_alloc_clusters.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

f5edb014 01/20/2010 04:25 pm Naphtali Sprei

Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.

Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...

3baf720e 01/20/2010 12:31 am Cole Robinson

raw-posix: Detect CDROM via ioctl on linux

Current CDROM detection is hardcoded based on source file name.
Make this smarter on linux by attempting a CDROM specific ioctl.

This makes '-cdrom /dev/sr0' succeed with no media present.

v2:
Give ioctl check higher priority than filename check....

2ebf7c4b 01/20/2010 12:31 am Cole Robinson

raw-posix: Detect legacy floppy via ioctl on linux

Current legacy floppy detection is hardcoded based on source file
name. Make this smarter on linux by attempting a floppy specific
ioctl.

v2:
Give ioctl check higher priority than filename check
s/IDE/legacy/...

756e6736 01/14/2010 01:14 am Kevin Wolf

block: Add bdrv_change_backing_file

Introduce the functions needed to change the backing file of an image. The
function is implemented for qcow2.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

f7dcfac0 01/14/2010 01:14 am Amit Shah

qcow2-refcount: remove dead assignment

clang-analyzer points out a redundant assignment.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

f8012c13 01/14/2010 01:14 am Kevin Wolf

qcow/qcow2: implement bdrv_aio_flush

Now that we do not have to flush the backing device anymore implementing
the bdrv_aio_flush method for image formats is trivial.

[hch: forward ported to qemu mainline from a product tree]

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

1559ca00 01/11/2010 09:41 pm Christoph Hellwig

dmg: fix ->open failure

Currently the dmg image format driver simply opens the images as raw
if any kind of failure happens. This is contrarty to the behaviour
of all other image formats which just return an error and let the
block core deal with it.

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

95a2f9bc 01/08/2010 05:58 pm François Revol

block/vdi: allow disk sizes not multiple of block size

The disk image I created from my old laptop disk with VBoxManage
internalcommand converthd obviously was not a multiple of 1MB as when
created from scratch. This fixes QEMU refusing it. We still require the...

ecbe1576 12/25/2009 09:27 pm Blue Swirl

block/bochs: improve format checking

Signed-off-by: Blue Swirl <>

00ccf932 12/25/2009 08:19 pm Kirill A. Shutemov

block/bochs.c: fix warning with _FORTIFY_SOURCE

CC    block/bochs.o
cc1: warnings being treated as errors
block/bochs.c: In function 'seek_to_sector':
block/bochs.c:202: error: ignoring return value of 'read', declared with attribute warn_unused_result...
702ef63f 12/03/2009 07:45 pm Kevin Wolf

qcow2: Fix some more qemu_malloc fallout

Oh joy...

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

12c09b8c 12/03/2009 07:45 pm Kevin Wolf

qemu-img: There is more than one host device driver

I haven't heard yet of anyone using qemu-img to copy an image to a real floppy,
but it's a valid use case.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

40ff6d7e 12/03/2009 07:45 pm Kevin Wolf

Don't leak file descriptors

We're leaking file descriptors to child processes. Set FD_CLOEXEC on file
descriptors that don't need to be passed to children to stop this misbehaviour.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

e1c7f0e3 12/03/2009 07:45 pm Kevin Wolf

qcow2: Store exact backing format length

Currently qcow2 unnecessarily rounds up the length of the backing format string
to the next multiple of 8. At the same time, the array in BlockDriverState can
only hold 15 characters, so in effect backing formats with 9 characters or more...

a167ba50 11/29/2009 07:00 pm Aurelien Jarno

Add support for GNU/kFreeBSD

Signed-off-by: Aurelien Jarno <>

c34d2451 11/12/2009 07:23 pm David Woodhouse

Fix 32-bit overflow in parallels image support

Signed-off-by: David Woodhouse <>
Signed-off-by: Anthony Liguori <>

d191d12d 11/09/2009 04:43 pm Stefan Weil

qcow2: Allow qcow2 disk images with size zero

Images with disk size 0 may be used for
VM snapshots, but not to save normal block data.

It is possible to create such images using
qemu-img, but opening them later fails.

So even "qemu-img info image.qcow2" is not...

1e5b9d2f 10/30/2009 03:39 pm Kevin Wolf

Remove aio_ctx from paio_* interface

The context parameter in paio_submit isn't used anyway, so there is no reason
why block drivers should need to remember it. This also avoids passing a Linux
AIO context to paio_submit (which doesn't do any harm as long as the parameter...

8febfa26 10/27/2009 07:28 pm Kevin Wolf

Add qemu_aio_process_queue()

We'll leave some AIO completions unhandled when we can't call the callback.
qemu_aio_process_queue() is used later to run any callbacks that are left and
can be run then.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

72ecf02d 10/27/2009 07:28 pm Kevin Wolf

Revert "qcow2: Bring synchronous read/write back to life"

It was merely a workaround and the real fix is done now.
This reverts commit ef845c3bf421290153154635dc18eaa677cecb43.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

c5baaa48 10/27/2009 07:28 pm Kevin Wolf

qcow2: Fix grow_refcount_table error handling

In case of failure, we haven't increased the refcount for the newly allocated
cluster yet. Therefore we must not free the cluster or its refcount will become
negative (and endless recursion is possible).

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

d2e46345 10/27/2009 07:28 pm Kevin Wolf

raw/linux-aio: Also initialize POSIX AIO

When using Linux AIO raw still falls back to POSIX AIO sometimes, so we should
initialize it.

Not initializing it happens to work if POSIX AIO is used by another drive, or
if the format is not specified (probing the format uses POSIX AIO) or by pure...

ef845c3b 10/15/2009 05:32 pm Kevin Wolf

qcow2: Bring synchronous read/write back to life

When the synchronous read and write functions were dropped, they were replaced
by generic emulation functions. Unfortunately, these emulation functions don't
provide the same semantics as the original functions did....

0b4ce02e 10/05/2009 10:20 pm Kevin Wolf

block/raw: Add create_options for host_device

Today host_devices have a create function, so they also need a create_options
field to prevent qemu-img from complaining.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

80ee15a6 10/05/2009 05:32 pm Kevin Wolf

qcow2: Increase maximum cluster size to 2 MB

This patch increases the maximum qcow2 cluster size to 2 MB. Starting with 128k
clusters, L2 tables span 2 GB or more of virtual disk space, causing 32 bit
truncation and wraparound of signed integers. Therefore some variables need to...

ee682d27 10/04/2009 02:24 pm Stefan Weil

Check availability of uuid header / library

If available, the Universally Unique Identifier library
is used by the vdi block driver.

Other parts of QEMU (vl.c) could also use it.

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

c227f099 10/02/2009 12:12 am Anthony Liguori

Revert "Get rid of _t suffix"

In the very least, a change like this requires discussion on the list.

The naming convention is goofy and it causes a massive merge problem. Something
like this must be presented on the list first so people can provide input...

99a0949b 10/01/2009 09:45 pm malc

Get rid of _t suffix

Some not so obvious bits, slirp and Xen were left alone for the time
being.

Signed-off-by: malc <>

6ab00cee 09/30/2009 09:45 pm Michael S. Tsirkin

vvfat: fix coding style nit

Put space between = and & when taking a pointer,
to avoid confusion with old-style "&=".

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Blue Swirl <>

a2a45a26 09/12/2009 03:36 pm Blue Swirl

Fix signedness warnings on OpenSolaris

Signed-off-by: Blue Swirl <>

72cf2d4f 09/12/2009 10:36 am Blue Swirl

Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...

6f1953c4 09/11/2009 06:19 pm Christoph Hellwig

block: use fdatasync instead of fsync if possible

If we are flushing the caches for our image files we only care about the
data (including the metadata required for accessing it) but not things
like timestamp updates. So try to use fdatasync instead of fsync to...

b2e12bc6 09/11/2009 06:19 pm Christoph Hellwig

block: add aio_flush operation

Instead stalling the VCPU while serving a cache flush try to do it
asynchronously. Use our good old helper thread pool to issue an
asynchronous fdatasync for raw-posix. Note that while Linux AIO
implements a fdatasync operation it is not useful for us because...

ea80b906 09/10/2009 01:31 am Kevin Wolf

qcow2: Fix metadata preallocation

The wrong version of the preallocation patch has been applied, so this is the
remaining diff.

We can't use truncate to grow the image file to the right size because we don't
know if metadata has been written after the last data cluster. In this case...

f214978a 09/10/2009 01:31 am Kevin Wolf

qcow2: Order concurrent AIO requests on the same unallocated cluster

When two AIO requests write to the same cluster, and this cluster is
unallocated, currently both requests allocate a new cluster and the second one
merges the first one when it is completed. This means an cluster allocation, a...

cc2040f8 09/09/2009 10:57 pm Stefan Weil

Fix spelling in comment.

The company which made Virtual PC was Connectix.
They use the magic string "conectix" in their disk images.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

2000cbc5 08/29/2009 04:37 pm Blue Swirl

Fix gcc 3 warning about uninitialized variable

If nb_sectors is 0, cluster_offset will not be initialized.

Signed-off-by: Blue Swirl <>

e44bd6fc 08/28/2009 04:57 pm Stefan Weil

Don't compile aio code if CONFIG_LINUX_AIO is undefined

This patch fixes linker errors when building QEMU without Linux AIO support.

It is based on suggestions from malc and Kevin Wolf.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

9ef91a67 08/28/2009 04:30 am Christoph Hellwig

raw-posix: refactor AIO support

Currently the raw-posix.c code contains a lot of knowledge about the
asynchronous I/O scheme that is mostly implemented in posix-aio-compat.c.
All this code does not really belong here and is getting a bit in the
way of implementing native AIO on Linux....

5c6c3a6c 08/28/2009 04:30 am Christoph Hellwig

raw-posix: add Linux native AIO support

Now that do have a nicer interface to work against we can add Linux native
AIO support. It's an extremly thing layer just setting up an iocb for
the io_submit system call in the submission path, and registering an...

a35e1c17 08/28/2009 04:30 am Kevin Wolf

qcow2: Metadata preallocation

This introduces a qemu-img create option for qcow2 which allows the metadata to
be preallocated, i.e. clusters are reserved in the refcount table and L1/L2
tables, but no data is written to them. Metadata is quite small, so this...

6eea90eb 08/28/2009 03:33 am Stefan Weil

block/vdi.c: Fix several bugs

  • The code for option '-static' was wrong, so image creation
    always created static images.
  • Static images created with qemu-img did not set header entry
    blocks_allocated.
  • The size of the block map must be rounded to the next multiple...
5ec4d682 08/24/2009 04:46 pm Nathan Froyd

eliminate errors about unused results in block/vpc.c

These errors come up when compiling with gcc-4.3.3 and some older headers:

/scratch/froydnj/qemu.git/block/vpc.c: In function 'vpc_create':
/scratch/froydnj/qemu.git/block/vpc.c:514: error: value computed is not used...

4dd75c70 08/24/2009 04:46 pm Christoph Hellwig

make pthreads mandatory

As requested by Anthony make pthreads mandatory. This means we will always
have AIO available on posix hosts, and it will also allow enabling the I/O
thread unconditionally once it's ready.

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

1786dc15 08/15/2009 02:33 pm Blue Swirl

Use pstrcpy to avoid OpenBSD linker warnings

Signed-off-by: Blue Swirl <>

9aebd98a 08/10/2009 09:05 pm Stefan Weil

Add new block driver for the VDI format (only aio supported)

This is a new block driver written from scratch
to support the VDI format in QEMU.

VDI is the native format used by Innotek / SUN VirtualBox.

Latest changes:

  • stripped down version
    (code for synchronous operations and experimental code removed)...
df3cee1a 08/01/2009 01:13 pm Blue Swirl

Fix Sparse warning about "expression using sizeof on a function"

Signed-off-by: Blue Swirl <>

71e72a19 07/27/2009 10:09 pm Juan Quintela

rename HOST_BSD to CONFIG_BSD

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

b171271a 07/22/2009 06:58 pm Kevin Wolf

vmdk: Fix backing file handling

Instead of storing the backing file in its own BlockDriverState, VMDK uses the
BlockDriverState of the raw image file it opened. This is wrong and breaks
functions that access the backing file or protocols. This fix replaces all...

0bf9e31a 07/20/2009 08:19 pm Blue Swirl

Fix most warnings (errors with -Werror) when debugging is enabled

I used the following command to enable debugging:
perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * /* *//*

Signed-off-by: Blue Swirl <>

1e37d059 07/17/2009 01:28 am Stefan Weil

raw-posix: Handle errors in raw_create

In qemu-iotests, some large images are created using qemu-img.

Without checks for errors, qemu-img will just create an
empty image, and later read / write tests will fail.

With the patch, failures during image creation are detected...

45566e9c 07/16/2009 04:28 pm Christoph Hellwig

replace bdrv_{get, put}_buffer with bdrv_{load, save}_vmstate

The VM state offset is a concept internal to the image format. Replace
the old bdrv_{get,put}_buffer method that require an index into the
image file that is constructed from the VM state offset and an offset...

c53ffce9 07/10/2009 09:44 pm Kevin Wolf

qcow1: Fix qcow_aio_writev

Pass is_write = 1 to qcow_aio_setup when writing.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

3f6a3ee5 07/10/2009 09:44 pm Kevin Wolf

qcow2: Fix L1 table memory allocation

Contrary to what one could expect, the size of L1 tables is not cluster
aligned. So as we're writing whole sectors now instead of single entries,
we need to ensure that the L1 table in memory is large enough; otherwise...

1c27a8b3 07/10/2009 12:58 am G 3

Substitute O_DSYNC with O_SYNC or O_FSYNC when needed.

Signed-off-by: John Arbuckle <>
Signed-off-by: Anthony Liguori <>

c76f4952 07/10/2009 12:06 am Nolan

Allow adjustment of http block device's readahead size, via a new
":readahead=###:" suffix.

Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
Signed-off-by: Anthony Liguori <>

1cec71e3 07/10/2009 12:06 am Anthony Liguori

Revert "support colon in filenames"

This reverts commit 707c0dbc97cddfe8d2441b8259c6c526d99f2dd8.

Signed-off-by: Anthony Liguori <>

0aa217e4 07/10/2009 12:06 am Kevin Wolf

qcow2: Make cache=writethrough default

The performance of qcow2 has improved meanwhile, so we don't need to
special-case it any more. Switch the default to write-through caching
like all other block drivers.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

22afa7b5 06/29/2009 10:18 pm Kevin Wolf

block-raw: Allow pread beyond the end of growable images

When using O_DIRECT, qcow2 snapshots didn't work any more for me. In the
process of creating the snapshot, qcow2 tries to pwrite some new information
(e.g. new L1 table) which will often end up being after the old end of the...

3b88e52b 06/29/2009 10:18 pm Kevin Wolf

qcow2: Cache refcount blocks during snapshot creation

The really time consuming part of snapshotting is to adjust the reference count
of all clusters. Currently after each adjusted cluster the refcount block is
written to disk.

Don't write each single byte immediately to disk but cache all writes to the...

707c0dbc 06/29/2009 09:50 pm Ram Pai

support colon in filenames

Problem: It is impossible to feed filenames with the character colon because
qemu interprets such names as a protocol. For example filename scsi:0, is
interpreted as a protocol by name "scsi".

This patch allows user to espace colon characters. For example the above...