[libvirt] [PATCH] API: Tweak virDomainOpenGraphics to return fd directly
Ján Tomko
jtomko at redhat.com
Wed Aug 27 08:35:13 UTC 2014
On 08/27/2014 12:05 AM, Eric Blake wrote:
> 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. Fix a memory leak I found while reviewing.
Thank you!
Not only it looks nicer, the python binding can also be generated
automatically now, with no change required.
Jan
>
> * 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.
> * src/remote/remote_driver.c (remoteDomainOpenGraphicsFD):
> Likewise, and plug memory leak.
>
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
> daemon/remote.c | 9 +++++----
> include/libvirt/libvirt.h.in | 1 -
> src/driver.h | 1 -
> src/libvirt.c | 14 ++++++--------
> src/qemu/qemu_driver.c | 3 +--
> src/remote/remote_driver.c | 17 +++++++++++------
> 6 files changed, 23 insertions(+), 22 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140827/bd180fe6/attachment-0001.sig>
More information about the libvir-list
mailing list