[PATCHv4 00/17] new VIR_(APPEND|INSERT|DELETE)_ELEMENT macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



DO NOT BE SCARED OFF BY THE PATCH COUNT!! Most of these are very
short, and they all follow the same pattern; beyond that, 01/17 and
02/17 are the only ones that I really want to push now; the others are
so far only for informational purposes (although you can apply them
locally if you want :-)

The first patch in this series adds new macros to insert/append/delete
elements from the arrays of variously-sized structs that are commonly
used in libvirt. The intent is to eliminate the arithmetic mistakes
associated with calling memmove() directly, and shorten application
code. A full description of the added macros and their functions is
included in 01/17.

Patches 02..17 convert various bits of hand-coded array manipulation
in libvirt to use the new macros. They can be taken now, later, or
never (although I'd like to have at least 02/17 taken now, since other
similar functions will be added in an upcoming patch series, and I
want them to all use the same logic). Mostly I went through all of
those conversions to see just how useful/usable the new macros were
(and they led to a couple of rewrites).

Changes from V3 - fixed things in 01/17 according to Eric's comments
on V3 (including changing from passing &newelem to passing newelem,
which we separately discussed on IRC). 02-17 just have their calling
sequences adjusted to replace all "&item" with "item" to account for
the change.

I will be (re)posting another series momentarily that has a dependency on
01/17.

Laine Stump (17):
  util: add VIR_(APPEND|INSERT|DELETE)_ELEMENT
  conf: use VIR_(INSERT|DELETE)_ELEMENT in virNetworkUpdate backend
  conf: use VIR_DELETE_ELEMENT for conf object lists
  conf: use VIR_(APPEND|DELETE)_ELEMENT for domain device lists
  conf: use VIR_(APPEND|DELETE)_ELEMENT for domain event lists
  conf: use VIR_(APPEND|DELETE)_ELEMENT for vcpupin list
  xen: Use VIR_DELETE_ELEMENT for disk/net devices
  xen: use VIR_DELETE_ELEMENT for xen domain and watch lists
  util: use VIR_(APPEND|DELETE)_ELEMENT for pci/usb device lists
  util: use VIR_(APPEND|DELETE)_ELEMENT for win32 waiting events list
  rpc: use VIR_DELETE_ELEMENT for list of netclient streams
  rpc: use VIR_(APPEND|DELETE)_ELEMENT for netserver client lists
  test: use VIR_(APPEND|DELETE)_ELEMENT for qemuMonitorTest list
  nwfilter: use VIR_(APPEND|DELETE)_ELEMENT for lists
  util: eliminate leak in ebtables
  util: use VIR_(APPEND|DELETE)_ELEMENT for ebtables rule lists
  util: use VIR_(APPEND|DELETE)_ELEMENT for lock owners lists

 cfg.mk                                 |   2 +-
 src/conf/domain_conf.c                 | 152 ++++++------------------------
 src/conf/domain_conf.h                 |  12 +--
 src/conf/domain_event.c                |  51 ++--------
 src/conf/interface_conf.c              |  13 +--
 src/conf/interface_conf.h              |   4 +-
 src/conf/network_conf.c                | 102 +++++---------------
 src/conf/network_conf.h                |   6 +-
 src/conf/node_device_conf.c            |  11 +--
 src/conf/node_device_conf.h            |   4 +-
 src/conf/nwfilter_conf.c               |  46 +++------
 src/conf/nwfilter_conf.h               |   8 +-
 src/conf/nwfilter_params.c             |   8 +-
 src/conf/storage_conf.c                |  11 +--
 src/conf/storage_conf.h                |   4 +-
 src/libvirt_private.syms               |   2 +
 src/nwfilter/nwfilter_gentech_driver.c |  15 ++-
 src/parallels/parallels_storage.c      |  14 +--
 src/qemu/qemu_cgroup.c                 |   2 +-
 src/qemu/qemu_cgroup.h                 |   2 +-
 src/qemu/qemu_domain.c                 |   6 +-
 src/qemu/qemu_driver.c                 |   4 +-
 src/rpc/virnetclient.c                 |  21 +----
 src/rpc/virnetserver.c                 |  14 +--
 src/storage/storage_backend_rbd.c      |   2 +-
 src/storage/storage_driver.c           |  12 +--
 src/test/test_driver.c                 |  14 +--
 src/util/ebtables.c                    |  29 ++----
 src/util/ebtables.h                    |   4 +-
 src/util/hostusb.c                     |  26 ++---
 src/util/memory.c                      | 106 ++++++++++++++++++++-
 src/util/memory.h                      | 167 ++++++++++++++++++++++++++++++++-
 src/util/pci.c                         |  18 +---
 src/util/threads-win32.c               |  15 +--
 src/util/virlockspace.c                |  20 +---
 src/xen/xen_driver.c                   |  14 +--
 src/xen/xen_driver.h                   |   4 +-
 src/xen/xen_inotify.c                  |  16 +---
 src/xen/xm_internal.c                  |  14 +--
 src/xen/xs_internal.c                  |  13 +--
 src/xen/xs_internal.h                  |   2 +-
 tests/qemumonitortestutils.c           |  23 +----
 42 files changed, 437 insertions(+), 576 deletions(-)

-- 
1.7.11.7

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]