aboutsummaryrefslogtreecommitdiff
path: root/hw/char/virtio-serial-bus.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-05-02 13:26:37 +0200
committerLuiz Capitulino <lcapitulino@redhat.com>2014-05-09 09:11:31 -0400
commitee16ce93373dda1faa4aa1bb4d99bcdf158f7d7a (patch)
tree6c84a4133be7d4b545724b096b298a2914d6a34b /hw/char/virtio-serial-bus.c
parent196857f8bfd2d34a170c3de808dc44bd6da22f4a (diff)
qapi: Clean up fragile use of error_is_set()
Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's unnecessarily opaque (see commit 84d18f0). The error_is_set(errp) in do_qmp_dispatch() is merely fragile, because the caller never passes a null errp argument. Make the code more robust and more obviously correct: receive the error in a local variable, then propagate it through the parameter. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hw/char/virtio-serial-bus.c')
0 files changed, 0 insertions, 0 deletions