Statistics
| Branch: | Revision:

root / block @ 8cfd0495

# Date Author Comment
b10577df 08/22/2013 11:05 pm Stefan Hajnoczi

win32-aio: drop win32_aio_flush_cb()

The io_flush argument to qemu_aio_set_event_notifier() has been removed
since the block layer learnt to drain requests by itself. Fix the
Windows build for win32-aio.o by updating the
qemu_aio_set_event_notifier() call and dropping win32_aio_flush_cb()....

7483d1e5 08/22/2013 08:14 pm Alex Bligh

aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API

Convert block_job_sleep_ns and co_sleep_ns to use the new timer
API.

Signed-off-by: Alex Bligh <>
Signed-off-by: Stefan Hajnoczi <>

bc72ad67 08/22/2013 08:14 pm Alex Bligh

aio / timers: Switch entire codebase to the new timer API

This is an autogenerated patch using scripts/switch-timer-api.

Switch the entire code base to using the new timer API.

Note this patch may introduce some line length issues.

Signed-off-by: Alex Bligh <>...

b0651b8c 08/22/2013 04:35 pm Fam Zheng

vmdk: Move l1_size check into vmdk_add_extent()

This header check is common to VMDK3 and VMDK4, so move it into
vmdk_add_extent().

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

f6b61e54 08/22/2013 04:35 pm Fam Zheng

vmdk: fix L1 and L2 table size in vmdk3 open

VMDK3 header has the field l1dir_size, but vmdk_open_vmdk3 hardcoded the
value. This patch honors the header field.

And the L2 table size is 4096 according to VMDK spec1, instead of
1 << 9 (512).

[1]:
http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk...

daac8fdc 08/22/2013 04:35 pm Fam Zheng

vmdk: support vmfsSparse files

VMware ESX hosts use a variant of the VMDK3 format, identified by the
vmfsSparse create type ad the VMFSSPARSE extent type.

It has 16 KB grain tables (L2) and a variable-size grain directory (L1).
In addition, the grain size is always 512, but that is not a problem...

04d542c8 08/22/2013 04:35 pm Paolo Bonzini

vmdk: support vmfs files

VMware ESX hosts also use different create and extent types for flat
files, respectively "vmfs" and "VMFS". This is not documented, but it
can be found at http://kb.vmware.com/kb/10002511 (Recreating a missing
virtual machine disk (VMDK) descriptor file)....

0d51b4de 08/22/2013 03:10 pm Asias He

block: Introduce bs->zero_beyond_eof

