History | View | Annotate | Download (6.7 kB)
block: Make BlockJobTypes const
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: move include files to include/block/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
aio: Get rid of qemu_aio_flush()
There are no remaining users, and new users should probably beusing bdrv_drain_all() in the first place.
block: rename block_job_complete to block_job_completed
The imperative will be used for the QMP command.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
stream: add on-error argument
This patch adds support for error management to streaming.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: move job APIs to separate files
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 writeshave been made to those sectors in the image file.
This patch finishes streaming early when the end of the backing file is...
stream: tweak usage of bdrv_co_is_allocated
is_allocated_base has complex semantics that are not really usableoutside streaming. Split the check in two parts, where the allocatedstate for the top bs is moved to the caller. The resulting functionis more generally useful....
stream: move is_allocated_above to block.c
stream: move rate limiting to a separate header file
Make the code reusable.
block: fix warning introduced in efcc7a23
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
stream: pass new base image format to bdrv_change_backing_file
When an image is modified to point to the new backing file, the backingfile format is set to NULL, which means auto-probe. This is wrong, infact it is a small security problem.
Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
stream: fix ratelimiting corner case
This fixes inability to make progress in streaming if the quota is setto 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...
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-initiatedcopy-on-read will copy them (we're in the base == NULL case, which...
block: add block_job_sleep_ns
This function abstracts the pretty complex semantics of the "busy" member of BlockJob.
block: wait for job callback in block_job_cancel_sync
The limitation on not having I/O after cancellation cannot really bekept. Even streaming has a very small race window where you couldcancel a job and have it report completion. If this window is hit,...
block: update in-memory backing file and format
These are needed to print "info block" output correctly. QCOW2 does thisbecause it needs it to write the header, but QED does not, and common codeis the right place to do it.
block: use Error mechanism instead of -errno for block_job_create()
The block job API uses -errno return values internally and we convertthese to Error in the QMP functions. This is ugly because the Errorshould be created at the point where we still have all the relevant...
block: use Error mechanism instead of -errno for block_job_set_speed()
There are at least two different errors that can occur inblock_job_set_speed(): the job might not support setting speeds or thevalue might be invalid.
Use the Error mechanism to report the error where it occurs....
block: change block-job-set-speed argument from 'value' to 'speed'
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Acked-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
block: add 'speed' optional parameter to block-stream
Allow streaming operations to be started with an initial speed limit.This eliminates the window of time between starting streaming andissuing block-job-set-speed. Users should use the new optional 'speed'...
block stream: close unused files and update ->backing_hd
Close the now unused images that were part of the previous backing filechain and adjust ->backing_hd, backing_filename and backing_formatproperly.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=801449...
block: fix streaming/closing race
Streaming can issue I/O while qcow2_close is running. This causes theL2 caches to become very confused or, alternatively, could cause asegfault when the streaming coroutine is reentered after closing itsblock device. The fix is to cancel streaming jobs when closing their...
block: set job->speed in block_set_speed
There is no need to do this in every implementation of set_speed(even though there is only one right now).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
block: add support for partial streaming
Add support for streaming data from an intermediate section of theimage chain (see patch and documentation for details).
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
block: add image streaming block job
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: rate-limit streaming operations
This patch implements rate-limiting for image streaming. If we'veexceeded the bandwidth quota for a 100 ms time slice we sleep thecoroutine until the next slice begins.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...