Statistics
| Branch: | Revision:

root / block @ 3d1807ac

# Date Author Comment
3d1807ac 09/24/2012 04:15 pm Jeff Cody

block: purge s->aligned_buf and s->aligned_buf_size from raw-posix.c

The aligned_buf pointer and aligned_buf size are no longer used in
raw_posix.c, so remove all references to them.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

fc32a72d 09/24/2012 04:15 pm Jeff Cody

block: move aio initialization into a helper function

Move AIO initialization for raw-posix block driver into a helper function.

In addition to just code motion, the aio_ctx pointer is checked for NULL,
prior to calling laio_init(), to make sure laio_init() is only run once....

6a8dc042 09/24/2012 04:15 pm Jeff Cody

block: move open flag parsing in raw block drivers to helper functions

Code motion, to move parsing of open flags into a helper function.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

39c9fb95 09/24/2012 04:15 pm Jeff Cody

block: do not parse BDRV_O_CACHE_WB in block drivers

Block drivers should ignore BDRV_O_CACHE_WB in .bdrv_open flags,
and in the bs->open_flags.

This patch removes the code, leaving the behaviour behind as if
BDRV_O_CACHE_WB was set.

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

9acc5a06 09/24/2012 04:15 pm Jeff Cody

block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c

Rather than check for a non-NULL aligned_buf to determine if
raw_aio_submit needs to check for alignment, check for the presence
of BDRV_O_NOCACHE in the bs->open_flags.

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

1f7a48de 09/12/2012 04:50 pm MORITA Kazutaka

sheepdog: fix savevm and loadvm

This patch sets data to be sent to Sheepdog correctly and fixes savevm
and loadvm operations on a Sheepdog image.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

45724d6d 09/12/2012 04:50 pm Stefan Weil

block/curl: Fix wrong free statement

Report from smatch:
block/curl.c:546 curl_close(21) info: redundant null check on s->url calling free()

The check was redundant, and free was also wrong because the memory
was allocated using g_strdup.

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

514f21a5 09/12/2012 04:50 pm Stefan Weil

vdi: Fix warning from clang

ccc-analyzer reports these warnings:

block/vdi.c:704:13: warning: Dereference of null pointer
bmap[i] = VDI_UNALLOCATED;
^
block/vdi.c:702:13: warning: Dereference of null pointer
bmap[i] = i;...

cdedd9d8 08/31/2012 06:04 pm Anthony Liguori

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

  • kwolf/for-anthony:
    qemu-iotests: add backing file smaller than image test case
    stream: complete early if end of backing file is reached
    qed: refuse unaligned zero writes with a backing file
ef72f76e 08/29/2012 04:23 pm Stefan Hajnoczi

qed: refuse unaligned zero writes with a backing file

Zero writes have cluster granularity in QED. Therefore they can only be
used to zero entire clusters.

If the zero write request leaves sectors untouched, zeroing the entire
cluster would obscure the backing file. Instead return -ENOTSUP, which...

571cd9dc 08/29/2012 04:23 pm Stefan Hajnoczi

stream: complete early if end of backing file is reached

It is possible to create an image that is larger than its backing file.
Reading beyond the end of the backing file produces zeroes if no writes
have been made to those sectors in the image file.

This patch finishes streaming early when the end of the backing file is...

135b9088 08/28/2012 03:50 pm Ronnie Sahlberg

iscsi: Set number of blocks to 0 for blank CDROM devices

The number of blocks of the device is used to compute the device size
in bdrv_getlength()/iscsi_getlength().
For MMC devices, the ReturnedLogicalBlockAddress in the READCAPACITY10
has a special meaning when it is 0....

a9b670b1 08/22/2012 09:31 pm Anthony Liguori

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

  • bonzini/scsi-next:
    virtio-scsi: add backwards-compatibility properties for 1.1 and earlier machines
    iscsi: fix races between task completion and abort
    iscsi: simplify iscsi_schedule_bh...
