path: root/util
diff options
authorEric Blake <>2015-11-05 23:35:30 -0700
committerMarkus Armbruster <>2015-11-09 16:45:05 +0100
commit3f66f764ee25f10d3e1144ebc057a949421b7728 (patch)
treede1bba1a49030a5e8f8553a94ec3f4c341a1be24 /util
parentb18f1141d0afa00de11a8e079f4f5305c9e36893 (diff)
qapi: Simplify non-error testing in test-qmp-*
By using &error_abort, we can avoid a local err variable in situations where we expect success. It also has the nice effect that if the test breaks, the error message from error_abort tends to be nicer than that of g_assert(). This patch has an additional bonus of fixing several call sites that were passing &err to two different functions without checking it in between. In general that is unsafe practice; because if the first function sets an error, the second function could abort() if it tries to set a different error. We got away with it because we were asserting that err was NULL through the entire chain, but switching to &error_abort avoids the questionable practice up front. Signed-off-by: Eric Blake <> Message-Id: <> Signed-off-by: Markus Armbruster <>
Diffstat (limited to 'util')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud