[PATCH 1/7] test_driver: Replace virAtomicIntAdd() with virAtomicIntInc()

Ján Tomko jtomko at redhat.com
Sun Feb 2 14:20:23 UTC 2020


On Sat, Feb 01, 2020 at 07:33:43AM +0100, Michal Privoznik wrote:
>Instead of calling virAtomicIntAdd(&var, 1); we can call
>virAtomicIntInc(&var) directly.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/test/test_driver.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/test/test_driver.c b/src/test/test_driver.c
>index 47c1fc588f..6f617592f3 100644
>--- a/src/test/test_driver.c
>+++ b/src/test/test_driver.c
>@@ -695,7 +695,7 @@ testDomainStartState(testDriverPtr privconn,
>     int ret = -1;
>
>     virDomainObjSetState(dom, VIR_DOMAIN_RUNNING, reason);
>-    dom->def->id = virAtomicIntAdd(&privconn->nextDomID, 1);
>+    dom->def->id = virAtomicIntInc(&privconn->nextDomID);

g_atomic_int_add(&privconn->nextDomID, 1);

I don't see the value of changing it to a function that is being phased
out.

With that fixed:
Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200202/2acc09f3/attachment-0001.sig>


More information about the libvir-list mailing list