qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
To: Bharata B Rao <bharata.rao@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH V8 3/4] Use QemuOpts support in block layer
Date: Mon, 17 Dec 2012 14:24:56 +0800	[thread overview]
Message-ID: <CAGrFBsjcx8OkdSwrLib=k5PB6U-_k6S7RsAUv1S3Ar1ddzn+cw@mail.gmail.com> (raw)
In-Reply-To: <CAGZKiBp+QA+SEfyoQwCQ1TWDwW=3Dmnr3xi_4+qrp0a6xsMRLg@mail.gmail.com>

On Mon, Dec 17, 2012 at 1:44 PM, Bharata B Rao <bharata.rao@gmail.com> wrote:
> On Fri, Dec 14, 2012 at 7:34 PM, Dong Xu Wang
> <wdongxu@linux.vnet.ibm.com> wrote:
>> diff --git a/block/gluster.c b/block/gluster.c
>> index 1c90174..daabb61 100644
>> --- a/block/gluster.c
>> +++ b/block/gluster.c
>> @@ -335,8 +335,7 @@ out:
>>      return ret;
>>  }
>>
>> -static int qemu_gluster_create(const char *filename,
>> -        QEMUOptionParameter *options)
>> +static int qemu_gluster_create(const char *filename, QemuOpts* opts)
>>  {
>>      struct glfs *glfs;
>>      struct glfs_fd *fd;
>> @@ -350,11 +349,9 @@ static int qemu_gluster_create(const char *filename,
>>          goto out;
>>      }
>>
>> -    while (options && options->name) {
>> -        if (!strcmp(options->name, BLOCK_OPT_SIZE)) {
>> -            total_size = options->value.n / BDRV_SECTOR_SIZE;
>> -        }
>> -        options++;
>> +    if (opts) {
>> +        total_size =
>> +            qemu_opt_get_number(opts, BLOCK_OPT_SIZE, 0) /
>> BDRV_SECTOR_SIZE;
>>      }
>>
>>      fd = glfs_creat(glfs, gconf->image,
>> @@ -544,13 +541,17 @@ static void qemu_gluster_close(BlockDriverState *bs)
>>      glfs_fini(s->glfs);
>>  }
>>
>> -static QEMUOptionParameter qemu_gluster_create_options[] = {
>> -    {
>> -        .name = BLOCK_OPT_SIZE,
>> -        .type = OPT_SIZE,
>> -        .help = "Virtual disk size"
>> -    },
>> -    { NULL }
>> +static QemuOptsList gluster_create_opts = {
>> +    .name = "gluster-create-opts",
>> +    .head = QTAILQ_HEAD_INITIALIZER(gluster_create_opts.head),
>> +    .desc = {
>> +        {
>> +            .name = BLOCK_OPT_SIZE,
>> +            .type = QEMU_OPT_NUMBER,
>> +            .help = "Virtual disk size"
>> +        },
>> +        { /* end of list */ }
>> +    }
>>  };
>>
>>  static BlockDriver bdrv_gluster = {
>> @@ -565,7 +566,7 @@ static BlockDriver bdrv_gluster = {
>>      .bdrv_aio_readv               = qemu_gluster_aio_readv,
>>      .bdrv_aio_writev              = qemu_gluster_aio_writev,
>>      .bdrv_aio_flush               = qemu_gluster_aio_flush,
>> -    .create_options               = qemu_gluster_create_options,
>> +    .create_options               = &gluster_create_opts,
>
> While other elements have qemu_ prefix, create_options doesn't after
> your change.
>
Okay, will rename in next version.

>>  };
>>
>>  static BlockDriver bdrv_gluster_tcp = {
>> @@ -580,7 +581,7 @@ static BlockDriver bdrv_gluster_tcp = {
>>      .bdrv_aio_readv               = qemu_gluster_aio_readv,
>>      .bdrv_aio_writev              = qemu_gluster_aio_writev,
>>      .bdrv_aio_flush               = qemu_gluster_aio_flush,
>> -    .create_options               = qemu_gluster_create_options,
>> +    .create_options               = &gluster_create_opts,
>>  };
>>
>>  static BlockDriver bdrv_gluster_unix = {
>
> Missed doing the same change for bdrv_gluster_unix and bdrv_gluster_rdma ?
>

Yep, I miss them. Will add them in next verson.

Thank you  Bharata.
> Regards,
> Bharata.
>

  reply	other threads:[~2012-12-17  6:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14 14:04 [Qemu-devel] [PATCH V8 0/4] replace QEMUOptionParameter with QemuOpts parser Dong Xu Wang
2012-12-14 14:04 ` [Qemu-devel] [PATCH V8 1/4] add def_print_str and use it in qemu_opts_print Dong Xu Wang
2012-12-14 14:04 ` [Qemu-devel] [PATCH V8 2/4] Create four opts list related functions Dong Xu Wang
2012-12-14 14:04 ` [Qemu-devel] [PATCH V8 3/4] Use QemuOpts support in block layer Dong Xu Wang
2012-12-17  5:44   ` Bharata B Rao
2012-12-17  6:24     ` Dong Xu Wang [this message]
2012-12-14 14:04 ` [Qemu-devel] [PATCH V8 4/4] remove QEMUOptionParameter related functions and struct Dong Xu Wang

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='CAGrFBsjcx8OkdSwrLib=k5PB6U-_k6S7RsAUv1S3Ar1ddzn+cw@mail.gmail.com' \
    --to=wdongxu@linux.vnet.ibm.com \
    --cc=bharata.rao@gmail.com \
    --cc=kwolf@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).