In 4146b46c42e0989cb5842e04d88ab6ccb1713a48 (block: Produce zeros when
protocols reading beyond end of file), we break qemu-iotests ./check
-qcow2 022. This happens because qcow2 temporarily sets ->growable = 1
for vmstate accesses (which are stored beyond the end of regular image...

8ad1898c 08/21/2013 03:41 pm Kevin Wolf

qcow2: Change default for new images to compat=1.1

By the time that qemu 1.7 will be released, enough time will have passed
since qemu 1.1, which is the first version to understand version 3
images, that changing the default shouldn't hurt many people any more...

70ecdc6e 08/19/2013 04:52 pm Stefan Hajnoczi

block/iscsi: drop iscsi_process_flush()

.io_flush() is no longer called so drop iscsi_process_flush().

Signed-off-by: Stefan Hajnoczi <>

94473d0c 08/19/2013 04:52 pm Stefan Hajnoczi

block/linux-aio: drop qemu_laio_completion_cb()

.io_flush() is no longer called so drop qemu_laio_completion_cb(). It
turns out that count is now unused so drop that too.

Signed-off-by: Stefan Hajnoczi <>

bed2e759 08/19/2013 04:52 pm Stefan Hajnoczi

block/nbd: drop nbd_have_request()

.io_flush() is no longer called so drop nbd_have_request(). We cannot
drop in_flight since it is still used by other block/nbd.c code.

Signed-off-by: Stefan Hajnoczi <>

5d289cc7 08/19/2013 04:52 pm Stefan Hajnoczi

block/rbd: drop qemu_rbd_aio_flush_cb()

.io_flush() is no longer called so drop qemu_rbd_aio_flush_cb().
qemu_aio_count is unused now so drop it too.

Signed-off-by: Stefan Hajnoczi <>

d6d94c67 08/19/2013 04:52 pm Stefan Hajnoczi

block/sheepdog: drop have_co_req() and aio_flush_request()

.io_flush() is no longer called so drop have_co_req() and
aio_flush_request().

Signed-off-by: Stefan Hajnoczi <>

f0d35765 08/19/2013 04:52 pm Stefan Hajnoczi

block/ssh: drop return_true()

.io_flush() is no longer called so drop return_true().

Signed-off-by: Stefan Hajnoczi <>

f2e5dca4 08/19/2013 04:52 pm Stefan Hajnoczi

aio: drop io_flush argument

The .io_flush() handler no longer exists and has no users. Drop the
io_flush argument to aio_set_fd_handler() and related functions.

The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no
longer used and are dropped too....

372835fb 08/19/2013 04:51 pm Stefan Hajnoczi

block/gluster: drop qemu_gluster_aio_flush_cb()

Since .io_flush() is no longer called we do not need
qemu_gluster_aio_flush_cb() anymore. It turns out that qemu_aio_count
is unused now and can be dropped.

Thanks to Bharata B Rao <> for catching a...

0d146022 08/19/2013 04:45 pm Stefan Hajnoczi

block/curl: drop curl_aio_flush()

.io_flush() is no longer called so drop curl_aio_flush(). The acb[]
array that the function checks is still used in other parts of
block/curl.c. Therefore we cannot remove acb[], it is needed.

Signed-off-by: Stefan Hajnoczi <>

88266f5a 08/19/2013 04:45 pm Stefan Hajnoczi

block: stop relying on io_flush() in bdrv_drain_all()

If a block driver has no file descriptors to monitor but there are still
active requests, it can return 1 from .io_flush(). This is used to spin
during synchronous I/O.

Stop relying on .io_flush() and instead check...

7748c1bd 08/12/2013 05:15 pm Paolo Bonzini

raw: add license header

Most of the block layer is under the BSD license, thus it is reasonable
to license block/raw.c the same way. CCed people should ACK by replying
with a Signed-off-by line.

Cc: Christoph Hellwig <>
Cc: Kevin Wolf <>...

5d8caa54 08/06/2013 04:27 pm Fam Zheng

vmdk: Make VMDK3Header and VmdkGrainMarker QEMU_PACKED

It's best to make it consistent that all on disk structures are
QEMU_PACKED.

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

e98768d4 08/06/2013 04:27 pm Fam Zheng

vmdk: use unsigned values for on disk header fields

The size and offset fields are all non-negative values, use uint64_t for
them to avoid getting negative in memory value by int overflow.

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

8aa1331c 08/06/2013 04:27 pm Fam Zheng

vmdk: check granularity field in opening

Granularity is used to calculate the cluster size and allocate r/w
buffer. Check the value from image before using it, so we don't abort()
for unbounded memory allocation.

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

f8ce0403 08/06/2013 04:27 pm Fam Zheng

vmdk: check l2 table size when opening

header.num_gtes_per_gte determines size for L2 table. Check for too big
value before using it. Limit to 512M entries (2GB per one L2 table).

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

2c43e43c 08/06/2013 04:27 pm Fam Zheng

vmdk: check l1 size before opening image

L1 table size is calculated from capacity, granularity and l2 table
size. If capacity is too big or later two are too small, the L1 table
will be too big to allocate in memory. Limit it to a reasonable range.

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

bf81507d 08/06/2013 04:27 pm Fam Zheng

vmdk: use heap allocation for whole_grain

We should never grow the stack beyond 1 MB, otherwise we'll fall off the
end. Thread stacks and coroutine stacks (1 MB) do not grow.
get_cluster_offset() allocates a big stack offset, it will fail for big
cluster images, change to heap allocated buffer....

ca8804ce 08/06/2013 04:27 pm Fam Zheng

vmdk: rename num_gtes_per_gte to num_gtes_per_gt

num_gtes_per_gte is a historical typo, rename it to a more sensible
name. It means "number of GrainTableEntries per GrainTable".

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

e4f5c1bf 08/06/2013 11:41 am Liu Yuan

sheepdog: add missing .bdrv_has_zero_init

Commit 3ac21627 changed the behaviour of bdrv_has_zero_init() to default
to 0. In the review for Sheepdog it turned out that enabling it is safe,
so that commit updated one BlockDriver definition of sheepdog to use...

8e507243 08/02/2013 05:07 pm Fam Zheng

vmdk: fix comment for vmdk_co_write_zeroes

The comment was truncated. Add the missing parts, especially explain why
we need zero_dry_run.

Signed-off-by: Fam Zheng <>
Signed-off-by: Michael Tokarev <>

f5075224 08/02/2013 05:02 pm Richard W.M. Jones

block/iscsi.c: Fix printf format error.

The error on armv7hl was:

block/iscsi.c: In function ‘is_request_lun_aligned’:
block/iscsi.c:251:26: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int64_t’ [-Werror=format=]
iscsilun->block_size, sector_num, nb_sectors);...

