Skip to content
  • Eric Blake's avatar
    014791b0
    vl: Ensure qapi visitor properly ends struct visit · 014791b0
    Eric Blake authored
    
    
    Guarantee that visit_end_struct() is called if
    visit_start_struct() succeeded.  This matches the behavior of
    most other uses of visitors, and is a step towards the possibility
    of a future patch that adds and enforces some tighter semantics to
    the visitor interface (namely, cleanup of the visitor would no
    longer have to mop up as many leftovers from an aborted partial
    visit).
    
    The change to code here matches the flow of hmp.c:hmp_object_add();
    a later patch will then further simplify the cleanup logic of both
    places by refactoring visit_end_struct() to not require a second
    local error object.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <1454075341-13658-9-git-send-email-eblake@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    014791b0
    vl: Ensure qapi visitor properly ends struct visit
    Eric Blake authored
    
    
    Guarantee that visit_end_struct() is called if
    visit_start_struct() succeeded.  This matches the behavior of
    most other uses of visitors, and is a step towards the possibility
    of a future patch that adds and enforces some tighter semantics to
    the visitor interface (namely, cleanup of the visitor would no
    longer have to mop up as many leftovers from an aborted partial
    visit).
    
    The change to code here matches the flow of hmp.c:hmp_object_add();
    a later patch will then further simplify the cleanup logic of both
    places by refactoring visit_end_struct() to not require a second
    local error object.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <1454075341-13658-9-git-send-email-eblake@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Loading