From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US1YH-0000mI-6R for qemu-devel@nongnu.org; Tue, 16 Apr 2013 04:47:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US1YF-0004v8-Sx for qemu-devel@nongnu.org; Tue, 16 Apr 2013 04:47:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US1YF-0004ux-LE for qemu-devel@nongnu.org; Tue, 16 Apr 2013 04:47:43 -0400 Date: Tue, 16 Apr 2013 10:47:20 +0200 From: Kevin Wolf Message-ID: <20130416084720.GB2825@dhcp-200-207.str.redhat.com> References: <1365852442-28941-5-git-send-email-namei.unix@gmail.com> <1366042504-18354-1-git-send-email-namei.unix@gmail.com> <20130416081843.GD6308@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130416081843.GD6308@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH v5] sheepdog: add discard/trim support for sheepdog List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , Liu Yuan , MORITA Kazutaka 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. > 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. Or if we can check whether discard works during bdrv_open(), we could already fail there for discard=on. Kevin