aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-31 17:07:33 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:27:09 -0400
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /backends
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/cryptodev-builtin.c5
-rw-r--r--backends/cryptodev-vhost-user.c5
-rw-r--r--backends/dbus-vmstate.c8
-rw-r--r--backends/hostmem-file.c4
-rw-r--r--backends/hostmem-memfd.c4
-rw-r--r--backends/rng-builtin.c3
-rw-r--r--backends/rng-egd.c3
-rw-r--r--backends/tpm/tpm_emulator.c4
-rw-r--r--backends/tpm/tpm_passthrough.c4
9 files changed, 18 insertions, 22 deletions
diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
index 84bd84efe7..f047ad0362 100644
--- a/backends/cryptodev-builtin.c
+++ b/backends/cryptodev-builtin.c
@@ -37,9 +37,8 @@
typedef struct CryptoDevBackendBuiltin
CryptoDevBackendBuiltin;
-#define CRYPTODEV_BACKEND_BUILTIN(obj) \
- OBJECT_CHECK(CryptoDevBackendBuiltin, \
- (obj), TYPE_CRYPTODEV_BACKEND_BUILTIN)
+DECLARE_INSTANCE_CHECKER(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUILTIN,
+ TYPE_CRYPTODEV_BACKEND_BUILTIN)
typedef struct CryptoDevBackendBuiltinSession {
diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c
index 5e903f6507..41089dede1 100644
--- a/backends/cryptodev-vhost-user.c
+++ b/backends/cryptodev-vhost-user.c
@@ -40,9 +40,8 @@
#define TYPE_CRYPTODEV_BACKEND_VHOST_USER "cryptodev-vhost-user"
typedef struct CryptoDevBackendVhostUser CryptoDevBackendVhostUser;
-#define CRYPTODEV_BACKEND_VHOST_USER(obj) \
- OBJECT_CHECK(CryptoDevBackendVhostUser, \
- (obj), TYPE_CRYPTODEV_BACKEND_VHOST_USER)
+DECLARE_INSTANCE_CHECKER(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VHOST_USER,
+ TYPE_CRYPTODEV_BACKEND_VHOST_USER)
struct CryptoDevBackendVhostUser {
diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c
index 0473c5c335..bfbd4f09f1 100644
--- a/backends/dbus-vmstate.c
+++ b/backends/dbus-vmstate.c
@@ -25,12 +25,8 @@ typedef struct DBusVMState DBusVMState;
typedef struct DBusVMStateClass DBusVMStateClass;
#define TYPE_DBUS_VMSTATE "dbus-vmstate"
-#define DBUS_VMSTATE(obj) \
- OBJECT_CHECK(DBusVMState, (obj), TYPE_DBUS_VMSTATE)
-#define DBUS_VMSTATE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(DBusVMStateClass, (obj), TYPE_DBUS_VMSTATE)
-#define DBUS_VMSTATE_CLASS(klass) \
- OBJECT_CLASS_CHECK(DBusVMStateClass, (klass), TYPE_DBUS_VMSTATE)
+DECLARE_OBJ_CHECKERS(DBusVMState, DBusVMStateClass,
+ DBUS_VMSTATE, TYPE_DBUS_VMSTATE)
struct DBusVMStateClass {
ObjectClass parent_class;
diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index 2c3bcb8291..a3b2e8209e 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -20,8 +20,8 @@
#include "qom/object.h"
typedef struct HostMemoryBackendFile HostMemoryBackendFile;
-#define MEMORY_BACKEND_FILE(obj) \
- OBJECT_CHECK(HostMemoryBackendFile, (obj), TYPE_MEMORY_BACKEND_FILE)
+DECLARE_INSTANCE_CHECKER(HostMemoryBackendFile, MEMORY_BACKEND_FILE,
+ TYPE_MEMORY_BACKEND_FILE)
struct HostMemoryBackendFile {
diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c
index 45114bd641..8cf6bcbda2 100644
--- a/backends/hostmem-memfd.c
+++ b/backends/hostmem-memfd.c
@@ -22,8 +22,8 @@
#define TYPE_MEMORY_BACKEND_MEMFD "memory-backend-memfd"
typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd;
-#define MEMORY_BACKEND_MEMFD(obj) \
- OBJECT_CHECK(HostMemoryBackendMemfd, (obj), TYPE_MEMORY_BACKEND_MEMFD)
+DECLARE_INSTANCE_CHECKER(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD,
+ TYPE_MEMORY_BACKEND_MEMFD)
struct HostMemoryBackendMemfd {
diff --git a/backends/rng-builtin.c b/backends/rng-builtin.c
index 4bf073c963..459be97a5a 100644
--- a/backends/rng-builtin.c
+++ b/backends/rng-builtin.c
@@ -12,7 +12,8 @@
#include "qom/object.h"
typedef struct RngBuiltin RngBuiltin;
-#define RNG_BUILTIN(obj) OBJECT_CHECK(RngBuiltin, (obj), TYPE_RNG_BUILTIN)
+DECLARE_INSTANCE_CHECKER(RngBuiltin, RNG_BUILTIN,
+ TYPE_RNG_BUILTIN)
struct RngBuiltin {
RngBackend parent;
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index ee1854f31c..d905fe657c 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -20,7 +20,8 @@
#define TYPE_RNG_EGD "rng-egd"
typedef struct RngEgd RngEgd;
-#define RNG_EGD(obj) OBJECT_CHECK(RngEgd, (obj), TYPE_RNG_EGD)
+DECLARE_INSTANCE_CHECKER(RngEgd, RNG_EGD,
+ TYPE_RNG_EGD)
struct RngEgd {
RngBackend parent;
diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c
index 2509c8d327..13657d9aba 100644
--- a/backends/tpm/tpm_emulator.c
+++ b/backends/tpm/tpm_emulator.c
@@ -46,8 +46,8 @@
#define TYPE_TPM_EMULATOR "tpm-emulator"
typedef struct TPMEmulator TPMEmulator;
-#define TPM_EMULATOR(obj) \
- OBJECT_CHECK(TPMEmulator, (obj), TYPE_TPM_EMULATOR)
+DECLARE_INSTANCE_CHECKER(TPMEmulator, TPM_EMULATOR,
+ TYPE_TPM_EMULATOR)
#define TPM_EMULATOR_IMPLEMENTS_ALL_CAPS(S, cap) (((S)->caps & (cap)) == (cap))
diff --git a/backends/tpm/tpm_passthrough.c b/backends/tpm/tpm_passthrough.c
index b703f7e412..10722e0a41 100644
--- a/backends/tpm/tpm_passthrough.c
+++ b/backends/tpm/tpm_passthrough.c
@@ -37,8 +37,8 @@
#define TYPE_TPM_PASSTHROUGH "tpm-passthrough"
typedef struct TPMPassthruState TPMPassthruState;
-#define TPM_PASSTHROUGH(obj) \
- OBJECT_CHECK(TPMPassthruState, (obj), TYPE_TPM_PASSTHROUGH)
+DECLARE_INSTANCE_CHECKER(TPMPassthruState, TPM_PASSTHROUGH,
+ TYPE_TPM_PASSTHROUGH)
/* data structures */
struct TPMPassthruState {