From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxMCA-0006H8-8D for qemu-devel@nongnu.org; Fri, 03 Aug 2012 14:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxMC9-0001kB-2X for qemu-devel@nongnu.org; Fri, 03 Aug 2012 14:01:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxMC8-0001k2-PP for qemu-devel@nongnu.org; Fri, 03 Aug 2012 14:01:52 -0400 Date: Fri, 3 Aug 2012 15:02:25 -0300 From: Luiz Capitulino Message-ID: <20120803150225.6a645209@doriath.home> In-Reply-To: <501C10CD.10402@redhat.com> References: <1343869374-23417-1-git-send-email-lcapitulino@redhat.com> <1343869374-23417-31-git-send-email-lcapitulino@redhat.com> <20120803174433.GB16157@illuin> <501C10CD.10402@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 30/34] qemu-ga: switch to the new error format on the wire List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com, Michael Roth , pbonzini@redhat.com On Fri, 03 Aug 2012 11:56:29 -0600 Eric Blake wrote: > On 08/03/2012 11:44 AM, Michael Roth wrote: > > On Wed, Aug 01, 2012 at 10:02:50PM -0300, Luiz Capitulino wrote: > >> IMPORTANT: this BREAKS qemu-ga compatibility for the error response. > >> > >> Instead of returning something like: > >> > >> { "error": { "class": "InvalidParameterValue", > >> "data": {"name": "mode", "expected": "halt|powerdown|reboot" } } } > >> > >> qemu-ga now returns: > >> > >> { "error": { "class": "GenericError", > >> "desc": "Parameter 'mode' expects halt|powerdown|reboot" } } > > > > >> > >> Notice that this is also a bug fix, as qemu-ga wasn't returning the > >> human message. > >> > >> Signed-off-by: Luiz Capitulino > > > > So, if the libvirt folks are okay with it: > > The only use libvirt made of existing qemu-ga errors was to stringify > them in order to pass on an error message to the user when a command > failed. Existing libvirt attempts to look up the 'desc' field, and when > it is lacking, then attempts to stringify the 'class' field based on a > finite list of known classes. Qemu is now shrinking the list of known > classes but providing a 'desc' field, so the error message quality in > libvirt will actually improve. After reading libvirt's > src/qemu/qemu_agent.c, I don't see any problem with this patch from > libvirt's point of view. Yeah, I actually have a request from Michal to do just that (add 'desc' to qemu-ga's errors). > > Reviewed-by: Eric Blake > >