• E
    qapi: Simplify non-error testing in test-qmp-* · 3f66f764
    Eric Blake 提交于
    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: NEric Blake <eblake@redhat.com>
    Message-Id: <1446791754-23823-7-git-send-email-eblake@redhat.com>
    Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
    3f66f764
test-qmp-output-visitor.c 28.1 KB