qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 6/9] nbd/server: Support inactive nodes


From: Eric Blake
Subject: Re: [PATCH 6/9] nbd/server: Support inactive nodes
Date: Thu, 30 Jan 2025 14:43:19 -0600
User-agent: NeoMutt/20250113

On Wed, Jan 22, 2025 at 12:50:43PM +0100, Kevin Wolf wrote:
> In order to support running an NBD export on inactive nodes, we must
> make sure to return errors for any operations that aren't allowed on
> inactive nodes. Reads are the only operation we know we need for
> inactive images, so to err on the side of caution, return errors for
> everything else, even if some operations could possibly be okay.

Block status might be the only other command I could see being needed,
but I also agree with the approach of not supporting it until we have
a use case in mind (if ever).

> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  nbd/server.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 

> @@ -2920,6 +2921,22 @@ static coroutine_fn int nbd_handle_request(NBDClient 
> *client,
>      NBDExport *exp = client->exp;
>      char *msg;
>      size_t i;
> +    bool inactive;
> +
> +    WITH_GRAPH_RDLOCK_GUARD() {
> +        inactive = bdrv_is_inactive(blk_bs(exp->common.blk));

Can the declaration of bool inactive be moved inside the lock guard
block?  Not a problem if you want to leave it with all other
declarations, though.

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]