All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lyu Mitnick <mitnick.lyu@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [Qemu-devel] Question about total_sectors in block/vpc.c
Date: Sat, 16 Apr 2011 04:40:12 +0800	[thread overview]
Message-ID: <BANLkTi=zKsd0tECUCVSX6-Xrhh42Z40tHA@mail.gmail.com> (raw)
In-Reply-To: <4DA6B246.4080302@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1216 bytes --]

Hello Kevin,

2011/4/14 Kevin Wolf <kwolf@redhat.com>

> Am 13.04.2011 22:59, schrieb Lyu Mitnick:
> > Hello Stefan,
> >
> > I have a question about get_option_parameter(). I am wondering whether
> > get_option_parameter  is suitable to use instead of doing the search by
> > myself
> > in the case like following:
> >
> > /* Read out options */
> >     while (options && options->name) {
> >         if (!strcmp(options->name, BLOCK_OPT_SIZE)) {
> >             // do something
> >         } else if (!strcmp(options->name, BLOCK_OPT_CLUSTER_SIZE)) {
> >            // do something
> >         }
> >         options++;
> >     }
>
> Yes, I think it is, though you need to check whether the option has been
> set in order to allow use default values.
>
> Kevin
>

I have no idea about the mean of "check whether the option has been set in
order to allow use default values" , would you mind to give me an example
about
it??

So as the example above. I am wondering whether the code should be
rewritten
as:

/* Read out options */
if(get_option_parameter(options, BLOCK_OPT_SIZE)) {
    // do something
}

if (get_option_parameter(options, BLOCK_OPT_CLUSTER_SIZE)) {
    // do something
}

in QEMU??

Thanks

Mitnick

[-- Attachment #2: Type: text/html, Size: 1895 bytes --]

  reply	other threads:[~2011-04-15 20:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-09 16:51 [Qemu-devel] Question about total_sectors in block/vpc.c Lyu Mitnick
2011-04-09 20:05 ` Stefan Hajnoczi
2011-04-10  9:02   ` Lyu Mitnick
2011-04-11  8:33     ` Stefan Hajnoczi
2011-04-13 20:59       ` Lyu Mitnick
2011-04-14  8:37         ` Kevin Wolf
2011-04-15 20:40           ` Lyu Mitnick [this message]
2011-04-18 13:13             ` Kevin Wolf
2011-04-11 18:14   ` Christoph Hellwig
2011-04-11 22:40     ` Lyu Mitnick

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='BANLkTi=zKsd0tECUCVSX6-Xrhh42Z40tHA@mail.gmail.com' \
    --to=mitnick.lyu@gmail.com \
    --cc=hch@lst.de \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.