Statistics
| Branch: | Revision:

root / block @ 69152c09

# Date Author Comment
2302c1ca 12/16/2013 11:12 am Marc-André Lureau

Split nbd block client code

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Gerd Hoffmann <>

e53a18e4 12/16/2013 11:12 am Marc-André Lureau

nbd: don't change socket block during negotiate

The caller might handle non-blocking using coroutine. Leave the choice
to the caller to use a blocking or non-blocking negotiate.

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>...

e2bc625f 12/16/2013 11:12 am Marc-André Lureau

nbd: pass export name as init argument

There is no need to keep the export name around, and it seems a better
fit as an argument in the init() call.

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>...

5ad283eb 12/16/2013 11:12 am Marc-André Lureau

nbd: make nbd_client_session_close() idempotent

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Gerd Hoffmann <>

69152c09 12/16/2013 11:12 am Marc-André Lureau

nbd: finish any pending coroutine

Make sure all pending coroutines are finished when closing the session.

Signed-off-by: Marc-André Lureau <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Gerd Hoffmann <>

063c3378 12/09/2013 12:28 pm Peter Lieven

block/iscsi: introduce bdrv_co_{readv, writev, flush_to_disk}

this converts read, write and flush functions from aio to coroutines
eliminating almost 200 lines of code.

The requirement for libiscsi is bumped to version 1.4.0 which was
released in may 2012....

ac95acdb 12/06/2013 05:53 pm Hu Tao

qcow2: use start_of_cluster() and offset_into_cluster() everywhere

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

1c0704a5 12/05/2013 12:45 pm Peter Lieven

block/iscsi: set bdi->cluster_size

this patch aims to set bdi->cluster_size to the internal page size
of the iscsi target so that enabled callers can align requests
properly.

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Peter Lieven <>...

7572ddc8 12/05/2013 12:45 pm Peter Lieven

block/iscsi: set bs->bl.opt_transfer_length

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

7b4c4781 12/04/2013 04:19 pm Wenchao Xia

snapshot: distinguish id and name in load_tmp

Since later this function will be used so improve it. The only caller of it
now is qemu-img, and it is not impacted by introduce function
bdrv_snapshot_load_tmp_by_id_or_name() that call bdrv_snapshot_load_tmp()...

8c116b0e 12/04/2013 04:19 pm Wenchao Xia

qemu-nbd: support internal snapshot export

Now it is possible to directly export an internal snapshot, which
can be used to probe the snapshot's contents without qemu-img
convert.

Signed-off-by: Wenchao Xia <>
Signed-off-by: Stefan Hajnoczi <>

f8413b3c 12/04/2013 12:29 pm Kevin Wolf

qcow2: Zero-initialise first cluster for new images

Strictly speaking, this is only required for has_zero_init() == false,
but it's easy enough to just do a cluster-aligned write that is padded
with zeros after the header.

This fixes that after 'qemu-img create' header extensions are attempted...

7ce21016 12/03/2013 04:26 pm Paolo Bonzini

block: handle ENOTSUP from discard in generic code

Similar to write_zeroes, let the generic code receive a ENOTSUP for
discard operations. Since bdrv_discard has advisory semantics,
we can just swallow the error.

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

97b00e28 12/03/2013 04:26 pm Paolo Bonzini

vpc, vhdx: add get_info

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

95de6d70 12/03/2013 04:26 pm Paolo Bonzini

block drivers: add discard/write_zeroes properties to bdrv_get_info implementation

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

cffb1ec6 12/03/2013 04:26 pm Paolo Bonzini

block drivers: expose requirement for write same alignment from formats

This will let misaligned but large requests use zero clusters. This
is important because the cluster size is not guest visible.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Peter Lieven <>...

4b52498e 12/03/2013 04:26 pm Peter Lieven

block/iscsi: remove .bdrv_has_zero_init

since commit 3ac21627 the default value changed to 0.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

2af8a1a7 12/03/2013 04:26 pm Peter Lieven

block/iscsi: updated copyright

added myself to reflect recent work on the iscsi block driver.

Signed-off-by: Peter Lieven <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

fa6252b0 12/03/2013 04:26 pm Paolo Bonzini

block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP

