qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 15/18] qmp: add block-dirty-bitmap-load


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 15/18] qmp: add block-dirty-bitmap-load
Date: Thu, 9 Feb 2017 09:18:52 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 02/03/2017 09:47 AM, Vladimir Sementsov-Ogievskiy wrote:
> For loading dirty bitmap from nbd server. Or for underlying storages for

s/storages/storage/

> other formats.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  blockdev.c           | 28 ++++++++++++++++++++++++++++
>  qapi/block-core.json | 14 ++++++++++++++
>  2 files changed, 42 insertions(+)
> 
> diff --git a/blockdev.c b/blockdev.c
> index 1bc3fe386a..2529943e7f 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -2790,6 +2790,34 @@ void qmp_block_dirty_bitmap_clear(const char *node, 
> const char *name,
>      aio_context_release(aio_context);
>  }
>  
> +void qmp_block_dirty_bitmap_load(const char *node, const char *name,
> +                                 Error **errp)
> +{
> +    AioContext *aio_context;
> +    BlockDriverState *bs;
> +
> +    if (!node) {
> +        error_setg(errp, "Node cannot be NULL");
> +        return;
> +    }
> +    if (!name) {
> +        error_setg(errp, "Bitmap name cannot be NULL");
> +        return;
> +    }

QAPI guarantees that node and name are non-null for non-optional
arguments; these checks are dead code...

> +++ b/qapi/block-core.json
> @@ -1280,6 +1280,20 @@
>    'data': 'BlockDirtyBitmap' }
>  
>  ##
> +# @block-dirty-bitmap-load:
> +#
> +# Load a dirty bitmap from the storage (qcow2 file or nbd export)
> +#
> +# Returns: nothing on success
> +#          If @node is not a valid block device, DeviceNotFound
> +#          If @name is not found, GenericError with an explanation
> +#
> +# Since: vz-7.4
> +##
> +  { 'command': 'block-dirty-bitmap-load',
> +    'data': 'BlockDirtyBitmap' }

...since BlockDirtyBitmap defines them as required fields.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]