qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 01/10] QemuOpts: add some functions
Date: Fri, 31 Jul 2009 11:54:57 -0300	[thread overview]
Message-ID: <20090731115457.518d4a63@doriath> (raw)
In-Reply-To: <1249035941-4562-2-git-send-email-kraxel@redhat.com>

On Fri, 31 Jul 2009 12:25:32 +0200
Gerd Hoffmann <kraxel@redhat.com> wrote:

> qemu_opt_foreach: loop over all QemuOpts entries.
> qemu_opts_id: return QemuOpts id.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  qemu-option.c |   19 +++++++++++++++++++
>  qemu-option.h |    4 ++++
>  2 files changed, 23 insertions(+), 0 deletions(-)
> 
> diff --git a/qemu-option.c b/qemu-option.c
> index 591d178..7164ee8 100644
> --- a/qemu-option.c
> +++ b/qemu-option.c
> @@ -607,6 +607,20 @@ int qemu_opt_set(QemuOpts *opts, const char *name, const char *value)
>      return 0;
>  }
>  
> +int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque,
> +                     int abort_on_failure)
> +{
> +    QemuOpt *opt;
> +    int rc = 0;
> +
> +    TAILQ_FOREACH(opt, &opts->head, next) {
> +        rc = func(opt->name, opt->str, opaque);
> +        if (abort_on_failure  &&  rc != 0)
> +            break;
> +    }
> +    return rc;
> +}
> +
>  QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id)
>  {
>      QemuOpts *opts;
> @@ -663,6 +677,11 @@ int qemu_opts_set(QemuOptsList *list, const char *id,
>      return qemu_opt_set(opts, name, value);
>  }
>  
> +const char *qemu_opts_id(QemuOpts *opts)
> +{
> +    return opts->id;
> +}
> +

 Can't you constify *opts in those functions?

  reply	other threads:[~2009-07-31 14:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 10:25 [Qemu-devel] [PATCH 0/10] QemuOpts+qdev patches Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 01/10] QemuOpts: add some functions Gerd Hoffmann
2009-07-31 14:54   ` Luiz Capitulino [this message]
2009-07-31 10:25 ` [Qemu-devel] [PATCH 02/10] QemuOpts: qemu_opts_parse: fix id= parsing Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 03/10] QemuOpts: make the drive id actually show up in "info block" Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 04/10] QemuOpts: create qemu-config.h Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 05/10] QemuOpts: add -set option Gerd Hoffmann
2009-07-31 17:01   ` Anthony Liguori
2009-08-03  8:44     ` Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 06/10] QemuOpts: switch over -device Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 07/10] constify drive_get_by_id arg Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 08/10] add -drive if=none Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 09/10] qdev/prop: add drive property Gerd Hoffmann
2009-07-31 10:25 ` [Qemu-devel] [PATCH 10/10] qdev-ify virtio-blk Gerd Hoffmann

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=20090731115457.518d4a63@doriath \
    --to=lcapitulino@redhat.com \
    --cc=kraxel@redhat.com \
    --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).