All of lore.kernel.org
 help / color / mirror / Atom feed
From: Teruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>
To: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Cc: kwolf@redhat.com, namei.unix@gmail.com, sheepdog@lists.wpkg.org,
	qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [sheepdog] [PATCH v2] sheepdog: selectable object size support
Date: Fri, 23 Jan 2015 16:09:48 +0900	[thread overview]
Message-ID: <54C1F3BC.10007@lab.ntt.co.jp> (raw)
In-Reply-To: <87iofzie37.wl%mitake.hitoshi@lab.ntt.co.jp>

Hi, Hitoshi

Thanks for your review!

(2015/01/22 14:22), Hitoshi Mitake wrote:
> At Tue, 20 Jan 2015 16:14:28 +0900,
> Teruaki Ishizaki wrote:
>>
>> Previously, qemu block driver of sheepdog used hard-coded VDI object size.
>> This patch enables users to handle "block_size_shift" value for
>> calculating VDI object size.
>>
>> When you start qemu, you don't need to specify additional command option.
>>
>> But when you create the VDI which doesn't have default object size
>> with qemu-img command, you specify block_size_shift option.
>>
>> If you want to create a VDI of 8MB(1 << 23) object size,
>> you need to specify following command option.
>>
>>   # qemu-img create -o block_size_shift=23 sheepdog:test1 100M
>>
>> In addition, when you don't specify qemu-img command option,
>> a default value of sheepdog cluster is used for creating VDI.
>>
>>   # qemu-img create sheepdog:test2 100M
>>
>> Signed-off-by: Teruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>
>> ---
>> V2:
>>   - Fix coding style problem (white space).
>>   - Add members, store_policy and block_size_shift to struct SheepdogVdiReq
>>   - Initialize request header to use block_size_shift specified by user.
>> ---
>>   block/sheepdog.c          |  142 ++++++++++++++++++++++++++++++++++++++-------
>>   include/block/block_int.h |    1 +
>>   2 files changed, 121 insertions(+), 22 deletions(-)
>>
>
>> @@ -1757,6 +1800,48 @@ static int sd_create(const char *filename, QemuOpts *opts,
>>       }
>>
>>       s->aio_context = qemu_get_aio_context();
>> +
>> +    /* if block_size_shift is not specified, get cluster default value */
>> +    if (s->inode.block_size_shift == 0) {
>> +        SheepdogVdiReq hdr;
>> +        SheepdogClusterRsp *rsp = (SheepdogClusterRsp *)&hdr;
>> +        Error *local_err = NULL;
>> +        int fd;
>> +        unsigned int wlen = 0, rlen = 0;
>> +
>> +        fd = connect_to_sdog(s, &local_err);
>> +        if (fd < 0) {
>> +            error_report("%s", error_get_pretty(local_err));
>> +            error_free(local_err);
>> +            ret = -EIO;
>> +            goto out;
>> +        }
>> +
>> +        memset(&hdr, 0, sizeof(hdr));
>
> SD_OP_GET_CLUSTER_DEFAULT doesn't require succeeding data, so the below memset() for buf and
>
>> +        memset(&buf, 0, sizeof(buf));
>> +        hdr.opcode = SD_OP_GET_CLUSTER_DEFAULT;
>> +        hdr.proto_ver = SD_PROTO_VER;
>
> the below two statements aren't required.
>
>> +        hdr.data_length = wlen;
>> +        hdr.flags = SD_FLAG_CMD_WRITE;

I comprehend above things you pointed out.
I'll fix the patch!

Thanks,
Teruaki Ishizaki

      reply	other threads:[~2015-01-23  7:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20  7:14 [Qemu-devel] [PATCH v2] sheepdog: selectable object size support Teruaki Ishizaki
2015-01-22  5:22 ` [Qemu-devel] [sheepdog] " Hitoshi Mitake
2015-01-23  7:09   ` Teruaki Ishizaki [this message]

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=54C1F3BC.10007@lab.ntt.co.jp \
    --to=ishizaki.teruaki@lab.ntt.co.jp \
    --cc=kwolf@redhat.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=namei.unix@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sheepdog@lists.wpkg.org \
    --cc=stefanha@redhat.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.