Statistics
| Branch: | Revision:

root / block @ e304e8e5

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

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

sheepdog: add discard/trim support for sheepdog

The 'TRIM' command from VM that is to release underlying data storage for
better thin-provision is already supported by the Sheepdog.

This patch adds the TRIM support at QEMU part.

For older Sheepdog that doesn't support it, we return 0(success) to upper layer....

f1ab7a5a 04/22/2013 04:08 pm Anthony Liguori

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

  1. By Kevin Wolf (16) and Stefan Hajnoczi (4)
  2. Via Kevin Wolf
    • kwolf/for-anthony:
      qemu-iotests: add 053 unaligned compressed image size test
      block: Allow overriding backing.file.filename
      block: Remove filename parameter from .bdrv_file_open()...
25690739 04/22/2013 04:05 pm Anthony Liguori

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

  1. By Stefan Hajnoczi
  2. Via Paolo Bonzini
    • bonzini/nbd-next:
      nbd: set TCP_NODELAY
      nbd: use TCP_CORK in nbd_co_send_request()
      nbd: unlock mutex in nbd_co_send_request() error path

Message-id: ...

56d1b4d2 04/22/2013 12:34 pm Kevin Wolf

block: Remove filename parameter from .bdrv_file_open()

It is unused now in all block drivers.

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

31ca6d07 04/22/2013 11:27 am Kevin Wolf

block: Add driver-specific options for backing files

Options starting in "backing." are passed to the backing file now. If
you don't need to specify the filename for the backing file, you can add
it on the command line instead of in the image file:

$ qemu-nbd -t /tmp/test.img...

c66a6157 04/22/2013 11:27 am Kevin Wolf

raw-posix: Use bdrv_open options instead of filename

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

8a79380b 04/22/2013 11:27 am Kevin Wolf

raw-win32: Use bdrv_open options instead of filename

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

f4681212 04/22/2013 11:27 am Kevin Wolf

blkdebug: Use bdrv_open options instead of filename

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

16c79092 04/22/2013 11:27 am Kevin Wolf

blkverify: Use bdrv_open options instead of filename

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

8e6d58cd 04/22/2013 11:27 am Kevin Wolf

curl: Use bdrv_open options instead of filename

As a bonus, going through the QemuOpts QEMU_OPT_SIZE parser for the
readahead option gives us proper error reporting that the previous use
of atoi() lacked.

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

b4894776 04/22/2013 11:27 am Kevin Wolf

gluster: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

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

60beb341 04/22/2013 11:27 am Kevin Wolf

iscsi: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

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

a9ccedc3 04/22/2013 11:27 am Kevin Wolf

rbd: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

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

c8c96350 04/22/2013 11:27 am Kevin Wolf

sheepdog: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

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

7ad9be64 04/22/2013 11:27 am Kevin Wolf

vvfat: Use bdrv_open options instead of filename

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

f4d38bef 04/22/2013 11:27 am Stefan Hajnoczi

qcow2: allow sub-cluster compressed write to last cluster

Compression in qcow2 requires image length to be a multiple of the
cluster size. Lift this requirement by zero-padding the final cluster
when necessary. The virtual disk size is still not cluster-aligned, so...

16b3c5cd 04/22/2013 11:27 am Stefan Hajnoczi

qcow: allow sub-cluster compressed write to last cluster

Compression in qcow requires image length to be a multiple of the
cluster size. Lift this requirement by zero-padding the final cluster
when necessary. The virtual disk size is still not cluster-aligned, so...

c7a101f5 04/19/2013 12:45 pm Richard W.M. Jones

ssh: Remove unnecessary use of strlen function.

Reviewed-by: Eric Blake <>
Reviewed-by: Stefan Weil <>

Signed-off-by: Stefan Hajnoczi <>

6ae7d660 04/19/2013 12:44 pm Stefan Weil

block/ssh: Add missing gcc format attributes

Now gcc will check whether format string and variable arguments match.

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

97ebbab0 04/15/2013 05:35 pm Stefan Hajnoczi

nbd: set TCP_NODELAY

Disable the Nagle algorithm to reduce latency. Note this means we must
also use TCP_CORK when sending header followed by payload to avoid
fragmenting lots of little packets. The previous patch took care of
that.

