qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/8] block/backup: hoist bitmap check into QMP i


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 4/8] block/backup: hoist bitmap check into QMP interface
Date: Wed, 10 Jul 2019 18:11:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 10.07.19 03:05, John Snow wrote:
> This is nicer to do in the unified QMP interface that we have now,
> because it lets us use the right terminology back at the user.
> 
> Signed-off-by: John Snow <address@hidden>
> ---
>  block/backup.c | 13 ++++---------
>  blockdev.c     | 10 ++++++++++
>  2 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/block/backup.c b/block/backup.c
> index e2729cf6fa..a64b768e24 100644
> --- a/block/backup.c
> +++ b/block/backup.c
> @@ -566,6 +566,10 @@ BlockJob *backup_job_create(const char *job_id, 
> BlockDriverState *bs,
>      assert(bs);
>      assert(target);
>  
> +    /* QMP interface protects us from these cases */
> +    assert(sync_mode != MIRROR_SYNC_MODE_INCREMENTAL);
> +    assert(sync_bitmap || sync_mode != MIRROR_SYNC_MODE_BITMAP);

Implication would be a nice operator sometimes.

("assert(sync_mode == MIRROR_SYNC_MODE_BITMAP -> sync_bitmap)")

(Can you do that in C++?  No, you can’t overload bool’s operators, right?)

Reviewed-by: Max Reitz <address@hidden>

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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