The current check is right for MAY_UNMAP=1. For MAY_UNMAP=0, just
try and fall back to regular writes as soon as a WRITE SAME command
fails.

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

260a82e5 12/03/2013 04:26 pm Paolo Bonzini

raw-posix: implement write_zeroes with MAY_UNMAP for files

Writing zeroes to a file can be done by punching a hole if
MAY_UNMAP is set.

Note that in this case ENOTSUP is not ignored, but makes
the block layer fall back to the generic implementation.

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

d0b4503e 12/03/2013 04:26 pm Paolo Bonzini

raw-posix: implement write_zeroes with MAY_UNMAP for block devices

See the next commit for the description of the Linux kernel problem
that is worked around in raw_open_common.

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

97a2ae34 12/03/2013 04:26 pm Paolo Bonzini

raw-posix: add support for write_zeroes on XFS and block devices

The code is similar to the implementation of discard and write_zeroes
with UNMAP. However, failure must be propagated up to block.c.

The stale page cache problem can be reproduced as follows:...

af057fe7 12/03/2013 10:54 am Fam Zheng

vmdk: Fix creating big description file

The buffer for description file was 4096 which only covers a few
hundred of extents. This changes the buffer to dynamic allocated with
g_strdup_printf in order to support bigger cases.

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

509d39aa 11/29/2013 06:41 pm Fam Zheng

vmdk: Allow read only open of VMDK version 3

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

c9fbb99d 11/29/2013 06:41 pm Kevin Wolf

block: Use BDRV_O_NO_BACKING where appropriate

If you open an image temporarily just because you want to check its size
or get it flushed, there's no real reason to open the whole backing file
chain.

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

c31d482f 11/29/2013 02:40 pm Liu Yuan

sheepdog: refactor do_sd_create()

We can actually use BDRVSheepdogState *s to pass most of the parameters.

Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>
Signed-off-by: Liu Yuan <>
Signed-off-by: Stefan Hajnoczi <>

b3af018f 11/29/2013 02:40 pm Liu Yuan

sheepdog: support user-defined redundancy option

Sheepdog support two kinds of redundancy, full replication and erasure coding.

  1. create a fully replicated vdi with x copies
    -o redundancy=x (1 <= x <= SD_MAX_COPIES)
  1. create a erasure coded vdi with x data strips and y parity strips...
4cc70e93 11/29/2013 02:40 pm Fam Zheng

blkdebug: add "remove_break" command

This adds "remove_break" command which is the reverse of blkdebug
command "break": it removes all breakpoints with given tag and resumes
all the requests.

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

21b56835 11/29/2013 02:40 pm Fam Zheng

qapi: Change BlockDirtyInfo to list

We have multiple dirty bitmaps in BDS now, switch QAPI to allow query
it (BlockInfo.dirty_bitmaps), and also drop old BlockInfo.dirty.

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

14b98fda 11/29/2013 02:40 pm Charlie Shepherd

COW: Speed up writes

Process a whole sector's worth of COW bits by reading a sector, setting
the bits after skipping any already set bits, then writing it out again.
Make sure we only flush once before writing metadata, and only if we
need to write metadata....

091b1108 11/29/2013 02:40 pm Charlie Shepherd

COW: Extend checking allocated bits to beyond one sector

cow_co_is_allocated() only checks one sector's worth of allocated bits
before returning. This is allowed but (slightly) inefficient, so extend
it to check all of the file's metadata sectors.

Signed-off-by: Charlie Shepherd <>...

e4654d2d 11/29/2013 02:40 pm Fam Zheng

block: per caller dirty bitmap

Previously a BlockDriverState has only one dirty bitmap, so only one
caller (e.g. a block job) can keep track of writing. This changes the
dirty bitmap to a list and creates a BdrvDirtyBitmap for each caller, the
lifecycle is managed with these new functions:...

f4a193e7 11/28/2013 12:39 pm Max Reitz

block/stream: Don't stream unbacked devices

If a block device is unbacked, a streaming blockjob should immediately
finish instead of beginning to try to stream, then noticing the backing
file does not contain even the first sector (since it does not exist)...

ba6c5919 11/28/2013 11:30 am Peter Lieven

iscsi: set limits in BlockDriverState

Reviewed-by: Eric Blake <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

01a6a238 11/28/2013 11:30 am Peter Lieven