7b2f89c4 08/22/2012 09:01 pm Anthony Liguori

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

  • kwolf/for-anthony:
    virtio-blk: hide VIRTIO_BLK_F_CONFIG_WCE from old machine types
    Documentation: Warn against qemu-img on active image
    vmdk: Read footer for streamOptimized images
    vmdk: Fix header structure...
a7e47d4b 08/22/2012 06:47 pm Jim Meyering

sheepdog: don't leak socket file descriptor upon connection failure

Signed-off-by: Jim Meyering <>
Signed-off-by: Anthony Liguori <>

27cbd828 08/20/2012 04:58 pm Paolo Bonzini

iscsi: move iscsi_schedule_bh and iscsi_readv_writev_bh_cb

Put these functions at the beginning, to avoid forward references
in the next patches.

Signed-off-by: Paolo Bonzini <>

cfb3f506 08/20/2012 04:58 pm Paolo Bonzini

iscsi: simplify iscsi_schedule_bh

It is always used with the same callback, remove the argument. And
its return value is never used, assume allocation succeeds.

Signed-off-by: Paolo Bonzini <>

1bd075f2 08/20/2012 04:58 pm Paolo Bonzini

iscsi: fix races between task completion and abort

This patch fixes two main issues with block/iscsi.c:

1) iscsi_task_mgmt_abort_task_async calls iscsi_scsi_task_cancel which
was also directly called in iscsi_aio_cancel

2) a race between task completion and task abortion could happen cause...

b2090919 08/20/2012 04:50 pm Paolo Bonzini

Revert "iscsi: Fix NULL dereferences / races between task completion and abort"

This reverts commit 64e69e80920d82df3fa679bc41b13770d2f99360. The commit
returned immediately from iscsi_aio_cancel, risking corruption in case the
following happens:

guest                  qemu                 target...
65bd155c 08/17/2012 02:27 pm Kevin Wolf

vmdk: Read footer for streamOptimized images

The footer takes precedence over the header when it exists. It contains
the real grain directory offset that is missing in the header. Without
this patch, streamOptimized images with a footer cannot be read.

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

7a736bfa 08/17/2012 12:14 pm Kevin Wolf

vmdk: Fix header structure

Commit bb45ded9 swapped gd_offset and rgd_offset. This is wrong.

Signed-off-by: Kevin Wolf <>

64e69e80 08/15/2012 02:16 pm Stefan Priebe

iscsi: Fix NULL dereferences / races between task completion and abort

Signed-off-by: Stefan Priebe <>
Acked-by: Ronnie Sahlberg <>
Signed-off-by: Kevin Wolf <>

e1740828 08/15/2012 11:48 am Corey Bryant

block: Prevent detection of /dev/fdset/ as floppy

Signed-off-by: Corey Bryant <>
Signed-off-by: Kevin Wolf <>

6165f4d8 08/15/2012 11:48 am Corey Bryant

block: Convert open calls to qemu_open

This patch converts all block layer open calls to qemu_open.

Note that this adds the O_CLOEXEC flag to the changed open paths
when the O_CLOEXEC macro is defined.

Signed-off-by: Corey Bryant <>...

2e1e79da 08/15/2012 11:48 am Corey Bryant

block: Convert close calls to qemu_close

This patch converts all block layer close calls, that correspond
to qemu_open calls, to qemu_close.

Signed-off-by: Corey Bryant <>
Signed-off-by: Kevin Wolf <>

53810bab 08/12/2012 03:48 am Anthony Liguori

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

  • kwolf/for-anthony:
    qemu-iotests: skip 039 with ./check -nocache
    block: add BLOCK_O_CHECK for qemu-img check
    qcow2: mark image clean after repair succeeds
    qed: mark image clean after repair succeeds...
31294261 08/12/2012 01:11 am Anthony Liguori

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

  • bonzini/scsi-next:
    scsi-disk: add support for the UNMAP command
    scsi-disk: improve out-of-range LBA detection for WRITE SAME
    scsi-disk: more assertions and resets for aiocb
    virtio-scsi: do not compare 32-bit QEMU tags against 64-bit virtio-scsi tags...
b10170ac 08/10/2012 11:25 am Stefan Hajnoczi

qed: mark image clean after repair succeeds

The dirty bit is cleared after image repair succeeds in qed_open().
Move this into qed_check() so that all callers benefit from this
behavior when fix=true.

This is necessary so qemu-img check can call .bdrv_check() and mark the...

acbe5982 08/10/2012 11:25 am Stefan Hajnoczi

qcow2: mark image clean after repair succeeds

The dirty bit is cleared after image repair succeeds in qcow2_open().
Move this into qcow2_check() so that all callers benefit from this
behavior when fix mode is enabled.

This is necessary so qemu-img check can call .bdrv_check() and mark the...

058f8f16 08/10/2012 11:25 am Stefan Hajnoczi

block: add BLOCK_O_CHECK for qemu-img check

Image formats with a dirty bit, like qed and qcow2, repair dirty image
files upon open with BDRV_O_RDWR. Performing automatic repair when
qemu-img check runs is not ideal because the bdrv_open() call repairs
the image before the actual bdrv_check() call from qemu-img.c....

31459f46 08/09/2012 04:04 pm Ronnie Sahlberg

iscsi: Pick default initiator-name based on the name of the VM

This patch updates the iscsi layer to automatically pick a 'unique'
initiator-name based on the name of the vm in case the user has not set
an explicit iqn-name to use.

Create a new function qemu_get_vm_name() that returns the name of the VM,...

b93c94f7 08/08/2012 03:51 pm Paolo Bonzini

iscsi: do not leak initiator_name

The argument of iscsi_create_context is never freed by libiscsi,
which in fact calls strdup on it. Avoid a leak.

Signed-off-by: Paolo Bonzini <>

f2ef4a6d 08/08/2012 03:51 pm Paolo Bonzini

iscsi: reorganize code for parse_initiator_name

Merge the occurrences of the "iqn.2008-11.org.linux-kvm" string
to avoid duplication.

Signed-off-by: Paolo Bonzini <>

c61d0004 08/06/2012 11:39 pm Stefan Hajnoczi

qcow2: introduce dirty bit

This patch adds an incompatible feature bit to mark images that have not
been closed cleanly. When a dirty image file is opened a consistency
check and repair is performed.

Update qemu-iotests 031 and 036 since the extension header size changes...

bfe8043e 08/06/2012 11:39 pm Stefan Hajnoczi

qcow2: implement lazy refcounts

Lazy refcounts is a performance optimization for qcow2 that postpones
refcount metadata updates and instead marks the image dirty. In the
case of crash or power failure the image will be left in a dirty state
and repaired next time it is opened....

f91cbefe 07/17/2012 05:48 pm Markus Armbruster

vvfat: Fix partition table

