b259e45 API: Tweak virDomainOpenGraphics to return fd directly

Authored and Committed by ericb 9 years ago
    API: Tweak virDomainOpenGraphics to return fd directly
    
    Let's fix this before we bake in a painful API.  Since we know
    that we have exactly one non-negative fd on success, we might
    as well return the fd directly instead of forcing the user to
    pass in a pointer.  Furthermore, I found some memory and fd
    leaks while reviewing the code - the idea is that on success,
    libvirtd will have handed two fds in two different directions:
    one to qemu, and one to the RPC client.
    
    * include/libvirt/libvirt.h.in (virDomainOpenGraphicsFD): Drop
    unneeded parameter.
    * src/driver.h (virDrvDomainOpenGraphicsFD): Likewise.
    * src/libvirt.c (virDomainOpenGraphicsFD): Adjust interface to
    return fd directly.
    * daemon/remote.c (remoteDispatchDomainOpenGraphicsFd): Adjust
    semantics.
    * src/qemu/qemu_driver.c (qemuDomainOpenGraphicsFD): Likewise,
    and plug fd leak.
    * src/remote/remote_driver.c (remoteDomainOpenGraphicsFD):
    Likewise, and plug memory and fd leak.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+6 -4
file modified
+0 -1
file modified
+0 -1
file modified
+8 -9
file modified
+7 -7
file modified
+11 -6