iscsi: simplify iscsi_co_discard

now that bdrv_co_discard can handle limits we do not need
the request split logic here anymore.

Reviewed-by: Eric Blake <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

d4cd9615 11/28/2013 11:30 am Peter Lieven

iscsi: add bdrv_co_write_zeroes

Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

85829722 11/28/2013 11:30 am Liu Yuan

sheepdog: implement .bdrv_get_allocated_file_size

With this patch, qemu-img info sheepdog:image will show disk size for sheepdog
images.

Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>
Cc: MORITA Kazutaka <>...

aa7bfbff 11/28/2013 11:30 am Peter Lieven

block: add flags to bdrv_*_write_zeroes

Reviewed-by: Eric Blake <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

d32f35cb 11/28/2013 11:30 am Peter Lieven

block: introduce BDRV_REQ_MAY_UNMAP request flag

Reviewed-by: Eric Blake <>
Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

186d4f2b 11/28/2013 11:30 am Peter Lieven

block/iscsi: add .bdrv_get_info

Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

04f19e4d 11/28/2013 11:30 am Peter Lieven

block/raw: copy BlockLimits on raw_open

Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

78a52ad5 11/14/2013 02:09 pm Peter Lieven

qcow2: fix possible corruption when reading multiple clusters

if multiple sectors spanning multiple clusters are read the
function count_contiguous_clusters should ensure that the
cluster type should not change between the clusters.

Especially the for-loop should break when we have one...

b04b6b6e 11/14/2013 02:09 pm Fam Zheng

block: Print its file name if backing file opening failed

If backing file doesn't exist, the error message is confusing and
misleading:

$ qemu /tmp/a.qcow2
qemu: could not open disk image /tmp/a.qcow2: Could not open file: No
such file or directory...
1a848fd4 11/07/2013 02:58 pm Jeff Cody

block: vhdx - add region overlap detection for image files

Regions in the image file cannot overlap - the log, region tables,
and metdata must all be unique and non-overlapping.

This adds region checking by means of a QLIST; there can be a variable
number of regions and metadata (there may be metadata or region tables...

8adc5233 11/07/2013 02:58 pm Jeff Cody

block: vhdx - add log write support

This adds support for writing to the VHDX log.

For spec details, see VHDX Specification Format v1.00:
https://www.microsoft.com/en-us/download/details.aspx?id=34750

There are a few limitations to this log support:
1.) There is no caching yet...

d92aa883 11/07/2013 02:58 pm Jeff Cody

block: vhdx write support

This adds support for writing to VHDX image files, using coroutines.
Writes into the BAT table goes through the VHDX log. Currently, BAT
table writes occur when expanding a dynamic VHDX file, and allocating a
new BAT entry.

Signed-off-by: Jeff Cody <>...

0b7da092 11/07/2013 02:58 pm Jeff Cody

block: vhdx - remove BAT file offset bit shifting

Bit shifting can be fun, but in this case it was unnecessary. The
upper 44 bits of the 64-bit BAT entry is specifies the File Offset,
so we shifted the bits to get access to the value.

However, per the spec the value is in MB. So we dutifully shifted back...

c325ee1d 11/07/2013 02:58 pm Jeff Cody

block: vhdx - move more endian translations to vhdx-endian.c

In preparation for vhdx_create(), move more endian translation
functions out to vhdx-endian.c.

Signed-off-by: Jeff Cody <>
Signed-off-by: Stefan Hajnoczi <>

1e74a971 11/07/2013 02:58 pm Jeff Cody

block: vhdx - break out code operations to functions

This is preperation for vhdx_create(). The ability to write headers,
and calculate the number of BAT entries will be needed within the
create() functions, so move this relevant code into helper functions....

61c02e56 11/07/2013 02:58 pm Jeff Cody

block: vhdx - fix comment typos in header, fix incorrect struct fields

VHDXPage83Data and VHDXParentLocatorHeader both incorrectly had their
MSGUID fields set as arrays of 16. This is incorrect (it stems from
an early version where those fields were uint_8 arrays). Those fields...

3412f7b1 11/07/2013 02:58 pm Jeff Cody

block: vhdx - add .bdrv_create() support

This adds support for VHDX image creation, for images of type "Fixed"
and "Dynamic". "Differencing" types (i.e., VHDX images with backing
files) are currently not supported.

