From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US16K-0007NU-Mx for qemu-devel@nongnu.org; Tue, 16 Apr 2013 04:18:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US16F-0001Yo-VR for qemu-devel@nongnu.org; Tue, 16 Apr 2013 04:18:52 -0400 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:60866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US16F-0001Ya-Mg for qemu-devel@nongnu.org; Tue, 16 Apr 2013 04:18:47 -0400 Received: by mail-wi0-f179.google.com with SMTP id hn17so185127wib.12 for ; Tue, 16 Apr 2013 01:18:46 -0700 (PDT) Date: Tue, 16 Apr 2013 10:18:43 +0200 From: Stefan Hajnoczi Message-ID: <20130416081843.GD6308@stefanha-thinkpad.redhat.com> References: <1365852442-28941-5-git-send-email-namei.unix@gmail.com> <1366042504-18354-1-git-send-email-namei.unix@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1366042504-18354-1-git-send-email-namei.unix@gmail.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: Liu Yuan Cc: Kevin Wolf , sheepdog@lists.wpkg.org, qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , MORITA Kazutaka 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.