On Fri, 03 Aug 2012 11:56:29 -0600 Eric Blake <ebl...@redhat.com> 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 <lcapitul...@redhat.com> > > > > 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 <ebl...@redhat.com> > >