2440a2c3 07/30/2013 03:33 am Peter Maydell

block/sheepdog: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <>...

eddbf0ab 07/29/2013 07:33 pm Anthony Liguori

Merge remote-tracking branch 'stefanha/block' into staging

  1. By Stefan Hajnoczi (4) and others
  2. Via Stefan Hajnoczi
    • stefanha/block:
      dataplane: refuse to start if device is already in use
      dataplane: enable virtio-blk x-data-plane=on live migration
      migration: fix spice migration...
42ec24e2 07/29/2013 06:07 pm Paolo Bonzini

gluster: Add image resize support

Implement .bdrv_truncate in GlusterFS block driver so that GlusterFS backend
can support image resizing.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Bharata B Rao <>
Tested-by: Bharata B Rao <>...

52f35022 07/27/2013 10:22 am Stefan Weil

misc: Fix new typos in comments and strings

All these typos were found by codespell.

sould -> should
emperical -> empirical
intialization -> initialization
successfuly -> successfully
gaurantee -> guarantee

Fix also another error (before before) in the same context....

fc5d3f84 07/26/2013 11:01 pm Ian Main

Implement sync modes for drive-backup.

This patch adds sync-modes to the drive-backup interface and
implements the FULL, NONE and TOP modes of synchronization.

FULL performs as before copying the entire contents of the drive
while preserving the point-in-time using CoW....

64aa99d3 07/26/2013 10:59 pm Kevin Wolf

qcow2: Use dashes instead of underscores in options

This is what QMP wants to use. The options haven't been enabled in any
release yet, so we're still free to change them.

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

a23fdf35 07/19/2013 10:27 am Peter Lieven

block/raw: add .bdrv_get_info

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

0c14fb47 07/19/2013 07:29 am Bharata B Rao

gluster: Add discard support for GlusterFS block driver.

Implement bdrv_aio_discard for gluster.

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

78f27bd0 07/19/2013 07:29 am Fam Zheng

block: fix vvfat error path for enable_write_target

s->qcow and s->qcow_filename are allocated but not freed on error. Fix the
possible leaks, remove unnecessary check for bdrv_new(), propagate ret code of
bdrv_create() and also the one of enable_write_target()....

8bf9344a 07/19/2013 07:29 am Peter Lieven

block/raw: add bdrv_co_write_zeroes

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

7e4d5a9f 07/17/2013 06:01 pm Peter Lieven

iscsi: remove support for misaligned nb_sectors in aio_readv

this hask is not working (anymore). support for misaligned offsets should
be handled at the block layer.

Signed-off-by: Peter Lieven <>
Cc:
Signed-off-by: Paolo Bonzini <>

91bea4e2 07/17/2013 06:01 pm Peter Lieven

iscsi: assert that sectors are aligned to LUN blocksize

if the blocksize of an iSCSI LUN is bigger than the BDRV_SECTOR_SIZE
it is possible that sector_num or nb_sectors are not correctly
aligned.

to avoid corruption we fail requests which are misaligned....

0777b5dd 07/17/2013 06:01 pm Peter Lieven

iscsi: factor out sector conversions

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

d3bda7bc 07/17/2013 06:00 pm Peter Lieven

iscsi: fix -ENOSPC in iscsi_create()

the -ENOPSC case did not work due to the missing goto.

Reported-by: Kevin Wolf <>
Signed-off-by: Peter Lieven <>
Cc:
Signed-off-by: Paolo Bonzini <>

0a53f010 07/17/2013 06:00 pm Ronnie Sahlberg

Fix iSCSI crash on SG_IO with an iovector

Don't assume that SG_IO is always invoked with a simple buffer,
check the iovec_count and if it is >= 1 then we need to pass an array
of iovectors to libiscsi instead of just a plain buffer.

Signed-off-by: Ronnie Sahlberg <>...

98289620 07/15/2013 10:49 am Kevin Wolf

block: Don't parse protocol from file.filename

One of the major reasons for doing something new for -blockdev and
blockdev-add was that the old block layer code parses filenames instead
of just taking them literally. So we should really leave it untouched...

da7a50f9 07/05/2013 10:40 am Fam Zheng

vmdk: Implement .bdrv_has_zero_init

Depending on the subformat, has_zero_init queries underlying storage for
flat extent. If it has a flat extent and its underlying storage doesn't
have zero init, return 0. Otherwise return 1.

Aligns the operator assignments....

3494d650 07/05/2013 10:40 am Fam Zheng

curl: refuse to open URL from HTTP server without range support

CURL driver requests partial data from server on guest IO req. For HTTP
and HTTPS, it uses "Range: ***" in requests, and this will not work if
server not accepting range. This patch does this check when open....

3ac21627 06/28/2013 02:52 pm Peter Lieven

block: change default of .has_zero_init to 0

.has_zero_init defaults to 1 for all formats and protocols.

this is a dangerous default since this means that all
new added drivers need to manually overwrite it to 0 if
they do not ensure that a device is zero initialized...

72c6cc94 06/28/2013 11:21 am Kevin Wolf

vpc: Implement .bdrv_has_zero_init

Depending on the subformat, has_zero_init on VHD must behave like raw
and query the underlying storage (fixed) or like other sparse formats
that can always return 1 (dynamic, differencing).

Signed-off-by: Kevin Wolf <>

f59fee8d 06/28/2013 10:20 am Kevin Wolf

block: Make BlockJobTypes const

Signed-off-by: Kevin Wolf <>

0b3f21e6 06/28/2013 10:20 am Richard W.M. Jones

block/ssh: Set bdrv_has_zero_init according to the file type.

If the remote is a regular file, set it to true (ie. reads of
uninitialized areas in a newly created file will return zeroes).
If we can't prove that, return false (a safe default).

Tested by adding a debugging print statement [not part of this commit]...

8ab6feec 06/28/2013 10:20 am Kevin Wolf

gluster: Return bdrv_has_zero_init = 0

GlusterFS volumes can be backed by block devices, in which case
bdrv_create() doesn't make sure that the image is zeroed out. It is
currently not possibly to detect whether a given image is backed by a
file or a block device, and incorrectly assuming that it is zeroed...

8ed610a1 06/28/2013 10:20 am Fam Zheng

vmdk: remove wrong calculation of relative path

When creating image with backing file, the driver tries to calculate the
relative path from created image file to backing file, but the path
computation is incorrect. e.g.:

$ qemu-img create -f vmdk -b vmdk-data-disk.vmdk vmdk-data-snapshot1...
a5c5ea3f 06/28/2013 10:20 am Kevin Wolf

raw-posix: Fix /dev/cdrom magic on OS X

The raw-posix driver has code to provide a /dev/cdrom on OS X even
though it doesn't really exist. However, since commit c66a6157 the real
filename is dismissed after finding it, so opening /dev/cdrom fails.
Put the filename back into the options QDict to make this work again....

98d2c6f2 06/28/2013 10:20 am Dietmar Maurer

block: add basic backup support to block driver

backup_start() creates a block job that copies a point-in-time snapshot
of a block device to a target block device.

We call backup_do_cow() for each write during backup. That function
reads the original data from the block device before it gets...

96c51eb5 06/24/2013 11:25 am Fam Zheng

vmdk: refuse to open higher version than supported

Refuse to open higher version for safety.

Although we try to be compatible with published VMDK spec, VMware has
newer version from ESXi 5.1 exported OVF/OVA, which we have no knowledge
what's changed in it. And it is very likely to have more new versions in...

6cfcb9b8 06/24/2013 11:25 am Kevin Wolf

qcow2: Add refcount update reason to all callers

This adds a refcount update reason to all callers of update_refcounts(),
so that a follow-up patch can use this information to decide whether
clusters that reach a refcount of 0 should be discarded in the image...

67af674e 06/24/2013 11:25 am Kevin Wolf

qcow2: Options to enable discard for freed clusters

Deleted snapshots are discarded in the image file by default, discard
requests take their default from the -drive discard=... option and other
places that free clusters must always be enabled explicitly....

0b919fae 06/24/2013 11:25 am Kevin Wolf

qcow2: Batch discards

This optimises the discard operation for freed clusters by batching
discard requests (both snapshot deletion and bdrv_discard end up
updating the refcounts cluster by cluster).

Note that we don't discard asynchronously, but keep s->lock held. This...

3ed8a843 06/18/2013 06:06 pm Anthony Liguori

Merge remote-tracking branch 'bonzini/scsi-next' into staging

  1. By Paolo Bonzini (3) and others
  2. Via Paolo Bonzini
    • bonzini/scsi-next:
      iscsi: reorganize iscsi_readcapacity_sync
      iscsi: simplify freeing of tasks
      vhost-scsi: fix k->set_guest_notifiers() NULL dereference...
f0d2a4d4 06/18/2013 01:43 pm Paolo Bonzini

iscsi: simplify freeing of tasks

Always free them in the iscsi_aio_*_acb functions and remove the
checks in their callers. Remove ifs when the task struct was
previously dereferenced (spotted by Coverity).

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

1288844e 06/18/2013 01:43 pm Paolo Bonzini

iscsi: reorganize iscsi_readcapacity_sync

Avoid the goto, and use the same retry logic for the 10- and 16-
byte versions.

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

23307908 06/18/2013 12:43 pm Ján Tomko

nbd: strip braces from literal IPv6 address in URI

Otherwise they would get passed to getaddrinfo and fail with:
address resolution failed for [::1]:1234: Name or service not known

(Broken by commit v1.4.0-736-gf17c90b)

Signed-off-by: Ján Tomko <>...

21a885a7 06/17/2013 09:14 pm Anthony Liguori

Merge remote-tracking branch 'luiz/queue/qmp' into staging

  1. By Luiz Capitulino
  2. Via Luiz Capitulino
    • luiz/queue/qmp:
      qerror: drop QERR_OPEN_FILE_FAILED macro
      block: bdrv_reopen_prepare(): don't use QERR_OPEN_FILE_FAILED
      savevm: qmp_xen_save_devices_state(): use error_setg_file_open()...
a7cea2ba 06/17/2013 06:47 pm Richard W.M. Jones

block/curl.c: Refuse to open the handle for writes.

Signed-off-by: Richard W.M. Jones <>
Signed-off-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

5a394b9e 06/17/2013 06:47 pm Stefan Hajnoczi

vmdk: byteswap VMDK4Header.desc_offset field

Remember to byteswap VMDK4Header.desc_offset on big-endian machines.

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

8da1aa15 06/17/2013 06:47 pm Richard W.M. Jones

curl: Don't set curl options on the handle just before it's going to be deleted.

(Found by Kamil Dudka)

Signed-off-by: Richard W.M. Jones <>
Cc: Michael Tokarev <>
Signed-off-by: Kevin Wolf <>

0bed087d 06/17/2013 06:47 pm Evgeny Budilovsky

vmdk: Allow reading variable size descriptor files

the hard-coded 2k buffer on the stack won't allow reading big descriptor
files which can be generated when storing big images. For example 500G
vmdk splitted to 2G chunks.

Signed-off-by: Evgeny Budilovsky <>...

b579ffb3 06/17/2013 06:47 pm Liu Yuan

sheepdog: fix snapshot tag initialization

This is an old and obvious bug. We should pass snapshot_id to the
tag. Or simple command like 'qemu-img snapshot -a tag sheepdog:image' will fail