Options for image creation include: * log size:...

0173e7bb 11/07/2013 02:58 pm Peter Lieven

block/vpc: fix virtual size for images created with disk2vhd

Signed-off-by: Peter Lieven <>
Signed-off-by: Stefan Hajnoczi <>

6e9d290b 11/07/2013 02:58 pm Jeff Cody

block: vhdx - minor comments and typo correction.

Just a couple of minor comments to help note where allocated
buffers are freed, and a typo fix.

Signed-off-by: Jeff Cody <>
Signed-off-by: Stefan Hajnoczi <>

4f18b782 11/07/2013 02:58 pm Jeff Cody

block: vhdx - add header update capability.

This adds the ability to update the headers in a VHDX image, including
generating a new MS-compatible GUID.

As VHDX depends on uuid.h, VHDX is now a configurable build option. If
VHDX support is enabled, that will also enable uuid as well. The...

28541d46 11/07/2013 02:58 pm Jeff Cody

block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.

In preparation for VHDX log support, move these structures to the
header.

Signed-off-by: Jeff Cody <>
Signed-off-by: Stefan Hajnoczi <>

625565d2 11/07/2013 02:58 pm Jeff Cody

block: vhdx - log support struct and defines

This adds some magic number defines, and internal structure definitions
for VHDX log replay support. The struct VHDXLogEntries does not reflect
an on-disk data structure, and thus does not need to be packed.
...

0f48e8f0 11/07/2013 02:58 pm Jeff Cody

block: vhdx - break endian translation functions out

This moves the endian translation functions out from the vhdx.c source,
into a separate source file. In addition to the previously defined
endian functions, new endian translation functions for log support are...

c3906c5e 11/07/2013 02:58 pm Jeff Cody

block: vhdx - update log guid in header, and first write tracker

Allow tracking of first file write in the VHDX image, as well as
the ability to update the GUID in the header. This is in preparation
for log support.

Signed-off-by: Jeff Cody <>...

c46415af 11/07/2013 02:58 pm Jeff Cody

block: vhdx code movement - move vhdx_close() above vhdx_open()

Signed-off-by: Jeff Cody <>
Signed-off-by: Stefan Hajnoczi <>

0a43a1b5 11/07/2013 02:58 pm Jeff Cody

block: vhdx - log parsing, replay, and flush support

This adds support for VHDX v0 logs, as specified in Microsoft's
VHDX Specification Format v1.00:
https://www.microsoft.com/en-us/download/details.aspx?id=34750

The following support is added:

  • Log parsing, and validation - validate that an existing log...
511018e4 11/07/2013 02:53 pm Andreas Tobler

block/raw-posix: fix FreeBSD compilation

The below patch is needed to compile qemu trunk on FreeBSD with gcc48,
clang will fail.... ;). Host x84_64-freebsd.

Signed-off-by: Andreas Tobler <>
Signed-off-by: Stefan Hajnoczi <>

e4ef9f46 11/06/2013 05:57 am Peter Maydell

bswap.h: Remove cpu_to_be64wu()

Replace the legacy cpu_to_be64wu() with stq_be_p().

Signed-off-by: Peter Maydell <>
Reviewed-by: Richard Henderson <>
Reviewed-by: Michael S. Tsirkin <>
Message-id: ...

a126050a 10/31/2013 06:02 pm Anthony Liguori

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

Block patches for 1.7.0-rc0 (v2)

  1. gpg: Signature made Thu 31 Oct 2013 04:44:39 PM CET using RSA key ID C88F2FD6
  2. gpg: Can't check signature: public key not found
  • kwolf/tags/for-anthony: (30 commits)...
f4c129a3 10/31/2013 03:44 pm Fam Zheng

vmdk: Implment bdrv_get_specific_info

Implement .bdrv_get_specific_info to return the extent information.

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

80308d33 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: check simultaneous create in resend_aioreq

After reconnection happens, all the inflight requests are moved to the
failed request list. As a result, sd_co_rw_vector() can send another
create request before resend_aioreq() resends a create request from...

35200687 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: cancel aio requests if possible

This patch tries to cancel aio requests in pending queue and failed
queue. When the sheepdog driver cannot cancel the requests, it waits
for them to be completed.

