mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
Drop virAtomic module
Now, that every use of virAtomic was replaced with its g_atomic equivalent, let's remove the module. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7390ff3caa
commit
a37a8c569d
@ -302,7 +302,6 @@ LIBVIRT_ARG_YAJL
|
|||||||
|
|
||||||
LIBVIRT_CHECK_ACL
|
LIBVIRT_CHECK_ACL
|
||||||
LIBVIRT_CHECK_APPARMOR
|
LIBVIRT_CHECK_APPARMOR
|
||||||
LIBVIRT_CHECK_ATOMIC
|
|
||||||
LIBVIRT_CHECK_ATTR
|
LIBVIRT_CHECK_ATTR
|
||||||
LIBVIRT_CHECK_AUDIT
|
LIBVIRT_CHECK_AUDIT
|
||||||
LIBVIRT_CHECK_BASH_COMPLETION
|
LIBVIRT_CHECK_BASH_COMPLETION
|
||||||
|
@ -1,77 +0,0 @@
|
|||||||
dnl The atomic implementation check
|
|
||||||
dnl
|
|
||||||
dnl Copyright (C) 2016 Red Hat, Inc.
|
|
||||||
dnl
|
|
||||||
dnl This library is free software; you can redistribute it and/or
|
|
||||||
dnl modify it under the terms of the GNU Lesser General Public
|
|
||||||
dnl License as published by the Free Software Foundation; either
|
|
||||||
dnl version 2.1 of the License, or (at your option) any later version.
|
|
||||||
dnl
|
|
||||||
dnl This library is distributed in the hope that it will be useful,
|
|
||||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
dnl Lesser General Public License for more details.
|
|
||||||
dnl
|
|
||||||
dnl You should have received a copy of the GNU Lesser General Public
|
|
||||||
dnl License along with this library. If not, see
|
|
||||||
dnl <http://www.gnu.org/licenses/>.
|
|
||||||
dnl
|
|
||||||
|
|
||||||
AC_DEFUN([LIBVIRT_CHECK_ATOMIC], [
|
|
||||||
AC_REQUIRE([LIBVIRT_CHECK_PTHREAD])
|
|
||||||
|
|
||||||
dnl We need to decide at configure time if libvirt will use real atomic
|
|
||||||
dnl operations ("lock free") or emulated ones with a mutex.
|
|
||||||
dnl
|
|
||||||
dnl Note that the atomic ops are only available with GCC on x86 when
|
|
||||||
dnl using -march=i486 or higher. If we detect that the atomic ops are
|
|
||||||
dnl not available but would be available given the right flags, we want
|
|
||||||
dnl to abort and advise the user to fix their CFLAGS. It's better to do
|
|
||||||
dnl that then to silently fall back on emulated atomic ops just because
|
|
||||||
dnl the user had the wrong build environment.
|
|
||||||
|
|
||||||
atomic_ops=
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for atomic ops implementation])
|
|
||||||
|
|
||||||
AC_TRY_COMPILE([], [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],[
|
|
||||||
atomic_ops=gcc
|
|
||||||
],[])
|
|
||||||
|
|
||||||
if test "$atomic_ops" = "" ; then
|
|
||||||
SAVE_CFLAGS="${CFLAGS}"
|
|
||||||
CFLAGS="-march=i486"
|
|
||||||
AC_TRY_COMPILE([],
|
|
||||||
[__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
|
|
||||||
[AC_MSG_ERROR([Libvirt must be built with -march=i486 or later.])],
|
|
||||||
[])
|
|
||||||
CFLAGS="${SAVE_CFLAGS}"
|
|
||||||
|
|
||||||
case "$host" in
|
|
||||||
*-*-mingw* | *-*-msvc* )
|
|
||||||
atomic_ops=win32
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
if test "$ac_cv_header_pthread_h" = "yes" ; then
|
|
||||||
atomic_ops=pthread
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR([Libvirt must be built with GCC or have pthread.h on non-Win32 platforms])
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$atomic_ops" in
|
|
||||||
gcc)
|
|
||||||
AC_DEFINE([VIR_ATOMIC_OPS_GCC],[1],[Use GCC atomic ops])
|
|
||||||
;;
|
|
||||||
win32)
|
|
||||||
AC_DEFINE([VIR_ATOMIC_OPS_WIN32],[1],[Use Win32 atomic ops])
|
|
||||||
;;
|
|
||||||
pthread)
|
|
||||||
AC_DEFINE([VIR_ATOMIC_OPS_PTHREAD],[1],[Use pthread atomic ops emulation])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
AM_CONDITIONAL([WITH_ATOMIC_OPS_PTHREAD],[test "$atomic_ops" = "pthread"])
|
|
||||||
AC_MSG_RESULT([$atomic_ops])
|
|
||||||
])
|
|
@ -390,12 +390,6 @@ else ! WITH_SSH2
|
|||||||
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
|
SYM_FILES += $(srcdir)/libvirt_libssh2.syms
|
||||||
endif ! WITH_SSH2
|
endif ! WITH_SSH2
|
||||||
|
|
||||||
if WITH_ATOMIC_OPS_PTHREAD
|
|
||||||
USED_SYM_FILES += $(srcdir)/libvirt_atomic.syms
|
|
||||||
else ! WITH_ATOMIC_OPS_PTHREAD
|
|
||||||
SYM_FILES += $(srcdir)/libvirt_atomic.syms
|
|
||||||
endif ! WITH_ATOMIC_OPS_PTHREAD
|
|
||||||
|
|
||||||
if WITH_LIBSSH
|
if WITH_LIBSSH
|
||||||
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
|
USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
|
||||||
else ! WITH_LIBSSH
|
else ! WITH_LIBSSH
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#
|
|
||||||
# These symbols are dependent upon !VIR_ATOMIC_OPS_GCC.
|
|
||||||
#
|
|
||||||
|
|
||||||
# util/viratomic.h
|
|
||||||
virAtomicLock;
|
|
||||||
|
|
||||||
# Let emacs know we want case-insensitive sorting
|
|
||||||
# Local Variables:
|
|
||||||
# sort-fold-case: t
|
|
||||||
# End:
|
|
@ -26,7 +26,6 @@
|
|||||||
#include "libxl_capabilities.h"
|
#include "libxl_capabilities.h"
|
||||||
|
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virhook.h"
|
#include "virhook.h"
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virsysinfo.h"
|
#include "virsysinfo.h"
|
||||||
#include "viraccessapicheck.h"
|
#include "viraccessapicheck.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virhostdev.h"
|
#include "virhostdev.h"
|
||||||
#include "virpidfile.h"
|
#include "virpidfile.h"
|
||||||
#include "locking/domain_lock.h"
|
#include "locking/domain_lock.h"
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
#include "lxc_hostdev.h"
|
#include "lxc_hostdev.h"
|
||||||
#include "virhook.h"
|
#include "virhook.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virprocess.h"
|
#include "virprocess.h"
|
||||||
#include "virsystemd.h"
|
#include "virsystemd.h"
|
||||||
#include "netdev_bandwidth_conf.h"
|
#include "netdev_bandwidth_conf.h"
|
||||||
|
@ -55,7 +55,6 @@
|
|||||||
#include "nwfilter_ipaddrmap.h"
|
#include "nwfilter_ipaddrmap.h"
|
||||||
#include "virnetdev.h"
|
#include "virnetdev.h"
|
||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virsocketaddr.h"
|
#include "virsocketaddr.h"
|
||||||
#include "virthreadpool.h"
|
#include "virthreadpool.h"
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#include "virfile.h"
|
#include "virfile.h"
|
||||||
#include "virsocket.h"
|
#include "virsocket.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "storage_conf.h"
|
#include "storage_conf.h"
|
||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
#include "virstoragefile.h"
|
#include "virstoragefile.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virthreadjob.h"
|
#include "virthreadjob.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virprocess.h"
|
#include "virprocess.h"
|
||||||
#include "vircrypto.h"
|
#include "vircrypto.h"
|
||||||
#include "virrandom.h"
|
#include "virrandom.h"
|
||||||
|
@ -79,7 +79,6 @@
|
|||||||
#include "virnetdevopenvswitch.h"
|
#include "virnetdevopenvswitch.h"
|
||||||
#include "virnetdevmidonet.h"
|
#include "virnetdevmidonet.h"
|
||||||
#include "virbitmap.h"
|
#include "virbitmap.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virnuma.h"
|
#include "virnuma.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virhostdev.h"
|
#include "virhostdev.h"
|
||||||
|
@ -59,7 +59,6 @@
|
|||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "cpu/cpu.h"
|
#include "cpu/cpu.h"
|
||||||
#include "virauth.h"
|
#include "virauth.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virdomainobjlist.h"
|
#include "virdomainobjlist.h"
|
||||||
#include "virinterfaceobj.h"
|
#include "virinterfaceobj.h"
|
||||||
#include "virhostcpu.h"
|
#include "virhostcpu.h"
|
||||||
|
@ -11,8 +11,6 @@ UTIL_SOURCES = \
|
|||||||
util/virarch.h \
|
util/virarch.h \
|
||||||
util/virarptable.c \
|
util/virarptable.c \
|
||||||
util/virarptable.h \
|
util/virarptable.h \
|
||||||
util/viratomic.c \
|
|
||||||
util/viratomic.h \
|
|
||||||
util/viraudit.c \
|
util/viraudit.c \
|
||||||
util/viraudit.h \
|
util/viraudit.h \
|
||||||
util/virauth.c \
|
util/virauth.c \
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* viratomic.c: atomic integer operations
|
|
||||||
*
|
|
||||||
* Copyright (C) 2012 Red Hat, Inc.
|
|
||||||
*
|
|
||||||
* Based on code taken from GLib 2.32, under the LGPLv2+
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Ryan Lortie
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "viratomic.h"
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef VIR_ATOMIC_OPS_PTHREAD
|
|
||||||
|
|
||||||
pthread_mutex_t virAtomicLock = PTHREAD_MUTEX_INITIALIZER;
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,90 +0,0 @@
|
|||||||
/*
|
|
||||||
* viratomic.h: atomic integer operations
|
|
||||||
*
|
|
||||||
* Copyright (C) 2012-2020 Red Hat, Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* APIs in this header should no longer be used. Direct
|
|
||||||
* use of the g_atomic APIs is preferred & existing code
|
|
||||||
* should be converted as needed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* virAtomicIntCompareExchange:
|
|
||||||
* Compares atomic to oldval and, if equal, sets it to newval. If
|
|
||||||
* atomic was not equal to oldval then no change occurs.
|
|
||||||
*
|
|
||||||
* This compare and exchange is done atomically.
|
|
||||||
*
|
|
||||||
* Think of this operation as an atomic version of
|
|
||||||
* { if (*atomic == oldval) { *atomic = newval; return true; }
|
|
||||||
* else return false; }
|
|
||||||
*
|
|
||||||
* This call acts as a full compiler and hardware memory barrier.
|
|
||||||
*/
|
|
||||||
#define virAtomicIntCompareExchange(i, oldi, newi) \
|
|
||||||
(!!g_atomic_int_compare_and_exchange(i, oldi, newi))
|
|
||||||
|
|
||||||
/**
|
|
||||||
* virAtomicIntAdd:
|
|
||||||
* Atomically adds val to the value of atomic.
|
|
||||||
*
|
|
||||||
* Think of this operation as an atomic version of
|
|
||||||
* { tmp = *atomic; *atomic += val; return tmp; }
|
|
||||||
*
|
|
||||||
* This call acts as a full compiler and hardware memory barrier.
|
|
||||||
*/
|
|
||||||
#define virAtomicIntAdd(i, v) g_atomic_int_add(i, v)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* virAtomicIntAnd:
|
|
||||||
* Performs an atomic bitwise 'and' of the value of atomic
|
|
||||||
* and val, storing the result back in atomic.
|
|
||||||
*
|
|
||||||
* This call acts as a full compiler and hardware memory barrier.
|
|
||||||
*
|
|
||||||
* Think of this operation as an atomic version of
|
|
||||||
* { tmp = *atomic; *atomic &= val; return tmp; }
|
|
||||||
*/
|
|
||||||
#define virAtomicIntAnd(i, v) g_atomic_int_and(i, v)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* virAtomicIntOr:
|
|
||||||
* Performs an atomic bitwise 'or' of the value of atomic
|
|
||||||
* and val, storing the result back in atomic.
|
|
||||||
*
|
|
||||||
* Think of this operation as an atomic version of
|
|
||||||
* { tmp = *atomic; *atomic |= val; return tmp; }
|
|
||||||
*
|
|
||||||
* This call acts as a full compiler and hardware memory barrier.
|
|
||||||
*/
|
|
||||||
#define virAtomicIntOr(i, v) g_atomic_int_or(i, v)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* virAtomicIntXor:
|
|
||||||
* Performs an atomic bitwise 'xor' of the value of atomic
|
|
||||||
* and val, storing the result back in atomic.
|
|
||||||
*
|
|
||||||
* Think of this operation as an atomic version of
|
|
||||||
* { tmp = *atomic; *atomic ^= val; return tmp; }
|
|
||||||
*
|
|
||||||
* This call acts as a full compiler and hardware memory barrier.
|
|
||||||
*/
|
|
||||||
#define virAtomicIntXor(i, v) g_atomic_int_xor(i, v)
|
|
@ -25,7 +25,6 @@
|
|||||||
#include "virobject.h"
|
#include "virobject.h"
|
||||||
#include "virthread.h"
|
#include "virthread.h"
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "virprobe.h"
|
#include "virprobe.h"
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virprocess.h"
|
#include "virprocess.h"
|
||||||
#include "virerror.h"
|
#include "virerror.h"
|
||||||
#include "viralloc.h"
|
#include "viralloc.h"
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include "virsystemdpriv.h"
|
#include "virsystemdpriv.h"
|
||||||
|
|
||||||
#include "virsystemd.h"
|
#include "virsystemd.h"
|
||||||
#include "viratomic.h"
|
|
||||||
#include "virbuffer.h"
|
#include "virbuffer.h"
|
||||||
#include "virdbus.h"
|
#include "virdbus.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user