mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: Add opaque value to the amend CB
Add an opaque value which is to be passed to the bdrv_amend_options() status callback. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
bd5072d756
commit
8b13976d3f
7 changed files with 24 additions and 18 deletions
|
@ -2896,7 +2896,8 @@ out:
|
|||
}
|
||||
|
||||
static void amend_status_cb(BlockDriverState *bs,
|
||||
int64_t offset, int64_t total_work_size)
|
||||
int64_t offset, int64_t total_work_size,
|
||||
void *opaque)
|
||||
{
|
||||
qemu_progress_print(100.f * offset / total_work_size, 0);
|
||||
}
|
||||
|
@ -3020,7 +3021,7 @@ static int img_amend(int argc, char **argv)
|
|||
|
||||
/* In case the driver does not call amend_status_cb() */
|
||||
qemu_progress_print(0.f, 0);
|
||||
ret = bdrv_amend_options(bs, opts, &amend_status_cb);
|
||||
ret = bdrv_amend_options(bs, opts, &amend_status_cb, NULL);
|
||||
qemu_progress_print(100.f, 0);
|
||||
if (ret < 0) {
|
||||
error_report("Error while amending options: %s", strerror(-ret));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue