qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH V2] block/nfs: add support for setting debug lev


From: Stefan Hajnoczi
Subject: Re: [Qemu-block] [PATCH V2] block/nfs: add support for setting debug level
Date: Mon, 29 Jun 2015 17:10:15 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Jun 26, 2015 at 01:06:09PM +0200, Peter Lieven wrote:
> upcoming libnfs versions will support logging debug messages. Add
> support for it in qemu through a cmdline parameter.
> 
> Example
>  qemu -nfs debug=99 -cdrom nfs://...
> 
> Signed-off-by: Peter Lieven <address@hidden>
> ---
> v1->v2: reworked patch to accept the debug level as a cmdline
>         parameter instead of an URI parameter [Stefan]
> 
>  block/nfs.c     |   40 ++++++++++++++++++++++++++++++++++++++++
>  qemu-options.hx |   21 +++++++++++++++++++++
>  vl.c            |    8 ++++++++
>  3 files changed, 69 insertions(+)
> 
> diff --git a/block/nfs.c b/block/nfs.c
> index ca9e24e..43d48ae 100644
> --- a/block/nfs.c
> +++ b/block/nfs.c
> @@ -274,6 +274,30 @@ static void nfs_file_close(BlockDriverState *bs)
>      nfs_client_close(client);
>  }
>  
> +static void nfs_parse_options(NFSClient *client)
> +{
> +    QemuOptsList *list;
> +    QemuOpts *opts;
> +    const char *debug;
> +
> +    list = qemu_find_opts("nfs");
> +    if (list) {
> +        opts = QTAILQ_FIRST(&list->head);
> +        if (opts) {
> +            debug = qemu_opt_get(opts, "debug");
> +            if (debug) {
> +#ifdef LIBNFS_FEATURE_DEBUG
> +                nfs_set_debug(client->context, atoi(debug));

This is a per-context API and there are already per-drive run-time
options.

Please use per-drive options instead of adding a global option.

Stefan

Attachment: pgpUbi9wudY1r.pgp
Description: PGP signature


reply via email to

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