Signed-off-by: MORITA Kazutaka <>...

a37dcdf9 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: make add_aio_request and send_aioreq void functions

These functions no longer return errors. We can make them void
functions and simplify the codes.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>...

011603ca 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: try to reconnect to sheepdog after network error

This introduces a failed request queue and links all the inflight
requests to the list after network error happens. After QEMU
reconnects to the sheepdog server successfully, the sheepdog block
driver will retry all the requests in the failed queue....

72e0996c 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: reload inode outside of resend_aioreq

This prepares for using resend_aioreq() after reconnecting to the
sheepdog server.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>
Reviewed-by: Liu Yuan <>...

2412aec7 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: handle vdi objects in resend_aio_req

The current resend_aio_req() doesn't work when the request is against
vdi objects. This fixes the problem.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>...

80731d9d 10/30/2013 01:21 pm MORITA Kazutaka

sheepdog: check return values of qemu_co_recv/send correctly

If qemu_co_recv/send doesn't return the specified length, it means
that an error happened.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>...

b94a2610 10/29/2013 02:10 pm Kevin Wolf

block: Avoid unecessary drv->bdrv_getlength() calls

The block layer generally keeps the size of an image cached in
bs->total_sectors so that it doesn't have to perform expensive
operations to get the size whenever it needs it.

This doesn't work however when using a backend that can change its size...

1841f880 10/28/2013 06:40 pm Liu Yuan

sheepdog: pass copy_policy in the request

Currently copy_policy isn't used. Recent sheepdog supports erasure coding, which
make use of copy_policy internally, but require client explicitly passing
copy_policy from base inode to newly creately inode for snapshot related...

29a67f7e 10/28/2013 06:39 pm Liu Yuan

sheepdog: explicitly set copies as type uint8_t

'copies' is actually uint8_t since day one, but request headers and some helper
functions parameterize it as uint32_t for unknown reasons and effectively
reserve 24 bytes for possible future use. This patch explicitly set the correct...

ba2ab2f2 10/28/2013 06:34 pm Max Reitz

qcow2: Flush image after creation

Opening the qcow2 image with BDRV_O_NO_FLUSH prevents any flushes during
the image creation. This means that the image has not yet been flushed
to disk when qemu-img create exits. This flush is delayed until the next
operation on the image involving opening it without BDRV_O_NO_FLUSH and...

73f395fa 10/26/2013 12:01 pm Stefan Weil

misc: New spelling fixes in comments

compatiblity -> compatibility
continously -> continuously
existance -> existence
usefull -> useful
shoudl -> should

Signed-off-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

fb8fe35f 10/24/2013 06:34 pm Peter Lieven

block/vpc: check that the image has not been truncated

this adds a check that a dynamic VHD file has not been
accidently truncated (e.g. during transfer or upload).

Signed-off-by: Peter Lieven <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

6e13610a 10/24/2013 12:50 pm Max Reitz

qcow2: Unset zero_beyond_eof in save_vmstate

Saving the VM state is done using bdrv_pwrite. This function may perform
a read-modify-write, which in this case results in data being read from
beyond the end of the virtual disk. Since we are actually trying to...

eedff66f 10/24/2013 12:45 pm Max Reitz

qcow2: Restore total_sectors value in save_vmstate

Since df2a6f29a5, bdrv_co_do_writev increases the total_sectors value of
a growable block devices on writes after the current end. This leads to
the virtual disk apparently growing in qcow2_save_vmstate, which in turn...

dbbcaa8d 10/18/2013 02:41 pm Fam Zheng

vmdk: fix VMFS extent parsing

The VMFS extent line in description file doesn't have start offset as
FLAT lines does, and it should be defaulted to 0. The flat_offset
variable is initialized to -1, so we need to set it in this case.

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

c338b6ad 10/18/2013 02:39 pm Fam Zheng

vmdk: Only read cid from image file when opening

Previously cid of parent is parsed from image file for every IO request.
We already have L1/L2 cache and don't have assumption that parent image
can be updated behind us, so remove this to get more efficiency....

45d57f6e 10/17/2013 03:55 pm Max Reitz

block/raw-win32: Always use -errno in hdev_open

