From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfXmO-0004A7-FT for qemu-devel@nongnu.org; Fri, 15 Jun 2012 10:45:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfXmM-0007F5-JY for qemu-devel@nongnu.org; Fri, 15 Jun 2012 10:45:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfXmM-0007Er-BG for qemu-devel@nongnu.org; Fri, 15 Jun 2012 10:45:38 -0400 Date: Fri, 15 Jun 2012 11:46:00 -0300 From: Luiz Capitulino Message-ID: <20120615114600.09d30d1c@doriath.home> In-Reply-To: <20120613144910.598bfe24@doriath.home> References: <1338387301-10074-1-git-send-email-lcapitulino@redhat.com> <1338387301-10074-3-git-send-email-lcapitulino@redhat.com> <4FC74B1A.8080700@redhat.com> <20120531110608.4dc3fe22@doriath.home> <4FC77F6C.8000008@redhat.com> <20120531113127.1c8aa213@doriath.home> <4FC78637.4040605@redhat.com> <20120613144910.598bfe24@doriath.home> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Adding errno to QMP errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Kevin Wolf , Paolo Bonzini , aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com On Wed, 13 Jun 2012 14:49:10 -0300 Luiz Capitulino wrote: > On Thu, 31 May 2012 16:54:47 +0200 > Paolo Bonzini wrote: > > > Wait, I think you're conflating two things. > > > > One is "do not shoehorn errors into errno values". So for QOM invalid values we > > have PropertyValueBad, not a generic InvalidArgument value. We convert everything > > to Error rather than returning negative errno values and then returning generic > > error codes, because those would be ugly and non-descriptive. I agree with that. > > > > The other is "when errors come straight from the OS, _do_ use errno values". > > This is for OpenFileFailed, for the new socket errors and so on. This is what > > I am proposing. > > [...] > > > $ echo | sed p > /dev/full > > sed: couldn't flush stdout: No space left on device > > ^^^^^^^^^^^^^^ error type > > ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ arguments > > > > That would become, in JSON: > > > > { 'error': 'FlushFailed', > > 'file': 'stdout', > > 'os_error': 'enospc' } > > This is not a new discussion and what we're doing today is to return errno > as a QError class name. So, for the example above we'd return something like: > > { 'error': 'NoSpace' } > > It's possible to add new optional values if you need more information, but > I know that that's not what you're asking. > > I mostly agree that your version would be better, the only problem I see > is that this is probably going to mess a bit more our API as we have been > doing like my example above for some time. > > Anthony, the current design was mostly influenced by you and you had > objections on doing what Paolo and Kevin are suggesting. What do you think? Ping? We have to reach a consensus of this because this is holding qapi conversions.