Cc:
Cc: MORITA Kazutaka <>...

cede621f 06/17/2013 06:47 pm Liu Yuan

sheepdog: support 'qemu-img snapshot -a'

Just call sd_create_branch() in the snapshot_goto to rollback the image is good
enough. With this patch, 'loadvm' process for sheepdog is modified:

Suppose we have a snapshot chain A --> B --> C, we do 'loadvm A' so as to get...

dacc26aa 06/17/2013 06:01 pm Luiz Capitulino

block: mirror_complete(): use error_setg_file_open()

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

9e5e2b23 06/11/2013 10:45 pm Richard W.M. Jones

curl: Whitespace only changes.

Trivial patch to remove odd whitespace.

Signed-off-by: Richard W.M. Jones <>
Signed-off-by: Michael Tokarev <>

fb0ed453 06/07/2013 02:37 pm Wenchao Xia

block: add snapshot info query function bdrv_query_snapshot_info_list()

This patch adds function bdrv_query_snapshot_info_list(), which will
retrieve snapshot info of an image in qmp object format. The implementation
is based on the code moved from qemu-img.c with modification to fit more...

43526ec8 06/07/2013 02:37 pm Wenchao Xia

block: add image info query function bdrv_query_image_info()

This patch adds function bdrv_query_image_info(), which will
retrieve image info in qmp object format. The implementation is
based on the code moved from qemu-img.c, but uses block layer
function to get snapshot info....

553a7e87 06/07/2013 02:37 pm Wenchao Xia

qmp: add ImageInfo in BlockDeviceInfo used by query-block

Now image info will be retrieved as an embbed json object inside
BlockDeviceInfo, backing chain info and all related internal snapshot
info can be got in the enhanced recursive structure of ImageInfo. New...

bf736fe3 06/06/2013 12:27 pm Kevin Wolf

blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events

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

de08c606 06/04/2013 02:56 pm Wenchao Xia

block: move snapshot code in block.c to block/snapshot.c

All snapshot related code, except bdrv_snapshot_dump() and
bdrv_is_snapshot(), is moved to block/snapshot.c. bdrv_snapshot_dump()
will be moved to another file later. bdrv_is_snapshot() is not related...

f364ec65 06/04/2013 02:56 pm Wenchao Xia

block: move qmp and info dump related code to block/qapi.c

This patch is a pure code move patch, except following modification:
1 get_human_readable_size() is changed to static function.
2 dump_human_image_info() is renamed to bdrv_image_info_dump().
3 in qmp_query_block() and qmp_query_blockstats, use bdrv_next(bs)...

5b917044 06/04/2013 02:56 pm Wenchao Xia

block: dump snapshot and image info to specified output

bdrv_snapshot_dump() and bdrv_image_info_dump() do not dump to a buffer now,
some internal buffers are still used for format control, which have no
chance to be truncated. As a result, these two functions have no more issue...

ce3a4718 05/18/2013 03:35 pm Qiao Nuohan

Remove twice include of qemu-common.h

This patch is used to remove twice include of "qemu-common.h" in
block/win32-aio.c

Signed-off-by: Qiao Nuohan <>
Reviewed-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

2cf7cfa1 05/14/2013 05:44 pm Kevin Wolf

qcow2: Catch some L1 table index overflows

This catches the situation that is described in the bug report at
https://bugs.launchpad.net/qemu/+bug/865518 and goes like this:

$ qemu-img create -f qcow2 huge.qcow2 $((1024*1024))T
Formatting 'huge.qcow2', fmt=qcow2 size=1152921504606846976 encryption=off cluster_size=65536 lazy_refcounts=off...
c7e775e4 05/12/2013 12:25 pm Dong Xu Wang

remove double semicolons

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Michael Tokarev <>

cdeaf1f1 05/03/2013 11:33 am Fam Zheng

vmdk: add bdrv_co_write_zeroes

Use special offset to write zeroes efficiently, when zeroed-grain GTE is
available. If zero-write an allocated cluster, cluster is leaked because
its offset pointer is overwritten by "0x1".

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

e304e8e5 05/03/2013 11:33 am Fam Zheng

