On 08/18/2015 02:48 PM, Eric Blake wrote: > Commits 7216ae3d and d2828429 disabled some error message hints, > all because a change to use modern error reporting meant that the > hint would be output prior to the actual error. Fix this by making > hints a first-class member of Error. > > For example, we are now back to the pleasant: > > $ qemu-system-x86_64 --nodefaults -S --vnc :0 --chardev null,id=, > qemu-system-x86_64: --chardev null,id=,: Parameter 'id' expects an identifier > Identifiers consist of letters, digits, '-', '.', '_', starting with a > letter. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > --- > > v2: use GString instead of rolling our own O(n^2) string concat [Paolo] >
> @@ -162,6 +191,7 @@ void error_free(Error *err) > { > if (err) { > g_free(err->msg); > + g_string_free(err->hint, true); self-NAK; v3 coming up. g_string_free(NULL) doesn't work (I hate "free" functions that aren't free-like). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature