summaryrefslogtreecommitdiffstats
path: root/qom
diff options
context:
space:
mode:
authorPeter Maydell2020-09-24 19:48:45 +0200
committerPeter Maydell2020-09-24 19:48:45 +0200
commit8c1c07929feae876202ba26f07a540c5115c18cd (patch)
tree20f6c8e2ac556bfb3c88a98c0d0cb2689de0263e /qom
parentMerge remote-tracking branch 'remotes/kraxel/tags/audio-20200923-pull-request... (diff)
parentqemu/atomic.h: rename atomic_ to qatomic_ (diff)
downloadqemu-8c1c07929feae876202ba26f07a540c5115c18cd.tar.gz
qemu-8c1c07929feae876202ba26f07a540c5115c18cd.tar.xz
qemu-8c1c07929feae876202ba26f07a540c5115c18cd.zip
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request This includes the atomic_ -> qatomic_ rename that touches many files and is prone to conflicts. # gpg: Signature made Wed 23 Sep 2020 17:08:43 BST # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qemu/atomic.h: rename atomic_ to qatomic_ tests: add test-fdmon-epoll fdmon-poll: reset npfd when upgrading to fdmon-epoll gitmodules: add qemu.org vbootrom submodule gitmodules: switch to qemu.org meson mirror gitmodules: switch to qemu.org qboot mirror docs/system: clarify deprecation schedule virtio-crypto: don't modify elem->in/out_sg virtio-blk: undo destructive iov_discard_*() operations util/iov: add iov_discard_undo() virtio: add vhost-user-fs-ccw device libvhost-user: handle endianness as mandated by the spec MAINTAINERS: add Stefan Hajnoczi as block/nvme.c maintainer Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/qom/object.c b/qom/object.c
index a1ab9a7801..c335dce7e4 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -867,7 +867,7 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename,
Object *inst;
for (i = 0; obj && i < OBJECT_CLASS_CAST_CACHE; i++) {
- if (atomic_read(&obj->class->object_cast_cache[i]) == typename) {
+ if (qatomic_read(&obj->class->object_cast_cache[i]) == typename) {
goto out;
}
}
@@ -884,10 +884,10 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename,
if (obj && obj == inst) {
for (i = 1; i < OBJECT_CLASS_CAST_CACHE; i++) {
- atomic_set(&obj->class->object_cast_cache[i - 1],
- atomic_read(&obj->class->object_cast_cache[i]));
+ qatomic_set(&obj->class->object_cast_cache[i - 1],
+ qatomic_read(&obj->class->object_cast_cache[i]));
}
- atomic_set(&obj->class->object_cast_cache[i - 1], typename);
+ qatomic_set(&obj->class->object_cast_cache[i - 1], typename);
}
out:
@@ -957,7 +957,7 @@ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *class,
int i;
for (i = 0; class && i < OBJECT_CLASS_CAST_CACHE; i++) {
- if (atomic_read(&class->class_cast_cache[i]) == typename) {
+ if (qatomic_read(&class->class_cast_cache[i]) == typename) {
ret = class;
goto out;
}
@@ -978,10 +978,10 @@ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *class,
#ifdef CONFIG_QOM_CAST_DEBUG
if (class && ret == class) {
for (i = 1; i < OBJECT_CLASS_CAST_CACHE; i++) {
- atomic_set(&class->class_cast_cache[i - 1],
- atomic_read(&class->class_cast_cache[i]));
+ qatomic_set(&class->class_cast_cache[i - 1],
+ qatomic_read(&class->class_cast_cache[i]));
}
- atomic_set(&class->class_cast_cache[i - 1], typename);
+ qatomic_set(&class->class_cast_cache[i - 1], typename);
}
out:
#endif
@@ -1166,7 +1166,7 @@ Object *object_ref(void *objptr)
if (!obj) {
return NULL;
}
- atomic_inc(&obj->ref);
+ qatomic_inc(&obj->ref);
return obj;
}
@@ -1179,7 +1179,7 @@ void object_unref(void *objptr)
g_assert(obj->ref > 0);
/* parent always holds a reference to its children */
- if (atomic_fetch_dec(&obj->ref) == 1) {
+ if (qatomic_fetch_dec(&obj->ref) == 1) {
object_finalize(obj);
}
}