
On Fri, Jan 10, 2020 at 03:41:12PM +0000, Daniel P. Berrangé wrote:
Libvirt's original atomic ops impls were largely copied from GLib's code at the time. The only API difference was that libvirt's virAtomicIntInc() would return a value, but g_atomic_int_inc was void. We thus use g_atomic_int_add(v, 1) instead, though this means virAtomicIntInc() now returns the original value, instead of the new value.
This rewrites libvirt's impl in terms of g_atomic_int* as a short term conversion. The key motivation was to quickly eliminate use of GNULIB's verify_expr() macro which is not a direct match for G_STATIC_ASSERT_EXPR. Long term all the callers should be updated to use g_atomic_int* directly.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- src/libxl/libxl_domain.c | 2 +- src/libxl/libxl_driver.c | 2 +- src/lxc/lxc_process.c | 4 +- src/nwfilter/nwfilter_dhcpsnoop.c | 6 +- src/qemu/qemu_process.c | 4 +- src/util/viratomic.h | 351 ++---------------------------- src/util/virprocess.c | 2 +- tests/viratomictest.c | 2 +- 8 files changed, 26 insertions(+), 347 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>