qemu-block
[Top][All Lists]
Advanced

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

Re: [Libguestfs] [libnbd PATCH] info: Add support for new 'qemu-nbd -A'


From: Richard W.M. Jones
Subject: Re: [Libguestfs] [libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth
Date: Sat, 17 Oct 2020 11:34:48 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Oct 16, 2020 at 10:23:18AM -0500, Eric Blake wrote:
> A rather trivial decoding; we may enhance it further if qemu extends
> things to give an integer depth alongside its tri-state encoding.
> ---
> 
> I'll wait to push this to libnbd until the counterpart qemu patches
> land upstream, although it looks like I've got positive review.
> 
>  info/nbdinfo.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/info/nbdinfo.c b/info/nbdinfo.c
> index 24ec129..1afdf98 100644
> --- a/info/nbdinfo.c
> +++ b/info/nbdinfo.c
> @@ -780,6 +780,13 @@ extent_description (const char *metacontext, uint32_t 
> type)
>      case 1: return "dirty";
>      }
>    }
> +  else if (strcmp (metacontext, "qemu:allocation-depth") == 0) {
> +    switch (type & 3) {
> +    case 0: return "unallocated";
> +    case 1: return "local";
> +    case 2: return "backing";
> +    }
> +  }
> 
>    return NULL;   /* Don't know - description field will be omitted. */
>  }

ACK

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




reply via email to

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