[libvirt] [PATCHv2 1/2] openvz: convert popen to virCommand
Matthias Bolte
matthias.bolte at googlemail.com
Tue Dec 7 22:20:13 UTC 2010
2010/12/7 Eric Blake <eblake at redhat.com>:
> popen must be matched with pclose (not fclose), or it will leak
> resources. Furthermore, it is a lousy interface when it comes to
> signal handling. We're much better off using our decent command
> wrapper. Note that virCommand guarantees that VIR_FREE(outbuf) is
> both required and safe to call, whether virCommandRun succeeded or
> failed.
>
> * src/openvz/openvz_conf.c (openvzLoadDomains, openvzGetVEID):
> Replace popen with virCommand usage.
> ---
>
> v2: avoid memory leak on failure in openvzGetVEID
>
> This patch is awaiting review on these prerequisites:
> https://www.redhat.com/archives/libvir-list/2010-December/msg00318.html
> https://www.redhat.com/archives/libvir-list/2010-December/msg00321.html
>
> src/openvz/openvz_conf.c | 55 ++++++++++++++++++++++++---------------------
> 1 files changed, 29 insertions(+), 26 deletions(-)
>
ACK.
Matthias
More information about the libvir-list
mailing list