Unless parameter ":floppy:" is given, vvfat creates a virtual image
with DOS MBR defining a single partition which holds the FAT file
system. The size of the virtual image depends on the width of the
FAT: 32 MiB (CHS 64, 16, 63) for 12 bit FAT, 504 MiB (CHS 1024, 16,...

4480e0f9 07/17/2012 05:48 pm Markus Armbruster

vvfat: Do not clobber the user's geometry

vvfat creates a virtual VFAT filesystem with a certain logical
geometry that depends on its options. It sets the "geometry hint" to
this geometry. It is the only block driver to do this.

The geometry hint is about about physical geometry, and used only by...

cddd4ac7 07/17/2012 05:48 pm MORITA Kazutaka

sheepdog: always use coroutine-based network functions

This reduces some code duplication.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

19db9b90 07/17/2012 05:48 pm Christoph Hellwig

sheepdog: do not blindly memset all read buffers

Only buffers that map to unallocated blocks need to be zeroed.

Signed-off-by: Christoph Hellwig <>
Acked-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

23797df3 07/09/2012 08:35 pm Anthony Liguori

Merge remote-tracking branch 'mjt/mjt-iov2' into staging

  • mjt/mjt-iov2:
    rewrite iov_send_recv() and move it to iov.c
    cleanup qemu_co_sendv(), qemu_co_recvv() and friends
    export iov_send_recv() and use it in iov_send() and iov_recv()
    rename qemu_sendv to iov_send, change proto and move declarations to iov.h...
715cc00c 07/09/2012 06:29 pm Anthony Liguori

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

  • kwolf/for-anthony: (24 commits)
    block: Factor bdrv_read_unthrottled() out of guess_disk_lchs()
    qtest: Tidy up temporary files properly
    fdc: Drop broken code for user-defined floppy geometry...
c292ee6a 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: split outstanding list into inflight and pending

outstanding_list_head is used for both pending and inflight requests.
This patch splits it and improves readability.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

7dc1cde0 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: traverse pending_list from the first for each time

The pending list can be modified in other coroutine context
sd_co_rw_vector, so we need to traverse the list from the first again
after we send the pending request.

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

820100fd 07/09/2012 04:53 pm Paolo Bonzini

blkdebug: remove sync i/o events

These are unused, except (by mistake more or less) in QED.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

368e8dd1 07/09/2012 04:53 pm Paolo Bonzini

blkdebug: tiny cleanup

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

e1302255 07/09/2012 04:53 pm Paolo Bonzini

blkdebug: pass getlength to underlying file

This is required when using blkdebug with raw format. Unlike qcow2/QED,
raw asks blkdebug for the length of the file, it doesn't get it from
a header.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

571cd43e 07/09/2012 04:53 pm Paolo Bonzini

blkdebug: store list of active rules

This prepares for the next patch, where some active rules may actually
not trigger depending on input to readv/writev. Store the active rules
in a SIMPLEQ (so that it can be emptied easily with QSIMPLEQ_INIT), and
fetch the errno/once/immediately arguments from there....

e4780db4 07/09/2012 04:53 pm Paolo Bonzini

blkdebug: optionally tie errors to a specific sector

This makes blkdebug scripts more powerful, and independent of the
exact sequence of operations performed by streaming.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

5c171afa 07/09/2012 04:53 pm Paolo Bonzini

raw: hook into blkdebug

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

b35278f7 07/09/2012 04:53 pm Stefan Hajnoczi

qcow2: fix #ifdef'd qcow2_check_refcounts() callers

The DEBUG_ALLOC qcow2.h macro enables additional consistency checks
throughout the code. This makes it easier to spot corruptions that are
introduced during development. Since consistency check is an expensive...

206e6d85 07/09/2012 04:53 pm Stefan Hajnoczi

qcow2: preserve free_byte_offset when qcow2_alloc_bytes() fails

When qcow2_alloc_clusters() error handling code was introduced in commit
5d757b563d59142ca81e1073a8e8396750a0ad1a, the value of free_byte_offset
was clobbered in the error case. This patch keeps free_byte_offset at 0...

1b6ac998 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: fix dprintf format strings

This fixes warnings about dprintf format in debug mode.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

2dfcca3b 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: restart I/O when socket becomes ready in do_co_req()

Currently, no one reenters the yielded coroutine. This fixes it.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

b97564f4 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: use coroutine based socket functions in coroutine context

This removes blocking network I/Os in coroutine context.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

1d732d7d 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: make sure we don't free aiocb before sending all requests

This patch increments the pending counter before sending requests, and
make sures that aiocb is not freed while sending them.

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

98392453 07/02/2012 11:18 am Ronnie Sahlberg

ISCSI: Add SCSI passthrough via scsi-generic to libiscsi

Update iscsi to allow passthrough of SG_IO scsi commands when the iscsi
device is forced to be scsi-generic.

Implement both bdrv_ioctl() and bdrv_aio_ioctl() in the iscsi backend,
emulate the SG_IO ioctl and pass the SCSI commands across to the...

622695a4 07/02/2012 11:18 am Ronnie Sahlberg

ISCSI: force use of sg for SMC and SSC devices

If the device we open is a SMC or SSC device, then force the use of sg. We
dont have any medium changer or tape emulation so only passthrough via
real sg or scsi-generic via iscsi would work anyway.

Forcing sg also makes qemu skip trying to read from the device to guess...

94282e71 06/24/2012 02:04 am Kevin Wolf

raw-posix: Fix build without is_allocated support

Move the declaration of s into the #ifdef sections that actually make
use of it.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Alexander Graf <>

6af4e9ea 06/15/2012 03:03 pm Paolo Bonzini

qcow2: always operate caches in writeback mode

Writethrough does not need special-casing anymore in the qcow2 caches.
The block layer adds flushes after every guest-initiated data write,
and these will also flush the qcow2 caches to the OS.

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

cdba7fee 06/15/2012 03:03 pm Kevin Wolf

qcow2: Simplify calculation for COW area at the end

copy_sectors() always uses the sum (cluster_offset + n_start) or
(start_sect + n_start), so if some value is added to both cluster_offset
and start_sect, and subtracted from n_start, it's cancelled out anyway....

b7ab0fea 06/15/2012 03:03 pm Kevin Wolf

qcow2: Fix avail_sectors in cluster allocation code

avail_sectors should really be the number of sectors from the start of
the allocation, not from the start of the write request.

We're lucky enough that this mistake didn't cause any real bug.
avail_sectors is only used in the intialiser of QCowL2Meta:...

af7b708d 06/15/2012 03:03 pm Stefan Hajnoczi

qcow2: fix autoclear image header update

The autoclear feature bits can be used for qcow2 file format features
that are safe to "drop" by old programs that do not understand the
feature. Upon opening the image file unknown autoclear feature bits are
cleared and the image file header is rewritten, but this was happening...

833e4085 06/15/2012 03:03 pm Zhi Yong Wu

qcow2: remove a line of unnecessary code

Commit 3948d1d4 removed the pointer argument we filled in with l2_offset
but forgot to remove the unnecessary l2_offset assignment.

Signed-off-by: Zhi Yong Wu <>
Reviewed-by: Stefan Hajnoczi <>...

87267753 06/15/2012 03:03 pm Zhi Yong Wu

qcow2: fix endianness conversion

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

5500316d 06/15/2012 03:03 pm Paolo Bonzini

block: implement is_allocated for raw

Either FIEMAP, or SEEK_DATA+SEEK_HOLE can be used to implement the
is_allocated callback for raw files. On Linux ext4, btrfs and XFS
all support it.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

f9749f28 06/15/2012 03:03 pm Paolo Bonzini

stream: tweak usage of bdrv_co_is_allocated

is_allocated_base has complex semantics that are not really usable
outside streaming. Split the check in two parts, where the allocated
state for the top bs is moved to the caller. The resulting function
is more generally useful....

188a7bbf 06/15/2012 03:03 pm Paolo Bonzini

stream: move is_allocated_above to block.c

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

6ef228fc 06/15/2012 03:03 pm Paolo Bonzini

stream: move rate limiting to a separate header file

Make the code reusable.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

4534ff54 06/15/2012 03:03 pm Kevin Wolf

qemu-img check -r for repairing images

The QED block driver already provides the functionality to not only
detect inconsistencies in images, but also fix them. However, this
functionality cannot be manually invoked with qemu-img, but the
check happens only automatically during bdrv_open()....

ccf34716 06/15/2012 03:03 pm Kevin Wolf

qemu-img check: Print fixed clusters and recheck

When any inconsistencies have been fixed, print the statistics and run
another check to make sure everything is correct now.

Signed-off-by: Kevin Wolf <>

166acf54 06/15/2012 03:03 pm Kevin Wolf

qcow2: Support for fixing refcount inconsistencies

Signed-off-by: Kevin Wolf <>

b11f38fc 06/15/2012 03:03 pm Josh Durgin

rbd: hook up cache options

Writeback caching was added in Ceph 0.46, and writethrough will be in
0.47. These are controlled by general config options, so there's no
need to check for librbd version.

Signed-off-by: Josh Durgin <>
Signed-off-by: Kevin Wolf <>

e0d93a89 06/15/2012 03:03 pm MORITA Kazutaka

sheepdog: add coroutine_fn markers to coroutine functions

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

1417d7e4 06/15/2012 02:52 pm Kevin Wolf

qcow2: Silence false warning

Some gcc versions seem not to be able to figure out that the switch
statement covers all possible values and that c is therefore always
initialised. Add a default branch for them.

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

03396148 06/11/2012 10:12 pm Michael Tokarev

allow qemu_iovec_from_buffer() to specify offset from which to start copying

Similar to
qemu_iovec_memset(QEMUIOVector *qiov, size_t offset,
int c, size_t bytes);
the new prototype is:
qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset,...

1b093c48 06/11/2012 10:12 pm Michael Tokarev

consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent

qemu_iovec_concat() is currently a wrapper for
qemu_iovec_copy(), use the former (with extra
"0" arg) in a few places where it is used.

Change skip argument of qemu_iovec_copy() from...

d5e6b161 06/11/2012 10:12 pm Michael Tokarev

change qemu_iovec_to_buf() to match other to,from_buf functions

It now allows specifying offset within qiov to start from and
amount of bytes to copy. Actual implementation is just a call
to iov_to_buf().

Signed-off-by: Michael Tokarev <>

2fc8ae1d 06/11/2012 10:12 pm Michael Tokarev

cleanup qemu_co_sendv(), qemu_co_recvv() and friends

The same as for non-coroutine versions in previous
patches: rename arguments to be more obvious, change
type of arguments from int to size_t where appropriate,
and use common code for send and receive paths (with...

3d9b4925 06/11/2012 10:07 pm Michael Tokarev

consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()

This patch combines two functions into one, and replaces
the implementation with already existing iov_memset() from
iov.c.

The new prototype of qemu_iovec_memset():...

7456e4ce 06/07/2012 10:21 am Paolo Bonzini

build: move block/ objects to nested Makefile.objs

Signed-off-by: Paolo Bonzini <>

c2d76497 05/30/2012 11:18 am Jim Meyering

block: prevent snapshot mode $TMPDIR symlink attack

In snapshot mode, bdrv_open creates an empty temporary file without
checking for mkstemp or close failure, and ignoring the possibility
of a buffer overrun given a surprisingly long $TMPDIR.
Change the get_tmp_filename function to return int (not void),...

6f3c714e 05/30/2012 10:58 am MORITA Kazutaka

sheepdog: fix return value of do_load_save_vm_state

bdrv_save_vmstate and bdrv_load_vmstate should return the vmstate size
on success, and -errno on error.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

30676153 05/29/2012 12:30 pm Anthony Liguori

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

  • kwolf/for-anthony:
    fdc-test: introduced qtest no_media_on_start and cmos qtest for floppy
    fdc: fix media detection
    fdc: floppy drive should be visible after start without media
    qemu-iotests: mark 035 qcow2-only...
f4dfa67f 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: Switch to using READ16/WRITE16 for I/O to the LUN

This allows using LUNs bigger than 2TB. Keep using READ10 for other
device types such as MMC.

Signed-off-by: Ronnie Sahlberg <>

6bcd1346 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: Only call READCAPACITY16 for SBC devices, use READCAPACITY10 for MMC

Signed-off-by: Ronnie Sahlberg <>

c7b4a952 05/28/2012 03:04 pm Paolo Bonzini

ISCSI: change num_blocks to 64-bit

Signed-off-by: Paolo Bonzini <>

dbfff6d7 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: get device type at connection time

This is needed to avoid READ CAPACITY for MMC devices.

Signed-off-by: Ronnie Sahlberg <>
Signed-off-by: Paolo Bonzini <>

c9b9f682 05/28/2012 03:04 pm Ronnie Sahlberg

ISCSI: redo how we set up the events

Call qemu_notify_event() after updating events. Otherwise, If we add
an event for -is-writeable but the socket is already writeable there
may be a delay before the event callback is actually triggered.

Those delays would in particular hurt performance during BIOS boot and...

b6c14762 05/25/2012 07:12 pm Jim Meyering

qcow2: don't leak buffer for unexpected qcow_version in header

Signed-off-by: Jim Meyering <>
Signed-off-by: Kevin Wolf <>

622b6057 05/25/2012 07:12 pm MORITA Kazutaka

sheepdog: mark image as snapshot when tag is specified

When a snapshot tag is specified in the filename, the opened image is
a snapshot.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

cb595887 05/25/2012 07:12 pm MORITA Kazutaka

sheepdog: return -errno on error

On error, BlockDriver APIs should return -errno instead of -1.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

b6fc8245 05/25/2012 07:12 pm MORITA Kazutaka

sheepdog: use heap instead of stack for BDRVSheepdogState

bdrv_create() is called in coroutine context now, so we cannot use
more stack than 1 MB in the function if we use ucontext coroutine.
This patch allocates BDRVSheepdogState, whose size is 4 MB, on the...

df021791 05/25/2012 07:12 pm Kevin Wolf

qcow2: Check qcow2_alloc_clusters_at() return value

When using qcow2_alloc_clusters_at(), the cluster allocation code
checked the wrong variable for an error code.

Signed-off-by: Kevin Wolf <>

c44bfe46 05/14/2012 06:02 pm Kevin Wolf

qcow2: Don't ignore failure to clear autoclear flags

Signed-off-by: Kevin Wolf <>

04120e3b 05/10/2012 05:10 pm Anthony Liguori

block: fix warning introduced in efcc7a23

Signed-off-by: Anthony Liguori <>

f6133def 05/10/2012 12:01 pm Paolo Bonzini

stream: pass new base image format to bdrv_change_backing_file

When an image is modified to point to the new backing file, the backing
file format is set to NULL, which means auto-probe. This is wrong, in
fact it is a small security problem.

Reviewed-by: Kevin Wolf <>...

b21d677e 05/10/2012 12:01 pm Paolo Bonzini

stream: fix ratelimiting corner case

This fixes inability to make progress in streaming if the quota is set
to less than the amount of data that an I/O operation has to write.

In this case, limit->dispatched + n will always be above the quota and,
due to the "goto retry" to recheck cancellation and allocation, streaming...

efcc7a23 05/10/2012 12:01 pm Paolo Bonzini

stream: do not copy unallocated sectors from the base

Unallocated sectors should really never be accessed by the guest,
so there's no need to copy them during the streaming process.
If they are read by the guest during streaming, guest-initiated
copy-on-read will copy them (we're in the base == NULL case, which...

4513eafe 05/10/2012 11:32 am Paolo Bonzini

block: add block_job_sleep_ns

This function abstracts the pretty complex semantics of the "busy"
member of BlockJob.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

fa4478d5 05/10/2012 11:32 am Paolo Bonzini

block: wait for job callback in block_job_cancel_sync

The limitation on not having I/O after cancellation cannot really be
kept. Even streaming has a very small race window where you could
cancel a job and have it report completion. If this window is hit,...