diff options
author | Eduardo Habkost | 2020-09-16 20:25:19 +0200 |
---|---|---|
committer | Eduardo Habkost | 2020-09-18 20:12:32 +0200 |
commit | 8063396bf3459a810d24e3efd6110b8480f0de5b (patch) | |
tree | 40f85f15d7016e3ee66916a59be53d2b2c71510a /backends | |
parent | Use OBJECT_DECLARE_TYPE when possible (diff) | |
download | qemu-8063396bf3459a810d24e3efd6110b8480f0de5b.tar.gz qemu-8063396bf3459a810d24e3efd6110b8480f0de5b.tar.xz qemu-8063396bf3459a810d24e3efd6110b8480f0de5b.zip |
Use OBJECT_DECLARE_SIMPLE_TYPE when possible
This converts existing DECLARE_INSTANCE_CHECKER usage to
OBJECT_DECLARE_SIMPLE_TYPE when possible.
$ ./scripts/codeconverter/converter.py -i \
--pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]')
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Paul Durrant <paul@xen.org>
Message-Id: <20200916182519.415636-6-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r-- | backends/cryptodev-builtin.c | 5 | ||||
-rw-r--r-- | backends/cryptodev-vhost-user.c | 4 | ||||
-rw-r--r-- | backends/hostmem-file.c | 4 | ||||
-rw-r--r-- | backends/hostmem-memfd.c | 4 | ||||
-rw-r--r-- | backends/rng-builtin.c | 4 | ||||
-rw-r--r-- | backends/rng-egd.c | 4 | ||||
-rw-r--r-- | backends/tpm/tpm_emulator.c | 4 | ||||
-rw-r--r-- | backends/tpm/tpm_passthrough.c | 4 |
8 files changed, 8 insertions, 25 deletions
diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index f047ad0362..c6edb1b28a 100644 --- a/backends/cryptodev-builtin.c +++ b/backends/cryptodev-builtin.c @@ -35,10 +35,7 @@ */ #define TYPE_CRYPTODEV_BACKEND_BUILTIN "cryptodev-backend-builtin" -typedef struct CryptoDevBackendBuiltin - CryptoDevBackendBuiltin; -DECLARE_INSTANCE_CHECKER(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUILTIN, - TYPE_CRYPTODEV_BACKEND_BUILTIN) +OBJECT_DECLARE_SIMPLE_TYPE(CryptoDevBackendBuiltin, CRYPTODEV_BACKEND_BUILTIN) typedef struct CryptoDevBackendBuiltinSession { diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c index 41089dede1..60ec4908aa 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -39,9 +39,7 @@ */ #define TYPE_CRYPTODEV_BACKEND_VHOST_USER "cryptodev-vhost-user" -typedef struct CryptoDevBackendVhostUser CryptoDevBackendVhostUser; -DECLARE_INSTANCE_CHECKER(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VHOST_USER, - TYPE_CRYPTODEV_BACKEND_VHOST_USER) +OBJECT_DECLARE_SIMPLE_TYPE(CryptoDevBackendVhostUser, CRYPTODEV_BACKEND_VHOST_USER) struct CryptoDevBackendVhostUser { diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index a3b2e8209e..40e1e5b3e3 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -19,9 +19,7 @@ #include "qom/object_interfaces.h" #include "qom/object.h" -typedef struct HostMemoryBackendFile HostMemoryBackendFile; -DECLARE_INSTANCE_CHECKER(HostMemoryBackendFile, MEMORY_BACKEND_FILE, - TYPE_MEMORY_BACKEND_FILE) +OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendFile, MEMORY_BACKEND_FILE) struct HostMemoryBackendFile { diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 8cf6bcbda2..e5626d4330 100644 --- a/backends/hostmem-memfd.c +++ b/backends/hostmem-memfd.c @@ -21,9 +21,7 @@ #define TYPE_MEMORY_BACKEND_MEMFD "memory-backend-memfd" -typedef struct HostMemoryBackendMemfd HostMemoryBackendMemfd; -DECLARE_INSTANCE_CHECKER(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD, - TYPE_MEMORY_BACKEND_MEMFD) +OBJECT_DECLARE_SIMPLE_TYPE(HostMemoryBackendMemfd, MEMORY_BACKEND_MEMFD) struct HostMemoryBackendMemfd { diff --git a/backends/rng-builtin.c b/backends/rng-builtin.c index 459be97a5a..f38dff117d 100644 --- a/backends/rng-builtin.c +++ b/backends/rng-builtin.c @@ -11,9 +11,7 @@ #include "qemu/guest-random.h" #include "qom/object.h" -typedef struct RngBuiltin RngBuiltin; -DECLARE_INSTANCE_CHECKER(RngBuiltin, RNG_BUILTIN, - TYPE_RNG_BUILTIN) +OBJECT_DECLARE_SIMPLE_TYPE(RngBuiltin, RNG_BUILTIN) struct RngBuiltin { RngBackend parent; diff --git a/backends/rng-egd.c b/backends/rng-egd.c index d905fe657c..20198ff26e 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -19,9 +19,7 @@ #include "qom/object.h" #define TYPE_RNG_EGD "rng-egd" -typedef struct RngEgd RngEgd; -DECLARE_INSTANCE_CHECKER(RngEgd, RNG_EGD, - TYPE_RNG_EGD) +OBJECT_DECLARE_SIMPLE_TYPE(RngEgd, RNG_EGD) struct RngEgd { RngBackend parent; diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c index 13657d9aba..201cd38503 100644 --- a/backends/tpm/tpm_emulator.c +++ b/backends/tpm/tpm_emulator.c @@ -45,9 +45,7 @@ #include "qom/object.h" #define TYPE_TPM_EMULATOR "tpm-emulator" -typedef struct TPMEmulator TPMEmulator; -DECLARE_INSTANCE_CHECKER(TPMEmulator, TPM_EMULATOR, - TYPE_TPM_EMULATOR) +OBJECT_DECLARE_SIMPLE_TYPE(TPMEmulator, 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 6d6294ef0a..8f6f4998a5 100644 --- a/backends/tpm/tpm_passthrough.c +++ b/backends/tpm/tpm_passthrough.c @@ -36,9 +36,7 @@ #include "qom/object.h" #define TYPE_TPM_PASSTHROUGH "tpm-passthrough" -typedef struct TPMPassthruState TPMPassthruState; -DECLARE_INSTANCE_CHECKER(TPMPassthruState, TPM_PASSTHROUGH, - TYPE_TPM_PASSTHROUGH) +OBJECT_DECLARE_SIMPLE_TYPE(TPMPassthruState, TPM_PASSTHROUGH) /* data structures */ struct TPMPassthruState { |