Statistics
| Branch: | Revision:

root / block @ ad32e9c0

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

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

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

block: add discard support

Add a new bdrv_discard method to free blocks in a mapping image, and a new
drive property to set the granularity for these discard. If no discard
granularity support is set discard support is disabled.

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

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

f27aaf4b 12/14/2010 04:44 pm Christian Brunner

ceph/rbd block driver for qemu-kvm

RBD is an block driver for the distributed file system Ceph
(http://ceph.newdream.net/). This driver uses librados (which is part
of the Ceph server) for direct access to the Ceph object store and is
running entirely in userspace (Yehuda also wrote a driver for the...

11a3cb81 11/26/2010 08:02 pm Christoph Hellwig

raw-posix: raw_pwrite comment fixup

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

80465c50 11/24/2010 06:31 pm Kevin Wolf

block: Remove unused s->hd in various drivers

All drivers use bs->file instead of s->hd for quite a while now, so it's time
to remove s->hd.

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

cfd07e7a 11/07/2010 05:10 pm Blue Swirl

Fix win32 build

Fix a return value change missed by
205ef7961f781496366e0a93a4ec621ad3724bd7.

Signed-off-by: Blue Swirl <>

1c02e2a1 11/04/2010 02:54 pm Kevin Wolf

qcow2: Invalidate cache after failed read

The cache content may be destroyed after a failed read, better not use it any
more.

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

a3133586 11/04/2010 02:54 pm Blue Swirl

block: avoid a warning on 64 bit hosts with long as int64_t

When building on a 64 bit host which uses 'long' for int64_t,
GCC emits a warning:
CC block/blkverify.o
/src/qemu/block/blkverify.c: In function `blkverify_verify_readv':
/src/qemu/block/blkverify.c:304: warning: long long int format, long...

205ef796 11/04/2010 01:52 pm Kevin Wolf

block: Allow bdrv_flush to return errors

This changes bdrv_flush to return 0 on success and -errno in case of failure.
It's a requirement for implementing proper error handle in users of bdrv_flush.

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

4a411185 11/04/2010 01:52 pm Kevin Wolf

vpc: Implement bdrv_flush

Signed-off-by: Kevin Wolf <>

21bcc590 10/26/2010 05:50 pm Anthony Liguori

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

c57c846a 10/23/2010 06:24 pm Blue Swirl

qemu-timer: move commonly used timer code to qemu-timer-common

Move timer init functions to a new file, qemu-timer-common.c. Make other
critical timer functions inlined to preserve performance in
qemu-timer.c, also move muldiv64() (used by the inline functions)...

72893756 10/22/2010 03:49 pm Stefan Hajnoczi

qcow2: Support exact L1 table growth

The L1 table grow operation includes a size calculation that bumps up
the new L1 table size in order to anticipate the size needs of vmstate
data. This helps reduce the number of times that the L1 table has to be
grown when vmstate data is appended....

a9420734 10/22/2010 03:49 pm Kevin Wolf

qcow2: Simplify image creation

Instead of doing lots of magic for setting up initial refcount blocks and stuff
create a minimal (inconsistent) image, open it and initialize the rest with
regular qcow2 functions.

This is a complete rewrite of the image creation function. The old...

9b036055 10/22/2010 03:49 pm Kevin Wolf

qcow2: Remove old image creation function

They have been #ifdef'd out by the previous patch.

Signed-off-by: Kevin Wolf <>

51ef6727 10/22/2010 03:49 pm edison

Copy snapshots out of QCOW2 disk

In order to backup snapshots, created from QCOW2 iamge, we want to copy snapshots out of QCOW2 disk to a seperate storage.
The following patch adds a new option in "qemu-img": qemu-img convert -f qcow2 -O qcow2 -s snapshot_name src_img bck_img....

a77cffe7 10/22/2010 03:49 pm Stefan Weil

block: Use GCC_FMT_ATTR and fix a format error

Adding the gcc format attribute detects a format bug
which is fixed here.

v2:
Don't use type cast. BDRV_SECTOR_SIZE is unsigned long long,
so %lld should be the correct format specifier.

Cc: Blue Swirl <>...

83e3f76c 10/13/2010 09:38 pm Blue Swirl

block: avoid a write only variable

Compiling with GCC 4.6.0 20100925 produced a warning:
/src/qemu/block/qcow2-refcount.c: In function 'update_refcount':
/src/qemu/block/qcow2-refcount.c:552:13: error: variable 'dummy' set but not used [-Werror=unused-but-set-variable]...

d523d5d6 10/03/2010 09:40 am Stefan Weil

block/vvfat: Fix compiler warning in debug code

Fix this compiler warning:
./block/vvfat.c:2285: error: comparison of unsigned expression >= 0 is always true

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

687db4ed 09/22/2010 10:46 pm Anthony Liguori

block-verify: fix 32-bit build

Reported-by: Peter Lemenkov <>
Signed-off-by: Anthony Liguori <>

d9d33417 09/21/2010 06:00 pm Stefan Hajnoczi

blkverify: Add block driver for verifying I/O

The blkverify block driver makes investigating image format data
corruption much easier. A raw image initialized with the same contents
as the test image (e.g. qcow2 file) must be provided. The raw image
mirrors read/write operations and is used to verify that data read from...

6f5f060b 09/21/2010 04:39 pm Kevin Wolf

qcow2: Avoid bounce buffers for AIO write requests

qcow2 used to use bounce buffers for any AIO requests. This does not only imply
unnecessary copying, but also unbounded allocations which should be avoided.

This patch removes bounce buffers from the normal AIO write path. Encrypted...

ac48e389 09/21/2010 04:39 pm Kevin Wolf

vvfat: Fix segfault on write to read-only disk

vvfat tries to set the readonly flag in its open function, but nowadays
this is overwritted with the readonly=... command line option. Check in
bdrv_write if the vvfat was opened read-only and return an error in this...

9217e26f 09/21/2010 04:39 pm Kevin Wolf

vvfat: Fix double free for opening the image rw

Allocation and deallocation of bs->opaque is not in the control of a
block driver. Therefore it should not set bs->opaque to a data structure
used by another bs, or closing the image will lead to a double free....

a655211a 09/21/2010 04:39 pm Kevin Wolf

vvfat: Use cache=unsafe

The qcow file used for write support in vvfat is a temporary file,
so we can use cache=unsafe there. Without this, write support is just
too slow to be of any use.

Signed-off-by: Kevin Wolf <>

581b9e29 09/21/2010 04:39 pm Christoph Hellwig

raw-posix: handle > 512 byte alignment correctly

Replace the hardcoded handling of 512 byte alignment with bs->buffer_alignment
to handle larger sector size devices correctly.

Note that we can not rely on it to be initialize in bdrv_open, so deal
with the worst case there....

c2e2872b 09/21/2010 04:39 pm Laurent Vivier

nbd: correctly manage default port

block/nbd.c: use default port number when none is specified
qemu-nbd.c: use IANA-assigned port number: 10809

Signed-off-by: Laurent Vivier <>
Signed-off-by: Kevin Wolf <>

c01828fb 09/21/2010 04:39 pm Kevin Wolf

qcow2: Move sync out of write_refcount_block_entries

Signed-off-by: Kevin Wolf <>

1c4c2814 09/21/2010 04:39 pm Kevin Wolf

qcow2: Move sync out of update_refcount

Note that the flush is omitted intentionally in qcow2_free_clusters. If
anything, we can leak clusters here if we lose the writes.

Signed-off-by: Kevin Wolf <>

29216ed1 09/21/2010 04:39 pm Kevin Wolf

qcow2: Move sync out of qcow2_alloc_clusters

Signed-off-by: Kevin Wolf <>

9f8e668e 09/21/2010 04:39 pm Kevin Wolf

qcow2: Get rid of additional sync on COW

We always have a sync for the refcount update when a new cluster is
allocated. If we move this past the COW, we can save an additional sync.

Signed-off-by: Kevin Wolf <>

bd28f835 09/21/2010 04:39 pm Kevin Wolf

qcow2: Avoid bounce buffers for AIO read requests

qcow2 used to use bounce buffers for any AIO requests. This does not only imply
unnecessary copying, but also unbounded allocations which should be avoided.

This patch removes bounce buffers from the normal AIO read path, and constrains...

95ee3914 09/18/2010 08:53 am Blue Swirl

blkdebug: fix enum comparison

The signedness of enum types depend on the compiler implementation.
Therefore the check for negative values may or may not be meaningful.

Fix by explicitly casting to a signed integer.

Since the values are also checked earlier against event_names...

8b33d9ee 09/09/2010 01:09 am Anthony Liguori

Revert "Make default invocation of block drivers safer (v3)"

This reverts commit 79368c81bf8cf93864d7afc88b81b05d8f0a2c90.

Conflicts:

block.c

I haven't been able to come up with a solution yet for the corruption caused by
unaligned requests from the IDE disk so revert until a solution can be written....

7ec5e6a4 09/08/2010 01:39 pm Kevin Wolf

qcow2: Remove unnecessary flush after L2 write

When a new cluster was allocated, we only need a flush after the write to the
L2 table if it was a COW and we need to decrease the refcounts of the old
clusters.

Signed-off-by: Kevin Wolf <>

05acda4d 09/08/2010 01:39 pm Bernhard Kohl

raw-posix: improve detection of scsi-generic devices

Allow symbolic links which point to /dev/sgX devices.

Signed-off-by: Bernhard Kohl <>
Signed-off-by: Kevin Wolf <>

897804d6 09/08/2010 01:39 pm Kevin Wolf

raw-posix: Don't use file name for host_cdrom detection on Linux

On Linux, we have code to detect CD-ROMs using an ioctl. We shouldn't lose
anything but false positives by removing the check for a /dev/cd* path.

Signed-off-by: Kevin Wolf <>

010cb2b3 08/30/2010 07:29 pm Izumi Tsutsui

sheepdog: remove unnecessary includes

"qemu_socket.h" includes all necessary files and
including <netinet/tcp.h> without <netinet/in.h>
could cause errors on some systems.

Signed-off-by: Izumi Tsutsui <>
Signed-off-by: Kevin Wolf <>

2aa326be 08/30/2010 07:29 pm Loïc Minier

vvfat: fat_chksum(): fix access above array bounds

Signed-off-by: Loïc Minier <>
Signed-off-by: Kevin Wolf <>

1d45f8b5 08/30/2010 07:29 pm Laurent Vivier

nbd: Introduce NBD named exports.

This patch allows to connect Qemu using NBD protocol to an nbd-server
using named exports.

For instance, if on the host "isoserver", in /etc/nbd-server/config, you have:

[generic]
[debian-500-ppc-netinst]
exportname = /ISO/debian-500-powerpc-netinst.iso...

336c1c12 08/03/2010 04:57 pm Kevin Wolf

block: Fix bdrv_has_zero_init

Assuming that any image on a block device is not properly zero-initialized is
actually wrong: Only raw images have this problem. Any other image format
shouldn't care about it, they initialize everything properly themselves....

2ee9fb48 07/25/2010 05:59 pm Stefan Weil

block: Replace u_int8_t, u_int16_t, u_int32_t, u_int64_t by standard int types

There is no need to have a second set of integral types.
Replace them by the standard types from stdint.h.

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

79368c81 07/15/2010 04:17 pm Anthony Liguori

Make default invocation of block drivers safer (v3)

CVE-2008-2004 described a vulnerability in QEMU whereas a malicious user could
trick the block probing code into accessing arbitrary files in a guest. To
mitigate this, we added an explicit format parameter to -drive which disabling...

6defcc37 07/07/2010 08:54 pm MORITA Kazutaka

sheepdog: fix compile error on systems without TCP_CORK

WIN32 is not only the system which doesn't have TCP_CORK (e.g. OS X).

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Blue Swirl <>

33b1db1c 07/06/2010 06:05 pm MORITA Kazutaka

block: add sheepdog driver for distributed storage support

Sheepdog is a distributed storage system for QEMU. It provides highly
available block level storage volumes to VMs like Amazon EBS. This
patch adds a qemu block driver for Sheepdog.

Sheepdog features are:...

9ac228e0 07/06/2010 06:05 pm Kevin Wolf

qcow2/vdi: Change check to distinguish error cases

This distinguishes between harmless leaks and real corruption. Hopefully users
better understand what qemu-img check wants to tell them.

Signed-off-by: Kevin Wolf <>

65d21bc7 07/06/2010 06:05 pm Markus Armbruster

raw-posix: Fix test for host CD-ROM

raw_pread_aligned() retries up to two times if the block device backs
a virtual CD-ROM (a drive with media=cdrom and if=ide, scsi, xen or
none). This makes no sense. Whether retrying reads can correct read
errors can only depend on what we're reading, not on how the result...

327cdad4 07/02/2010 02:18 pm Kevin Wolf

blkdebug: Fix set_state_opts definition

The list head was initialized to point to the wrong list, so all actions ended
up being handled as inject-error even if they were set-state in fact.

Signed-off-by: Kevin Wolf <>

698f0d52 07/02/2010 02:18 pm Kevin Wolf

blkdebug: Free QemuOpts after having read the config

Forgetting to free them means that the next instance inherits all rules and
gets its own rules only additionally.

Signed-off-by: Kevin Wolf <>

8db520ce 07/02/2010 02:18 pm Kevin Wolf

blkdebug: Initialize state as 1

state = 0 in rules means that the rule is valid for any state. Therefore it's
impossible to have a rule that works only in the initial state. This changes
the initial state from 0 to 1 to make this possible.

Signed-off-by: Kevin Wolf <>

19dbcbf7 07/02/2010 02:18 pm Kevin Wolf

qcow2: Fix error handling during metadata preallocation

People were wondering why qemu-img check failed after they tried to preallocate
a large qcow2 file and ran out of disk space.

Signed-off-by: Kevin Wolf <>

b8852e87 06/22/2010 03:38 pm Kevin Wolf

vmdk: Use bdrv_(p)write_sync for metadata writes

Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash.

Signed-off-by: Kevin Wolf <>

078a458e 06/22/2010 03:38 pm Kevin Wolf

vpc: Use bdrv_(p)write_sync for metadata writes

Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash.

Signed-off-by: Kevin Wolf <>

6882c8fa 06/22/2010 03:38 pm Kevin Wolf

qcow2: Fix qemu-img check segfault on corrupted images

With corrupted images, we can easily get an cluster index that exceeds the
array size of the temporary refcount table.

Signed-off-by: Kevin Wolf <>

f74550fd 06/22/2010 03:38 pm Kevin Wolf

qcow2: Don't try to check tables that couldn't be loaded

Trying to check them leads to a second error message which is more confusing
than helpful:

Can't get refcount for cluster 0: Invalid argument
ERROR cluster 0 refcount=-22 reference=1

Signed-off-by: Kevin Wolf <>