e0e16a3 qemu: Always call virFileWrapperFdClose()

Authored and Committed by Andrea Bolognani 5 years ago
    qemu: Always call virFileWrapperFdClose()
    
    Right now we're reporting errors in virFileWrapperFdFree(),
    but that's hardly the appropriate place to do so, as free
    functions are supposed to do nothing more than release
    allocated resources.
    
    We want to move that code back into virFileWrapperFdClose(),
    but before we can do that we need to make sure the function
    is actually called every time we're done processing the
    wrapped file. The cleanup path is the obvious candidate.
    
    In a couple of cases we can just move the call, but for the
    remaining ones we need to duplicate it instead in order not
    to alter the existing behavior. We do, however, make sure
    that in all cases a failure to properly close the wrapper
    results in the overall operation being reported as failed.
    
    Signed-off-by: Andrea Bolognani <abologna@redhat.com>
    Reviewed-by: Ján Tomko <jtomko@redhat.com>
    
        
file modified
+10 -6