- 15 Mar, 2013 4 commits
-
-
Stefan Hajnoczi authored
For now bdrv_get_aio_context() is just a stub that calls qemu_aio_get_context() since the block layer is currently tied to the main loop AioContext. Add the stub now so that the block layer can begin accessing its AioContext. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Kevin Wolf authored
The options are passed down to the block drivers, which are supposed to remove all options they have processed. Anything that is left over in the end is an unknown option and results in an error. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Kevin Wolf authored
It doesn't do anything yet except storing the options QDict in the BlockDriverState. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Kevin Wolf authored
Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- 04 Mar, 2013 1 commit
-
-
Jeff Cody authored
During a commit of 'all' using the HMP non-live commit, the operation is aborted and returns error on the first error enountered. When non-COW drives are in use (e.g. ejected floppy, cdrom, or drives without a backing parent), that means a commit all will return an error of either -ENOMEDIUM or -ENOTSUP. This is not desirable, so for the 'all' commit case, only attempt the commit if both bs->drv and bs->backing_hd are present. More succinctly: 'commit all' now means a commit on all COW drives. This means an individual commit to a specific non-COW drive will still return the appropriate error (-ENOMEDIUM if eject / not present, -ENOTSUP if no backing file). Reported-by:
Jan Kiszka <jan.kiszka@web.de> Signed-off-by:
Jeff Cody <jcody@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- 22 Feb, 2013 4 commits
-
-
Paolo Bonzini authored
It is better to present homogeneous hardware independent of the storage technology that is chosen on the host, hence we make discard a host parameter; the user can choose whether to pass it down to the image format and protocol, or to ignore it. Using DISCARD with filesystems can cause very severe fragmentation, so it is left default-off for now. This can change later when we implement the "anchor" operation for efficient management of preallocated files. There is still one choice to make: whether DISCARD has an effect on the dirty bitmap or not. I chose yes, though there is a disadvantage: if the guest is buggy and issues discards for data that is in use, there will be no way to migrate storage for that guest without downgrading the machine type to an older one. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Peter Lieven authored
bdrv_truncate() invalidates the bdrv_check_request() result for in-flight requests, so there should better be none. Cc: qemu-stable@nongnu.org Signed-off-by:
Peter Lieven <pl@kamp.de> Reported-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Miroslav Rezanina authored
There can be a need to turn output to stdout off. This patch adds a -q option that enable "Quiet mode". In Quiet mode, only errors are printed out. Signed-off-by:
Miroslav Rezanina <mrezanin@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Miroslav Rezanina authored
There's no synchronous wrapper for bdrv_co_is_allocated_above function so it's not possible to check for sector allocation in an image with a backing file. Signed-off-by:
Miroslav Rezanina <mrezanin@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- 01 Feb, 2013 1 commit
-
-
Vishvananda Ishaya authored
In an image chain, if the base image is smaller than the current image, we need to make sure to use the current images count of unallocated blocks once we get to the end of the base image. Without this change the code will return 0 blocks when it gets to the end of the base image and mirror_run will fail its assertion. Signed-off-by:
Vishvananda Ishaya <vishvananda@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- 25 Jan, 2013 4 commits
-
-
Paolo Bonzini authored
Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
Reviewed-by:
Laszlo Ersek <lersek@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
This is needed in the following patch. Reviewed-by:
Laszlo Ersek <lersek@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
This actually uses the dirty bitmap in the block layer, and converts mirroring to use an HBitmapIter. Reviewed-by: Laszlo Ersek <lersek@redhat.com> (except block/mirror.c parts) Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- 15 Jan, 2013 2 commits
-
-
Paolo Bonzini authored
Note that resetting bits in the dirty bitmap is done _before_ actually processing the request. Writes, instead, set bits after the request is completed. This way, when there are concurrent write and discard requests, the outcome will always be that the blocks are marked dirty. This scenario should never happen, but it is safer to do it this way. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Peter Lieven authored
bdrv_io_limits_enable() starts a new slice, but does not set io_base correctly for that slice. Here is how io_base is used: bytes_base = bs->nr_bytes[is_write] - bs->io_base.bytes[is_write]; bytes_res = (unsigned) nb_sectors * BDRV_SECTOR_SIZE; if (bytes_base + bytes_res <= bytes_limit) { /* no wait */ } else { /* operation needs to be throttled */ } As a result, any I/O operations that are triggered between now and bs->slice_end are incorrectly limited. If 10 MB of data has been written since the VM was started, QEMU thinks that 10 MB of data has been written in this slice. This leads to a I/O lockup in the guest. We fix this by delaying the start of a new slice to the next call of bdrv_exceed_io_limits(). Signed-off-by:
Peter Lieven <pl@kamp.de> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- 14 Jan, 2013 2 commits
-
-
Stefan Hajnoczi authored
The qiov_is_aligned() function checks whether a QEMUIOVector meets a BlockDriverState's alignment requirements. This is needed by virtio-blk-data-plane so: 1. Move the function from block/raw-posix.c to block/block.c. 2. Make it public in block/block.h. 3. Rename to bdrv_qiov_is_aligned(). 4. Change return type from int to bool. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
A blank CD or DVD is visible as a zero-sized disks. Probing such disks will lead to an EIO and a failure to start the VM. Treating them as raw is a better solution. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- 11 Jan, 2013 1 commit
-
-
Stefan Weil authored
This allows removing of MinGW specific code and improves reentrancy for POSIX hosts. [Removed unused ret variable in qemu_get_timedate() to fix warning: vl.c: In function ‘qemu_get_timedate’: vl.c:451:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] -- Stefan Hajnoczi] Signed-off-by:
Stefan Weil <sw@weilnetz.de> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- 19 Dec, 2012 5 commits
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- 12 Dec, 2012 1 commit
-
-
Kevin Wolf authored
This makes the blkdebug suspend/resume functionality available in qemu-io. Use it like this: $ ./qemu-io blkdebug::/tmp/test.qcow2 qemu-io> break write_aio req_a qemu-io> aio_write 0 4k qemu-io> blkdebug: Suspended request 'req_a' qemu-io> resume req_a blkdebug: Resuming request 'req_a' qemu-io> wrote 4096/4096 bytes at offset 0 4 KiB, 1 ops; 0:00:30.71 (133.359788 bytes/sec and 0.0326 ops/sec) Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- 11 Dec, 2012 5 commits
-
-
Luiz Capitulino authored
Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Luiz Capitulino authored
This commit adds an Error ** argument to bdrv_img_create() and set it appropriately on error. Callers of bdrv_img_create() pass NULL for the new argument and still rely on bdrv_img_create()'s return value. Next commits will change callers to use the Error object instead. Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
This fixes problems that are caused by the additional open/close cycle of the existing format probing, for example related to qemu-nbd without -t option or file descriptor passing. Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
Instead of waiting for all requests to complete, wait just for the specific request that should be cancelled. Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- 24 Nov, 2012 1 commit
-
-
Stefan Weil authored
The local string tmp_filename is passed to function get_tmp_filename which expects a string with minimum size MAX_PATH for w32 hosts. MAX_PATH is 260 and PATH_MAX is 259, so tmp_filename was too short. Commit eba25057 introduced this regression. Signed-off-by:
Stefan Weil <sw@weilnetz.de> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Blue Swirl <blauwirbel@gmail.com>
-
- 14 Nov, 2012 2 commits
-
-
Stefan Hajnoczi authored
Now that AIOPool no longer keeps a freelist, it isn't really a "pool" anymore. Rename it to AIOCBInfo and make it const since it no longer needs to be modified. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Stefan Hajnoczi authored
AIO control blocks are frequently acquired and released because each aio request involves at least one AIOCB. Therefore, we pool them to avoid heap allocation overhead. The problem with the freelist approach in AIOPool is thread-safety. If we want BlockDriverStates to associate with AioContexts that execute in multiple threads, then a global freelist becomes a problem. This patch drops the freelist and instead uses g_slice_alloc() which is tuned for per-thread fixed-size object pools. qemu_aio_get() and qemu_aio_release() are now thread-safe. Note that the change from g_malloc0() to g_slice_alloc() should be safe since the freelist reuse case doesn't zero the AIOCB either. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- 24 Oct, 2012 7 commits
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
Assert that write_compressed is never used with the dirty bitmap. Setting the bits early is wrong, because a coroutine might concurrently examine them and copy incomplete data from the source. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
Mirroring runs without the backing file so that it can be copied outside QEMU. However, we need to add it at the time the job is completed and QEMU switches to the target. Factor out the common bits of opening an image and completing a mirroring operation. The new function does not assume that the file is closed immediately after it returns failure, so it keeps the BDRV_O_NO_BACKING flag up-to-date. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
qmp_query_blockstat cannot have errors, remove the Error argument and create a new public function bdrv_query_stats out of it. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
Extract it out of the implementation of "info block". Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Luiz Capitulino authored
Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-