[libvirt] [PATCH 0/6] Introduce VIR_AUTOCLOSE macro for closing fd automatically

Shi Lei posted 6 patches 5 years, 7 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
src/phyp/phyp_driver.c     |  29 ++---
src/uml/uml_conf.c         |  13 +-
src/util/virfile.c         |  21 +--
src/util/virfile.h         |  20 ++-
src/util/virnetdev.c       | 253 +++++++++++++------------------------
src/util/virnetdevbridge.c | 120 ++++++------------
6 files changed, 163 insertions(+), 293 deletions(-)
[libvirt] [PATCH 0/6] Introduce VIR_AUTOCLOSE macro for closing fd automatically
Posted by Shi Lei 5 years, 7 months ago
This series introduce VIR_AUTOCLOSE macro which can force close fd of the file
automatically when the fd goes out of scope. It's used to eliminate VIR_FORCE_CLOSE
in cleanup sections. The new macro consults VIR_AUTOFREE and VIR_AUTOPTR.

Shi Lei (6):
  util: file: introduce VIR_AUTOCLOSE macro to close fd of the file
    automatically
  util: file: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
    sections
  util: netdevbridge: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in
    cleanup sections
  util: netdev: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
    sections
  phyp: driver: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
    sections
  uml: conf: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
    sections

 src/phyp/phyp_driver.c     |  29 ++---
 src/uml/uml_conf.c         |  13 +-
 src/util/virfile.c         |  21 +--
 src/util/virfile.h         |  20 ++-
 src/util/virnetdev.c       | 253 +++++++++++++------------------------
 src/util/virnetdevbridge.c | 120 ++++++------------
 6 files changed, 163 insertions(+), 293 deletions(-)

-- 
2.17.1


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/6] Introduce VIR_AUTOCLOSE macro for closing fd automatically
Posted by Erik Skultety 5 years, 7 months ago
On Mon, Sep 10, 2018 at 11:47:49AM +0800, Shi Lei wrote:
> This series introduce VIR_AUTOCLOSE macro which can force close fd of the file
> automatically when the fd goes out of scope. It's used to eliminate VIR_FORCE_CLOSE
> in cleanup sections. The new macro consults VIR_AUTOFREE and VIR_AUTOPTR.
>
> Shi Lei (6):
>   util: file: introduce VIR_AUTOCLOSE macro to close fd of the file
>     automatically
>   util: file: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
>     sections
>   util: netdevbridge: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in
>     cleanup sections
>   util: netdev: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
>     sections
>   phyp: driver: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
>     sections
>   uml: conf: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE in cleanup
>     sections
>
>  src/phyp/phyp_driver.c     |  29 ++---
>  src/uml/uml_conf.c         |  13 +-
>  src/util/virfile.c         |  21 +--
>  src/util/virfile.h         |  20 ++-
>  src/util/virnetdev.c       | 253 +++++++++++++------------------------
>  src/util/virnetdevbridge.c | 120 ++++++------------

This touches only a handful of util modules and random drivers, there should be
some consistency here, so if we're introducing something like this, then we
should do it in a similar manner as we did for VIR_AUTO{FREE,PTR}, i.e. util/
first (btw. we still haven't even finished that one yet).

Erik

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list