mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
block: add support for partial streaming
Add support for streaming data from an intermediate section of the image 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> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
019b8cbf76
commit
c8c3080f4a
3 changed files with 96 additions and 9 deletions
11
blockdev.c
11
blockdev.c
|
@ -973,6 +973,7 @@ void qmp_block_stream(const char *device, bool has_base,
|
|||
const char *base, Error **errp)
|
||||
{
|
||||
BlockDriverState *bs;
|
||||
BlockDriverState *base_bs = NULL;
|
||||
int ret;
|
||||
|
||||
bs = bdrv_find(device);
|
||||
|
@ -981,13 +982,15 @@ void qmp_block_stream(const char *device, bool has_base,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Base device not supported */
|
||||
if (base) {
|
||||
error_set(errp, QERR_NOT_SUPPORTED);
|
||||
return;
|
||||
base_bs = bdrv_find_backing_image(bs, base);
|
||||
if (base_bs == NULL) {
|
||||
error_set(errp, QERR_BASE_NOT_FOUND, base);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ret = stream_start(bs, NULL, block_stream_cb, bs);
|
||||
ret = stream_start(bs, base_bs, base, block_stream_cb, bs);
|
||||
if (ret < 0) {
|
||||
switch (ret) {
|
||||
case -EBUSY:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue