[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5] sheepdog: add discard/trim support for sheep
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v5] sheepdog: add discard/trim support for sheepdog |
Date: |
Tue, 16 Apr 2013 10:18:43 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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.
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.
This makes the error messages safe from denial-of-service and includes
more useful information.
- [Qemu-devel] [PATCH 2/3] sheep: teach sheep to discard unused objects, (continued)