vmdk: store fields of VmdkMetaData in cpu endian

Previously VmdkMetaData.offset is stored little endian while other
fields are cpu endian. This changes offset to cpu endian and convert
before writing to image.
Signed-off-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>

95b0aa42 05/03/2013 11:33 am Fam Zheng

vmdk: change magic number to macro

Two hard coded flag bits are changed to macros.
Signed-off-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>

69e0b6df 05/03/2013 11:33 am Fam Zheng

vmdk: Add option to create zeroed-grain image

Add image create option "zeroed-grain" to enable zeroed-grain GTE
feature of vmdk sparse extents. When this option is on, header version
of newly created extent will be 2 and VMDK4_FLAG_ZERO_GRAIN flag bit
will be set....

14ead646 05/03/2013 11:33 am Fam Zheng

vmdk: add support for “zeroed‐grain” GTE

Introduced support for zeroed-grain GTE, as specified in Virtual Disk
Format 5.01.

Recent VMware hosted platform products support a new “zeroed‐grain”
grain table entry (GTE). The zeroed‐grain GTE returns all zeros on...
65f74725 05/03/2013 11:33 am Fam Zheng

vmdk: named return code.

Internal routines in vmdk.c previously return -1 on error and 0 on
success. More return values are useful for future changes such as
zeroed-grain GTE. Change all the magic `return 0` and `return -1` to
macro names:

  • VMDK_OK 0...
203cdba3 05/03/2013 11:31 am Jeff Cody

block: vhdx header for the QEMU support of VHDX images

This is based on Microsoft's VHDX specification:
"VHDX Format Specification v0.95", published 4/12/2012
https://www.microsoft.com/en-us/download/details.aspx?id=29681

These structures define the various header, metadata, and other...

e8d4e5ff 05/03/2013 11:31 am Jeff Cody

block: initial VHDX driver support framework - supports open and probe

This is the initial block driver framework for VHDX image support
(i.e. Hyper-V image file formats), that supports opening VHDX files, and
parsing the headers.

This commit does not yet enable:...

059e2fbb 05/03/2013 11:31 am Jeff Cody

block: add read-only support to VHDX image format.

This adds in read-only support to the VHDX image format. This supports
reads for fixed-size, and dynamic sized VHDX images.

Differencing files are still unsupported.

The image must be opened without BDRV_O_RDWR set, because we do not...

859e5553 04/26/2013 02:37 pm Liu Yuan

sheepdog: fix loadvm operation

Currently the 'loadvm' opertaion works as following:
1. switch to the snapshot
2. mark current working VDI as a snapshot
3. rely on sd_create_branch to create a new working VDI based on the snapshot

This works not the same as other format as QCOW2. For e.g,...

e8bfaa2f 04/26/2013 02:26 pm Liu Yuan

sheepdog: use BDRV_SECTOR_SIZE

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

8d71c631 04/26/2013 02:26 pm Liu Yuan

sheepdog: implement .bdrv_co_is_allocated()

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

c3ca988d 04/26/2013 02:26 pm Kevin Wolf

rbd: Fix use after free in rbd_open()

Commit a9ccedc3 frees the QemuOpts for the driver-specific options
immediately, even though it still needs the filename string that is
contained there. This doesn't work. Move the deletion of the QemuOpts to
the end of the function where its content isn't needed any more....

982dcbf4 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: cleanup find_vdi_name

This makes 'filename' and 'tag' constant variables, and renames
'for_snapshot' to 'lock' to clear how it works.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Stefan Hajnoczi <>

6a0b5490 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: add SD_RES_READONLY result code

Sheepdog returns SD_RES_READONLY when qemu sends write requests to the
snapshot vdi. This adds the result code and makes sd_strerror() print
its error reason.

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

9ff53a0e 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: add helper function to reload inode

This adds a helper function to update the current inode state with the
specified vdi object.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Stefan Hajnoczi <>

13c31de2 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: resend write requests when SD_RES_READONLY is received

When a snapshot is taken from out side of qemu (e.g. qemu-img
snapshot), write requests to the current vdi return SD_RES_READONLY.
In this case, the sheepdog block driver needs to update the current...