On one occasion, hdev_open() returned -1 in case of an unknown error
instead of a proper -errno value. Adjust this to match the behavior of
raw_open() (in raw-win32), which is to return -EINVAL in this case....

899f1ae2 10/11/2013 05:50 pm Fam Zheng

vmdk: Fix vmdk_parse_extents

An extra 'p++' after while loop when *p == '\n' will move p to unknown
data position, risking parsing junk data or memory access violation.

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

4823970b 10/11/2013 05:50 pm Fam Zheng

vmdk: convert error code to use errp

Convert "fprintf(stderr,..." and standardize error messages:

Remove a few local_error's and use errp.

Remove "VMDK:" or "Vmdk:" prefixes in error message and fix to upper
case.

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

52c8d629 10/11/2013 05:50 pm Fam Zheng

vmdk: refuse enabling zeroed grain with flat images

This is a header flag and we needs sparse for the header.

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

84757f7e 10/11/2013 05:50 pm Max Reitz

qcow2: Fix snapshot restoration in snapshot_create

If the new snapshot table could not be written in qcow2_snapshot_create,
the old snapshot table has to be restored in memory and the new one
released. This should include restoration of the old snapshot count as...

00c49b21 10/11/2013 05:50 pm Max Reitz

qcow2: Use better type for numerical snapshot ID

When trying to find a new snapshot ID, the existing ones are converted
to integers using strtoul. This function returns an unsigned long,
therefore its result should be saved in an unsigned long as well.

Signed-off-by: Max Reitz <>...

231bb267 10/11/2013 05:50 pm Max Reitz

qcow2: Use negated overflow check mask

In qcow2_check_metadata_overlap and qcow2_pre_write_overlap_check,
change the parameter signifying the checks to perform from its current
positive form to a negative one, i.e., it will no longer explicitly
specify every check to perform but rather a mask of checks not to...

3e355390 10/11/2013 05:50 pm Max Reitz

qcow2: Make overlap check mask variable

Replace the QCOW2_OL_DEFAULT macro by a variable overlap_check in
BDRVQcowState.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

05de7e86 10/11/2013 05:50 pm Max Reitz

qcow2: Add overlap-check options

Add runtime options to tune the overlap checks to be performed before
write accesses.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

4092e99d 10/11/2013 05:50 pm Max Reitz

qcow2: Array assigning options to OL check bits

Add an array which assigns the option string to its corresponding
overlap check bit.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

4a273c39 10/11/2013 05:50 pm Max Reitz

qcow2: Add more overlap check bitmask macros

Introduces the macros QCOW2_OL_CONSTANT and QCOW2_OL_ALL in addition to
the already existing QCOW2_OL_CACHED, signifying all metadata overlap
checks that can be performed in constant time (regardless of image size...

1fa5cc83 10/11/2013 05:50 pm Max Reitz

qcow2: Evaluate overlap check options

Evaluate the runtime overlap check options and set
BDRVQcowState.overlap_check appropriately.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

92f1deec 10/11/2013 05:50 pm Max Reitz

block/raw_bsd: Employ error parameter

Propagate errors in raw_create rather than directly reporting and
afterwards discarding them.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

c6252b7c 10/11/2013 05:50 pm Max Reitz

block/raw-win32: Employ error parameter

Make use of the error parameter in the opening and creating functions in
block/raw-win32.c.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

10ffa72f 10/11/2013 05:50 pm Max Reitz

blkdebug: Employ error parameter

Make use of the error parameter in blkdebug_open.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

ca288408 10/11/2013 05:50 pm Max Reitz

blkverify: Employ error parameter

Make use of the error parameter in blkverify_open.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

e428e439 10/11/2013 05:50 pm Max Reitz

block/raw-posix: Employ error parameter

Make use of the error parameter in the opening and creating functions in
block/raw-posix.c.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

9e3f0892 10/11/2013 05:49 pm Max Reitz

qcow2: Add missing space in error message

The error message in qcow2_downgrade about an unsupported refcount
order is missing a space. This patch adds it.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

f9bff971 10/11/2013 05:49 pm Max Reitz

qcow2: Remove wrong metadata overlap check

In qcow2_write_compressed, if the compression fails, a normal cluster is
written to disk. This is done through bdrv_write on the qcow2 BDS
itself (using the guest offset), thus it is wrong to do a metadata
overlap check before....