[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics
From: |
Liu Yuan |
Subject: |
Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics |
Date: |
Tue, 25 Dec 2012 16:26:32 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 12/25/2012 03:47 PM, MORITA Kazutaka wrote:
> I wonder if we should disable cache when cache=none. Many management
> frontend uses cache=none by default but, I think, users still expect
> that data is cached (e.g. by disk write cache when a raw format is
> used). cache=none only means that the host page cache is not used for
> VM disk IO.
>
> In that sense,
>
I am fine to adopt option to this semantics.
>> > @@ -1118,12 +1118,19 @@ static int sd_open(BlockDriverState *bs, const
>> > char *filename, int flags)
>> > goto out;
>> > }
>> >
>> > - s->cache_enabled = true;
>> > - s->flush_fd = connect_to_sdog(s->addr, s->port);
>> > - if (s->flush_fd < 0) {
>> > - error_report("failed to connect");
>> > - ret = s->flush_fd;
>> > - goto out;
>> > + if (flags & BDRV_O_NOCACHE) {
>> > + s->cache_flags = SD_FLAG_CMD_DIRECT;
>> > + } else if (flags & BDRV_O_CACHE_WB) {
> 'else' should be removed, and
>
Seems should not. We need this 'else if' to allow writethrough flag.
>> > + s->cache_flags = SD_FLAG_CMD_CACHE;
>> > + }
>> > +
>> > + if (s->cache_flags != SD_FLAG_CMD_DIRECT) {
> should be 's->cache_flags == SD_FLAG_CMD_CACHE'? Do we need to send a
> flush request when cache=writethourgh?
Looks good to me. I'll change it at V2.
Thanks,
Yuan