qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 01/15] block: Add 'active' field to BlockDeviceInfo


From: Eric Blake
Subject: Re: [PATCH v2 01/15] block: Add 'active' field to BlockDeviceInfo
Date: Thu, 30 Jan 2025 13:30:57 -0600
User-agent: NeoMutt/20250113

On Thu, Jan 30, 2025 at 06:12:32PM +0100, Kevin Wolf wrote:
> This allows querying from QMP (and also HMP) whether an image is
> currently active or inactive (in the sense of BDRV_O_INACTIVE).
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---

> +++ b/block/qapi.c
> @@ -63,6 +63,7 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
>      info->file                   = g_strdup(bs->filename);
>      info->ro                     = bdrv_is_read_only(bs);
>      info->drv                    = g_strdup(bs->drv->format_name);
> +    info->active                 = !bdrv_is_inactive(bs);

Lots of double-negatives - annoying, but I don't see a way around it,
and I agree with your decision to make the public interface use the
positive (active) rather than the negative (inactive), even though the
negative is the unusual case.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org




reply via email to

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