Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/nwfilter/nwfilter_dhcpsnoop.c | 2 +- src/test/test_driver.c | 4 ++-- src/util/viratomic.h | 9 --------- src/util/virobject.c | 2 +- src/util/virsystemd.c | 10 +++++----- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c index 074cffecb2..b82779609d 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -1884,7 +1884,7 @@ virNWFilterSnoopLeaseFileRefresh(void) TMPLEASEFILE, LEASEFILE); unlink(TMPLEASEFILE); } - virAtomicIntSet(&virNWFilterSnoopState.wLeases, 0); + g_atomic_int_set(&virNWFilterSnoopState.wLeases, 0); skip_rename: virNWFilterSnoopLeaseFileOpen(); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6f617592f3..4e159157d7 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -106,7 +106,7 @@ struct _testDriver { size_t numAuths; testAuthPtr auths; - /* virAtomic access only */ + /* g_atomic access only */ volatile int nextDomID; /* immutable pointer, immutable object after being initialized with @@ -448,7 +448,7 @@ testDriverNew(void) !(ret->pools = virStoragePoolObjListNew())) goto error; - virAtomicIntSet(&ret->nextDomID, 1); + g_atomic_int_set(&ret->nextDomID, 1); return ret; diff --git a/src/util/viratomic.h b/src/util/viratomic.h index 6c1764f7bf..2811447a29 100644 --- a/src/util/viratomic.h +++ b/src/util/viratomic.h @@ -26,15 +26,6 @@ #include "internal.h" -/** - * virAtomicIntSet: - * Sets the value of atomic to newval. - * - * This call acts as a full compiler and hardware memory barrier - * (after the set) - */ -#define virAtomicIntSet(i, newv) g_atomic_int_set(i, newv) - /** * virAtomicIntInc: * Increments the value of atomic by 1. diff --git a/src/util/virobject.c b/src/util/virobject.c index 5af14234f2..8cece6e735 100644 --- a/src/util/virobject.c +++ b/src/util/virobject.c @@ -246,7 +246,7 @@ virObjectNew(virClassPtr klass) obj->u.s.magic = klass->magic; obj->klass = klass; - virAtomicIntSet(&obj->u.s.refs, 1); + g_atomic_int_set(&obj->u.s.refs, 1); PROBE(OBJECT_NEW, "obj=%p classname=%s", obj, obj->klass->name); diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 5b66094de5..6b47f4fa36 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -160,13 +160,13 @@ virSystemdHasMachined(void) if ((ret = virDBusIsServiceEnabled("org.freedesktop.machine1")) < 0) { if (ret == -2) - virAtomicIntSet(&virSystemdHasMachinedCachedValue, -2); + g_atomic_int_set(&virSystemdHasMachinedCachedValue, -2); return ret; } if ((ret = virDBusIsServiceRegistered("org.freedesktop.systemd1")) == -1) return ret; - virAtomicIntSet(&virSystemdHasMachinedCachedValue, ret); + g_atomic_int_set(&virSystemdHasMachinedCachedValue, ret); return ret; } @@ -183,14 +183,14 @@ virSystemdHasLogind(void) ret = virDBusIsServiceEnabled("org.freedesktop.login1"); if (ret < 0) { if (ret == -2) - virAtomicIntSet(&virSystemdHasLogindCachedValue, -2); + g_atomic_int_set(&virSystemdHasLogindCachedValue, -2); return ret; } if ((ret = virDBusIsServiceRegistered("org.freedesktop.login1")) == -1) return ret; - virAtomicIntSet(&virSystemdHasLogindCachedValue, ret); + g_atomic_int_set(&virSystemdHasLogindCachedValue, ret); return ret; } @@ -386,7 +386,7 @@ int virSystemdCreateMachine(const char *name, VIR_INFO("CreateMachineWithNetwork isn't supported, switching " "to legacy CreateMachine method for systemd-machined"); virResetError(&error); - virAtomicIntSet(&hasCreateWithNetwork, 0); + g_atomic_int_set(&hasCreateWithNetwork, 0); /* Could re-structure without Using goto, but this * avoids another atomic read which would trigger * another memory barrier */ -- 2.24.1