]> xenbits.xensource.com Git - libvirt.git/commitdiff
Drop virAtomic module
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 31 Jan 2020 16:32:39 +0000 (17:32 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Sun, 2 Feb 2020 15:36:58 +0000 (16:36 +0100)
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>
18 files changed:
configure.ac
m4/virt-atomic.m4 [deleted file]
src/Makefile.am
src/libvirt_atomic.syms [deleted file]
src/libxl/libxl_domain.c
src/libxl/libxl_driver.c
src/lxc/lxc_process.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/qemu/qemu_conf.c
src/qemu/qemu_domain.c
src/qemu/qemu_process.c
src/test/test_driver.c
src/util/Makefile.inc.am
src/util/viratomic.c [deleted file]
src/util/viratomic.h [deleted file]
src/util/virobject.c
src/util/virprocess.c
src/util/virsystemd.c

index b1f75fa7511963a2ab0e86a9fcf02a67c504535f..5bd9bc841acf7f4ea9367d485bceff2ad01d9fff 100644 (file)
@@ -302,7 +302,6 @@ LIBVIRT_ARG_YAJL
 
 LIBVIRT_CHECK_ACL
 LIBVIRT_CHECK_APPARMOR
-LIBVIRT_CHECK_ATOMIC
 LIBVIRT_CHECK_ATTR
 LIBVIRT_CHECK_AUDIT
 LIBVIRT_CHECK_BASH_COMPLETION
diff --git a/m4/virt-atomic.m4 b/m4/virt-atomic.m4
deleted file mode 100644 (file)
index d96f7a2..0000000
+++ /dev/null
@@ -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])
-])
index 58355c53372bba567dbcbd03634c9430e3836250..7bb6127ca4b775fc01df0e7b2ecc127e63a3456d 100644 (file)
@@ -390,12 +390,6 @@ else ! WITH_SSH2
 SYM_FILES += $(srcdir)/libvirt_libssh2.syms
 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
 USED_SYM_FILES += $(srcdir)/libvirt_libssh.syms
 else ! WITH_LIBSSH
diff --git a/src/libvirt_atomic.syms b/src/libvirt_atomic.syms
deleted file mode 100644 (file)
index e2c2363..0000000
+++ /dev/null
@@ -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:
index d53363dc02d094ed0572740e7416e7d7f77fd401..c8b68665af26145e6abda94712b1a78982af39b4 100644 (file)
@@ -26,7 +26,6 @@
 #include "libxl_capabilities.h"
 
 #include "viralloc.h"
-#include "viratomic.h"
 #include "virfile.h"
 #include "virerror.h"
 #include "virhook.h"
index 41cbb67e3ab930606c866afc5c001e5cb062c3f7..2b06f1be1e08ae90a09da7ca32e1e38d98a43e77 100644 (file)
@@ -50,7 +50,6 @@
 #include "virstring.h"
 #include "virsysinfo.h"
 #include "viraccessapicheck.h"
-#include "viratomic.h"
 #include "virhostdev.h"
 #include "virpidfile.h"
 #include "locking/domain_lock.h"
index d8ddea6d24c1ce755af12112aa4c897fcae3b0b3..da2541e684769d488117694d6f72718addbc657d 100644 (file)
@@ -48,7 +48,6 @@
 #include "lxc_hostdev.h"
 #include "virhook.h"
 #include "virstring.h"
-#include "viratomic.h"
 #include "virprocess.h"
 #include "virsystemd.h"
 #include "netdev_bandwidth_conf.h"
index c4341ee3e2336ed69aea4e755cb5a4d17a4a76f9..e7f5b511ae7311aa3daef9bb87dea0061cb4a8af 100644 (file)
@@ -55,7 +55,6 @@
 #include "nwfilter_ipaddrmap.h"
 #include "virnetdev.h"
 #include "virfile.h"
-#include "viratomic.h"
 #include "virsocketaddr.h"
 #include "virthreadpool.h"
 #include "configmake.h"
index 0b119cbe785bdceefabec52a85785688496b7cac..024f3c16342a5291d55db9994315d9a09b11fb33 100644 (file)
@@ -45,7 +45,6 @@
 #include "virfile.h"
 #include "virsocket.h"
 #include "virstring.h"
-#include "viratomic.h"
 #include "storage_conf.h"
 #include "configmake.h"
 
index d3045b4bcd9fa37ac075243d7e2e2f6974725064..cb691ca0484a882b5e6dd7df930bd66c81761587 100644 (file)
@@ -51,7 +51,6 @@
 #include "virstoragefile.h"
 #include "virstring.h"
 #include "virthreadjob.h"
-#include "viratomic.h"
 #include "virprocess.h"
 #include "vircrypto.h"
 #include "virrandom.h"
index ed14ce5ea2e7fe7f6a9a5701cb884bc5c023c3de..ddcc763cfdcd38c178bd483ddf38b0e1d96928bf 100644 (file)
@@ -79,7 +79,6 @@
 #include "virnetdevopenvswitch.h"
 #include "virnetdevmidonet.h"
 #include "virbitmap.h"
-#include "viratomic.h"
 #include "virnuma.h"
 #include "virstring.h"
 #include "virhostdev.h"
index ba157c068630fe2612c271cf9cbc8de5041676c5..6a629988ef52b97fd2be0ad8446c226b2000c855 100644 (file)
@@ -59,7 +59,6 @@
 #include "virstring.h"
 #include "cpu/cpu.h"
 #include "virauth.h"
-#include "viratomic.h"
 #include "virdomainobjlist.h"
 #include "virinterfaceobj.h"
 #include "virhostcpu.h"
index 528c9f6cfedb24695653f30d5ed85787c6903228..2abdca548cd7f419fb4db0068cec7561c26a1a8f 100644 (file)
@@ -11,8 +11,6 @@ UTIL_SOURCES = \
        util/virarch.h \
        util/virarptable.c \
        util/virarptable.h \
-       util/viratomic.c \
-       util/viratomic.h \
        util/viraudit.c \
        util/viraudit.h \
        util/virauth.c \
diff --git a/src/util/viratomic.c b/src/util/viratomic.c
deleted file mode 100644 (file)
index 278a749..0000000
+++ /dev/null
@@ -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
diff --git a/src/util/viratomic.h b/src/util/viratomic.h
deleted file mode 100644 (file)
index 1ddc701..0000000
+++ /dev/null
@@ -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)
index 7749d89243c297ad9bcd19bbcf1b6073d06de193..c71781550f482d1d60b68bbf325efe7d1971ec4c 100644 (file)
@@ -25,7 +25,6 @@
 #include "virobject.h"
 #include "virthread.h"
 #include "viralloc.h"
-#include "viratomic.h"
 #include "virerror.h"
 #include "virlog.h"
 #include "virprobe.h"
index 689db4f19d4d898b9a6db727755d9f6be6a99fa5..23e149def46859c2c92aac92bca1ef178cd7a508 100644 (file)
@@ -57,7 +57,6 @@
 # include <windows.h>
 #endif
 
-#include "viratomic.h"
 #include "virprocess.h"
 #include "virerror.h"
 #include "viralloc.h"
index 6b47f4fa36e9281b0a9923021d12685a1ac32710..1d41ed34f717c8a660ba137c8bcc3852398c6e95 100644 (file)
@@ -25,7 +25,6 @@
 #include "virsystemdpriv.h"
 
 #include "virsystemd.h"
-#include "viratomic.h"
 #include "virbuffer.h"
 #include "virdbus.h"
 #include "virstring.h"