qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Jeff Cody <jcody@redhat.com>
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com,
	qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 5/7] iscsi: Add timeout option
Date: Tue, 7 Feb 2017 18:21:01 +0800	[thread overview]
Message-ID: <20170207102101.GG19280@lemon.lan> (raw)
In-Reply-To: <71fd2883819899ef964826c72c9e0cc41246e8c1.1485365834.git.jcody@redhat.com>

On Wed, 01/25 12:42, Jeff Cody wrote:
> From: Kevin Wolf <kwolf@redhat.com>
> 
> This was previously only available with -iscsi. Again, after this patch,
> the -iscsi option only takes effect if an URL is given. New users are
> supposed to use the new driver-specific option.
> 
> All -iscsi options have a corresponding driver-specific option for the
> iscsi block driver now.
> 
> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  block/iscsi.c | 37 +++++++++++--------------------------
>  1 file changed, 11 insertions(+), 26 deletions(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index a989b52..4701a27 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -1318,29 +1318,6 @@ static char *get_initiator_name(QemuOpts *opts)
>      return iscsi_name;
>  }
>  
> -static int parse_timeout(const char *target)
> -{
> -    QemuOptsList *list;
> -    QemuOpts *opts;
> -    const char *timeout;
> -
> -    list = qemu_find_opts("iscsi");
> -    if (list) {
> -        opts = qemu_opts_find(list, target);
> -        if (!opts) {
> -            opts = QTAILQ_FIRST(&list->head);
> -        }
> -        if (opts) {
> -            timeout = qemu_opt_get(opts, "timeout");
> -            if (timeout) {
> -                return atoi(timeout);
> -            }
> -        }
> -    }
> -
> -    return 0;
> -}
> -
>  static void iscsi_nop_timed_event(void *opaque)
>  {
>      IscsiLun *iscsilun = opaque;
> @@ -1549,7 +1526,7 @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
>      QemuOptsList *list;
>      QemuOpts *opts;
>      const char *user, *password, *password_secret, *initiator_name,
> -               *header_digest;
> +               *header_digest, *timeout;
>  
>      list = qemu_find_opts("iscsi");
>      if (!list) {
> @@ -1588,6 +1565,11 @@ static void iscsi_parse_iscsi_option(const char *target, QDict *options)
>      if (header_digest) {
>          qdict_set_default_str(options, "header-digest", header_digest);
>      }
> +
> +    timeout = qemu_opt_get(opts, "timeout");
> +    if (timeout) {
> +        qdict_set_default_str(options, "timeout", timeout);
> +    }
>  }
>  
>  /*
> @@ -1639,7 +1621,6 @@ static void iscsi_parse_filename(const char *filename, QDict *options,
>      iscsi_destroy_url(iscsi_url);
>  }
>  
> -/* TODO Add -iscsi options */
>  static QemuOptsList runtime_opts = {
>      .name = "iscsi",
>      .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
> @@ -1680,6 +1661,10 @@ static QemuOptsList runtime_opts = {
>              .name = "header-digest",
>              .type = QEMU_OPT_STRING,
>          },
> +        {
> +            .name = "timeout",
> +            .type = QEMU_OPT_NUMBER,
> +        },
>          { /* end of list */ }
>      },
>  };
> @@ -1780,7 +1765,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
>      }
>  
>      /* timeout handling is broken in libiscsi before 1.15.0 */
> -    timeout = parse_timeout(target);
> +    timeout = qemu_opt_get_number(opts, "timeout", 0);
>  #if LIBISCSI_API_VERSION >= 20150621
>      iscsi_set_timeout(iscsi, timeout);
>  #else
> -- 
> 2.9.3
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

  reply	other threads:[~2017-02-07 10:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 17:42 [Qemu-devel] [PATCH v2 0/7] iscsi: Add blockdev-add support Jeff Cody
2017-01-25 17:42 ` [Qemu-devel] [PATCH v2 1/7] iscsi: Split URL into individual options Jeff Cody
2017-02-07 10:06   ` Fam Zheng
2017-01-25 17:42 ` [Qemu-devel] [PATCH v2 2/7] iscsi: Handle -iscsi user/password in bdrv_parse_filename() Jeff Cody
2017-02-07 10:13   ` Fam Zheng
2017-02-17 13:26     ` Kevin Wolf
2017-02-17 14:09       ` Fam Zheng
2017-02-17 14:10   ` Fam Zheng
2017-01-25 17:42 ` [Qemu-devel] [PATCH v2 3/7] iscsi: Add initiator-name option Jeff Cody
2017-02-07 10:16   ` Fam Zheng
2017-01-25 17:42 ` [Qemu-devel] [PATCH v2 4/7] iscsi: Add header-digest option Jeff Cody
2017-02-07 10:18   ` Fam Zheng
2017-01-25 17:42 ` [Qemu-devel] [PATCH v2 5/7] iscsi: Add timeout option Jeff Cody
2017-02-07 10:21   ` Fam Zheng [this message]
2017-01-25 17:42 ` [Qemu-devel] [PATCH v2 6/7] iscsi: Add blockdev-add support Jeff Cody
2017-02-07 10:23   ` Fam Zheng
2017-02-17 21:40   ` Eric Blake
2017-02-17 21:47     ` Jeff Cody
2017-01-25 17:42 ` [Qemu-devel] [PATCH v2 7/7] QAPI: Fix blockdev-add example documentation Jeff Cody
2017-02-07 10:29   ` Fam Zheng
2017-01-25 17:57 ` [Qemu-devel] [PATCH v2 0/7] iscsi: Add blockdev-add support no-reply
2017-02-17 21:12 ` Jeff Cody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170207102101.GG19280@lemon.lan \
    --to=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).