From: Liu Yuan <namei.unix@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: sheepdog@lists.wpkg.org, Stefan Hajnoczi <stefanha@gmail.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Subject: Re: [Qemu-devel] [PATCH v5] sheepdog: add discard/trim support for sheepdog
Date: Tue, 16 Apr 2013 17:08:18 +0800 [thread overview]
Message-ID: <516D1502.3000402@gmail.com> (raw)
In-Reply-To: <20130416084720.GB2825@dhcp-200-207.str.redhat.com>
On 04/16/2013 04:47 PM, Kevin Wolf wrote:
> Am 16.04.2013 um 10:18 hat Stefan Hajnoczi geschrieben:
>> > On Tue, Apr 16, 2013 at 12:15:04AM +0800, Liu Yuan wrote:
>>> > > @@ -727,6 +730,20 @@ static void coroutine_fn aio_read_response(void *opaque)
>>> > > rsp.result = SD_RES_SUCCESS;
>>> > > }
>>> > > break;
>>> > > + case AIOCB_DISCARD_OBJ:
>>> > > + switch (rsp.result) {
>>> > > + case SD_RES_INVALID_PARMS:
>>> > > + error_report("you are running the old sheep that doesn't support "
>>> > > + "discard command.\n");
>> >
>> > error_report() does not need '\n'.
>> >
>> > The recently added ssh block driver has a similar case when the server
>> > does not support fsync. It does the following:
>> >
>> > 1. Print the error message once only per volume, avoid filling up logs
>> > on the host.
All the request for the volumes are firstly handled by the sheep daemon
this QEMU connects to, so we can say that if one discard request for any
volume return SD_RES_INVALID_PARMS, then all the volumes attatched to
this VM can't support discard operation.
>> > 2. Include details of the volume/server in case the users is connected
>> > to multiple volumes/servers. This allows them to figure out which
>> > server is outdated.
>> >
Multi-connections aren't supported yet (though planned), so this doesn't
apply for current SD.
>> > This makes the error messages safe from denial-of-service and includes
>> > more useful information.
> Or if we can check whether discard works during bdrv_open(), we could
> already fail there for discard=on.
Hmm, SD doesn't support a feature negotiation request. The most simple
way I can come up is add a s->enable_discard flag that set false when it
is reported discard operation isn't supported by the server connected.
What do you think?
Thanks,
Yuan
prev parent reply other threads:[~2013-04-16 9:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-13 11:27 [Qemu-devel] [PATCH For SD and QEMU] Add discard/trim support for Sheepdog Liu Yuan
2013-04-13 11:27 ` [Qemu-devel] [PATCH 1/3] sheep: remove unused 'flags' in remove_object() Liu Yuan
2013-04-13 11:27 ` [Qemu-devel] [PATCH 2/3] sheep: teach sheep to discard unused objects Liu Yuan
2013-04-13 11:27 ` [Qemu-devel] [PATCH 3/3] tests: add 058 to test discard/trim Liu Yuan
2013-04-13 11:27 ` [Qemu-devel] [PATCH for QEMU] sheepdog: add discard/trim support for sheepdog Liu Yuan
2013-04-14 5:07 ` [Qemu-devel] [PATCH for QEMU v2] " Liu Yuan
2013-04-14 5:16 ` [Qemu-devel] [PATCH for QEMU v3] " Liu Yuan
2013-04-15 15:10 ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-15 15:52 ` [Qemu-devel] [PATCH v4] " Liu Yuan
2013-04-15 16:03 ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-15 16:15 ` [Qemu-devel] [PATCH v5] " Liu Yuan
2013-04-15 16:25 ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-16 8:18 ` [Qemu-devel] " Stefan Hajnoczi
2013-04-16 8:47 ` Kevin Wolf
2013-04-16 9:08 ` Liu Yuan [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=516D1502.3000402@gmail.com \
--to=namei.unix@gmail.com \
--cc=kwolf@redhat.com \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sheepdog@lists.wpkg.org \
--cc=stefanha@gmail.com \
--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 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).