Suggested-by: Nick Thomas <>...

0fcece25 04/15/2013 05:30 pm Stefan Hajnoczi

nbd: use TCP_CORK in nbd_co_send_request()

Use TCP_CORK to defer packet transmission until both the header and the
payload have been written.

Suggested-by: Nick Thomas <>
Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Paolo Bonzini <>

6760c47a 04/15/2013 05:29 pm Stefan Hajnoczi

nbd: unlock mutex in nbd_co_send_request() error path

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

0a12ec87 04/15/2013 11:18 am Richard W.M. Jones

block: Add support for Secure Shell (ssh) block device.

qemu-system-x86_64 -drive file=ssh://hostname/some/image

QEMU will ssh into 'hostname' and open '/some/image' which is made
available as a standard block device.

You can specify a username (ssh://user@host/...) and/or a port number...

9a2d462e 04/15/2013 11:18 am Richard W.M. Jones

block: ssh: Use libssh2_sftp_fsync (if supported by libssh2) to flush to disk.

libssh2_sftp_fsync is an extension to libssh2 to support fsync(2) over
sftp, which is itself an extension of OpenSSH.

If both libssh2 and the ssh daemon support it, this will allow...

dc7588c1 04/15/2013 11:18 am Josh Durgin

rbd: add an asynchronous flush

The existing bdrv_co_flush_to_disk implementation uses rbd_flush(),
which is sychronous and causes the main qemu thread to block until it
is complete. This results in unresponsiveness and extra latency for
the guest.

Fix this by using an asynchronous version of flush. This was added to...

cf8074b3 04/15/2013 09:26 am Kevin Wolf

block: Introduce bdrv_writev_vmstate

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

8d3b1a2d 04/15/2013 09:26 am Kevin Wolf

block: Introduce bdrv_pwritev() for qcow2_save_vmstate

Directly pass the QEMUIOVector on instead of linearising it.

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

753d9b82 04/13/2013 02:51 pm Aurelien Jarno

aes: move aes.h from include/block to include/qemu

Move aes.h from include/block to include/qemu to show it can be reused
by other subsystems.

Cc: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>
Reviewed-by: Edgar E. Iglesias <>...

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

c2bc78b6 04/05/2013 07:58 pm Kevin Wolf

qcow2: Return real error in qcow2_update_snapshot_refcount

This fixes the error message triggered by the following script:

cat > /tmp/blkdebug.cfg <&lt;EOF
[inject-error]
event = "cluster_free"
errno = "28"
immediately = "off"
EOF
$qemu_img create -f qcow2 test.qcow2 10G...
c2b6ff51 04/05/2013 07:58 pm Kevin Wolf

qcow2: Fix L1 write error handling in qcow2_update_snapshot_refcount

It ignored the error code, and at least the 'goto fail' is obvious
nonsense as it creates an endless loop (if the next attempt doesn't
magically succeed) and leaves the in-memory L1 table in big-endian...

f9e8cacc 04/02/2013 06:47 pm Stefan Hajnoczi

oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()

The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.
Rename to qemu_set_nonblock() just like qemu_set_cloexec().

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

710c2496 03/28/2013 12:52 pm Kevin Wolf

qcow2: Use byte granularity in qcow2_alloc_cluster_offset()

This gets rid of the nb_clusters and keep_clusters and the associated
complicated calculations. Just advance the number of bytes that have
been processed and everything is fine.

This patch advances the variables even after the last operation even...

88c6588c 03/28/2013 12:52 pm Kevin Wolf

qcow2: Allow requests with multiple l2metas

Instead of expecting a single l2meta, have a list of them. This allows
to still have a single I/O request for the guest data, even though
multiple l2meta may be needed in order to describe both a COW overwrite
and a new cluster allocation (typical sequential write case)....

2c3b32d2 03/28/2013 12:52 pm Kevin Wolf

qcow2: Move cluster gathering to a non-looping loop

This patch is mainly to separate the indentation change from the
semantic changes. All that really changes here is that everything moves
into a while loop, all 'goto done' become 'break' and at the end of the...

ecdd5333 03/28/2013 12:52 pm Kevin Wolf

qcow2: Gather clusters in a looping loop

Instead of just checking once in exactly this order if there are
dependendies, non-COW clusters and new allocation, this starts looping
around these. This way we can, for example, gather non-COW clusters after
new allocations as long as the host cluster offsets stay contiguous....

d9d74f41 03/28/2013 12:52 pm Kevin Wolf

qcow2: Improve check for overlapping allocations

The old code detected an overlapping allocation even when the
allocations didn't actually overlap, but were only adjacent.

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

65eb2e35 03/28/2013 12:52 pm Kevin Wolf

qcow2: Change handle_dependency to byte granularity

This is a more precise description of what really constitutes a
dependency. The behaviour doesn't change at this point because the COW
area of the old request is still aligned to cluster boundaries and
therefore an overlap is detected wheneven the requests touch any part of...

037689d8 03/28/2013 12:52 pm Kevin Wolf

qcow2: Decouple cluster allocation from cluster reuse code

This moves some code that prepares the allocation of new clusters to
where the actual allocation happens. This is the minimum required to be
able to move it to a separate function in the next patch....

10f0ed8b 03/28/2013 12:52 pm Kevin Wolf

qcow2: Factor out handle_alloc()

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

f5bc6350 03/28/2013 12:52 pm Kevin Wolf

qcow2: handle_alloc(): Get rid of nb_clusters parameter

We already communicate the same information in *bytes.

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

3b8e2e26 03/28/2013 12:52 pm Kevin Wolf

qcow2: handle_alloc(): Get rid of keep_clusters parameter

handle_alloc() is now called with the offset at which the actual new
allocation starts instead of the offset at which the whole write request
starts, part of which may already be processed.

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

c37f4cd7 03/28/2013 12:52 pm Kevin Wolf

qcow2: Finalise interface of handle_alloc()

The interface works completely on a byte granularity now and duplicated
parameters are removed.

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

83baa9a4 03/28/2013 12:52 pm Kevin Wolf

qcow2: Clean up handle_alloc()

Things can be simplified a bit now. No semantic changes.

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

0af729ec 03/28/2013 12:52 pm Kevin Wolf

qcow2: Factor out handle_copied()

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

acb0467f 03/28/2013 12:52 pm Kevin Wolf

qcow2: handle_copied(): Get rid of nb_clusters parameter

handle_copied() uses its bytes parameter now to determine how many
clusters it should try to find.

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

c53ede9f 03/28/2013 12:52 pm Kevin Wolf

qcow2: handle_copied(): Get rid of keep_clusters parameter

Now *bytes is used to return the length of the area that can be written
to without performing an allocation or COW.

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

e62daaf6 03/28/2013 12:52 pm Kevin Wolf

qcow2: handle_copied(): Implement non-zero host_offset

Look only for clusters that start at a given physical offset.

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

411d62b0 03/28/2013 12:52 pm Kevin Wolf

qcow2: Prepare handle_alloc/copied() for byte granularity

This makes handle_alloc() and handle_copied() return byte-granularity
host offsets instead of returning always the cluster start. This is
required so that qcow2_alloc_cluster_offset() can stop aligning...

c349ca4b 03/28/2013 12:52 pm Kevin Wolf

qcow2: Fix "total clusters" number in bdrv_check

This should be based on the virtual disk size, not on the size of the
image.

Interesting observation: With some VM state stored in the image file,
percentages higher than 100% are possible, even though snapshots...

9ee6439e 03/28/2013 12:52 pm Kevin Wolf

qcow2: Remove bogus unlock of s->lock

The unlock wakes up the next coroutine, but the currently running
coroutine will lock it again before it yields, so this doesn't make a
lot of sense.

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

17a71e58 03/28/2013 12:52 pm Kevin Wolf

qcow2: Handle dependencies earlier

Handling overlapping allocations isn't just a detail of cluster
allocation. It is rather one of three ways to get the host cluster
offset for a write request:

1. If a request overlaps an in-flight allocations, the cluster offset...

ea804cad 03/25/2013 10:53 am Stefan Weil

block: Add options QDict to bdrv_file_open() prototypes (fix MinGW build)

The new parameter is unused yet.

This part was missing in commit 787e4a8500020695eb391e2f1cc4767ee071d441.

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

d43731c7 03/25/2013 10:51 am Liu Yuan

rbd: fix compile error

Commit 787e4a85 [block: Add options QDict to bdrv_file_open() prototypes] didn't
update rbd.c accordingly.

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

f53a1feb 03/22/2013 06:51 pm Kevin Wolf

nbd: Accept -drive options for the network connection

The existing parsers for the file name now parse everything into the
bdrv_open() options QDict. Instead of using these parsers, you can now
directly specify the options on the command line, like this:...

6963a30d 03/22/2013 06:51 pm Kevin Wolf

block: Introduce .bdrv_parse_filename callback

If a driver needs structured data and not just a string, it can provide
a .bdrv_parse_filename callback now that parses the command line string
into separate options. Keeping this separate from .bdrv_open_filename...

f5866fa4 03/22/2013 06:51 pm Kevin Wolf

block: Make find_image_format safe with NULL filename

In order to achieve this, the .bdrv_probe callbacks of all drivers must
cope with this. The DMG driver is the only one that bases its decision
on the filename and it needs to be changed.

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

bebbf7fa 03/22/2013 06:51 pm Kevin Wolf

nbd: Use default port if only host is specified

The URL method already takes care to apply the default port when none is
specfied. Directly specifying driver-specific options required the port
number until now. Allow leaving it out and apply the default....

681e7ad0 03/22/2013 06:51 pm Kevin Wolf

nbd: Check against invalid option combinations

A file name may only specified if no host or socket path is specified.
The latter two may not appear at the same time either.

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

787e4a85 03/22/2013 06:51 pm Kevin Wolf

block: Add options QDict to bdrv_file_open() prototypes

The new parameter is unused yet.

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

f17c90be 03/22/2013 06:51 pm Kevin Wolf

nbd: Keep hostname and port separate

The NBD block supports an URL syntax, for which a URL parser returns
separate hostname and port fields. It also supports the traditional qemu
syntax encoded in a filename. Until now, after parsing the URL to get
each piece of information, a new string is built to be fed to socket...

fca23f0a 03/19/2013 12:48 pm Liu Yuan

sheepdog: show error message for halt status

Sheepdog (neither quorum nor unsafe mode) will refuse to serve IO requests when
number of alive nodes is less than that of copies specified by users. This will
return 0x19 to QEMU client which currently doesn't recognize it....

acdfb480 03/19/2013 12:48 pm Kevin Wolf

qcow2: Fix segfault in qcow2_invalidate_cache

Need to pass an options QDict to qcow2_open() now. This fixes a segfault
on the migration target with qcow2.

Signed-off-by: Kevin Wolf <>

c4d9d196 03/15/2013 05:07 pm Stefan Hajnoczi

threadpool: drop global thread pool

Now that each AioContext has a ThreadPool and the main loop AioContext
can be fetched with bdrv_get_aio_context(), we can eliminate the concept
of a global thread pool from thread-pool.c.

The submit functions must take a ThreadPool* argument....

f6977f15 03/15/2013 05:07 pm Stefan Hajnoczi

qcow2: flush refcount cache correctly in qcow2_write_snapshots()

Since qcow2 metadata is cached we need to flush the caches, not just the
underlying file. Use bdrv_flush(bs) instead of bdrv_flush(bs->file).

Also add the error return path when bdrv_flush() fails and move the...

c1f5bafd 03/15/2013 05:07 pm Stefan Hajnoczi

qcow2: set L2 cache dependency in qcow2_alloc_bytes()

Compressed writes use qcow2_alloc_bytes() to allocate space with byte
granularity. The affected clusters' refcounts will be incremented but
we do not need to flush yet.

Set a L2 cache dependency on the refcount block cache, so that the...

2154f24e 03/15/2013 05:07 pm Stefan Hajnoczi

qcow2: flush in qcow2_update_snapshot_refcount()

Users of qcow2_update_snapshot_refcount() do not flush consistently.
qcow2_snapshot_create() flushes but qcow2_snapshot_goto() and
qcow2_snapshot_delete() do not.

Solve this by moving the bdrv_flush() into...

f9cb2860 03/15/2013 05:07 pm Stefan Hajnoczi

qcow2: drop flush in update_cluster_refcount()

The update_cluster_refcount() function increments/decrements a cluster's
refcount and then returns the new refcount value.

There is no need to flush since both update_cluster_refcount() callers
already take care of this:...

36479179 03/15/2013 05:07 pm Stefan Hajnoczi

qcow2: drop unnecessary flush in qcow2_update_snapshot_refcount()

We already flush when the function completes. There is no need to flush
after every compressed cluster.

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

381b487d 03/15/2013 05:07 pm Paolo Bonzini

qcow2: make is_allocated return true for zero clusters

Otherwise, live migration of the top layer will miss zero clusters and
let the backing file show through. This also matches what is done in qed.

QCOW2_CLUSTER_ZERO clusters are invalid in v2 image files. Check this...

0d6db300 03/15/2013 05:07 pm MORITA Kazutaka

sheepdog: use non-blocking fd in coroutine context

Using a blocking socket in the coroutine context reduces the chance of
switching to other work. This patch makes the sheepdog driver use a
non-blocking fd always.

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

ed9ba724 03/15/2013 05:07 pm MORITA Kazutaka

sheepdog: set io_flush handler in do_co_req

If an io_flush handler is not set, qemu_aio_wait doesn't invoke
callbacks.

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

1a86938f 03/15/2013 05:07 pm Kevin Wolf

block: Add options QDict to .bdrv_open()

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

de9c0cec 03/15/2013 05:07 pm Kevin Wolf

block: Add options QDict to bdrv_open() prototype

It doesn't do anything yet except storing the options QDict in the
BlockDriverState.

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

74c4510a 03/15/2013 05:07 pm Kevin Wolf

qcow2: Allow lazy refcounts to be enabled on the command line

qcow2 images now accept a boolean lazy_refcounts options. Use it like
this:

-drive file=test.qcow2,lazy_refcounts=on

If the option is specified on the command line, it overrides the default...

9991923b 03/15/2013 05:07 pm Stefan Hajnoczi

qcow2: flush refcount cache correctly in alloc_refcount_block()

update_refcount() affects the refcount cache, it does not write to disk.
Therefore bdrv_flush(bs->file) does nothing. We need to flush the
refcount cache in order to write out the refcount updates!...

cb1b83e7 03/05/2013 06:51 pm Peter Lieven

iscsi: add iscsi_truncate support

this patch adds iscsi_truncate which effectively allows for
online resizing of iscsi volumes. for this to work you have
to resize the volume on your storage and then call
block_resize command in qemu which will issue a
readcapacity16 to update the capacity....

1dde716e 03/05/2013 06:51 pm Peter Lieven

iscsi: retry read, write, flush and unmap on unit attention check conditions

the storage might return a check condition status for various reasons.
(e.g. bus reset, capacity change, thin-provisioning info etc.)

currently all these informative status responses lead to an I/O error...

bf1c852a 03/04/2013 10:54 am MORITA Kazutaka

move socket_set_nodelay to osdep.c

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

5d6768e3 03/04/2013 10:54 am MORITA Kazutaka

sheepdog: accept URIs

The URI syntax is consistent with the NBD and Gluster syntax. The
syntax is

sheepdog[+tcp]://[host:port]/vdiname[#snapid|#tag]

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

25af257d 03/04/2013 10:54 am MORITA Kazutaka

sheepdog: use inet_connect to simplify connect code

This uses the form "<host>:<port>" for the representation of the
sheepdog server to use inet_connect.

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

1b8bbb46 03/04/2013 10:54 am MORITA Kazutaka

sheepdog: add support for connecting to unix domain socket

This patch adds support for a unix domain socket for a connection
between qemu and local sheepdog server. You can use the unix domain
socket with the following syntax:

$ qemu sheepdog+unix:///&lt;vdiname&gt;?socket=&lt;socket path&gt;[#snapid]...
fba31bae 02/22/2013 10:21 pm Stefan Hajnoczi

qcow2: record fragmentation statistics during check

The qemu-img check command can display fragmentation statistics: * Total number of clusters in virtual disk * Number of allocated clusters * Number of fragmented clusters

This patch adds fragmentation statistics support to qcow2....

4db35162 02/22/2013 10:21 pm Stefan Hajnoczi

qcow2: support compressed clusters in BlockFragInfo

Signed-off-by: Stefan Hajnoczi <>