include/crypto: Include qapi-types.h or qemu/bswap.h instead of qemu-common.h
authorMarkus Armbruster <armbru@redhat.com>
Fri, 11 Mar 2016 08:20:17 +0000 (09:20 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Mar 2016 21:20:16 +0000 (22:20 +0100)
qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

Several include/crypto/ headers include qemu-common.h, but either need
just qapi-types.h from it, or qemu/bswap.h, or nothing at all.  Replace or
drop the include accordingly.  tests/test-crypto-secret.c now misses
qemu/module.h, so include it there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
crypto/ivgen-essiv.c
crypto/ivgen-plain.c
crypto/ivgen-plain64.c
include/crypto/cipher.h
include/crypto/hash.h
include/crypto/init.h
include/crypto/secret.h
include/crypto/tlscreds.h
tests/test-crypto-secret.c

index 2fd89def0fd165049ebd32cb3056763fe55e1ec3..634de63338e5a45345f1072fde8819d37f27d6b5 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/bswap.h"
 #include "crypto/ivgen-essiv.h"
 
 typedef struct QCryptoIVGenESSIV QCryptoIVGenESSIV;
index a56675d5924b2acf59f115f393100cbffd783730..9b9b4ad0bf89d183f5814e2b2613f1737922b5eb 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/bswap.h"
 #include "crypto/ivgen-plain.h"
 
 static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen,
index 94d86730fbeb5bf3c1131c28d450a5cb3f3ae3fe..6c6b1b44c36e16e60ab022fb3d5c3fd4270d74e3 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/bswap.h"
 #include "crypto/ivgen-plain.h"
 
 static int qcrypto_ivgen_plain_init(QCryptoIVGen *ivgen,
index c04c3ac9b9b50a19d0e8a793f9915790bf6cf29c..d770c4835a3447ff48c6eb4d384067cd83d89415 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_CIPHER_H__
 #define QCRYPTO_CIPHER_H__
 
-#include "qemu-common.h"
+#include "qapi-types.h"
 
 typedef struct QCryptoCipher QCryptoCipher;
 
index aebccd138663da99aa7972680820da1eb85998fd..f38caed6691231419ccff66949780f15ed48724f 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_HASH_H__
 #define QCRYPTO_HASH_H__
 
-#include "qemu-common.h"
+#include "qapi-types.h"
 
 /* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
 
index 4836a37e3f9fa43f2221e9e7e5ffc066b1f3fdaf..2513ed09867dc6aefe89d9eb3a255fcbbf4164ed 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef QCRYPTO_INIT_H__
 #define QCRYPTO_INIT_H__
 
-#include "qemu-common.h"
-
 int qcrypto_init(Error **errp);
 
 #endif /* QCRYPTO_INIT_H__ */
index 60f2a502b78556a9890e6a161fa08d3bc1d16f8c..b7392c6ba0b3a3490a60ccbb8a71a9c8a0337e1b 100644 (file)
@@ -21,7 +21,6 @@
 #ifndef QCRYPTO_SECRET_H__
 #define QCRYPTO_SECRET_H__
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #define TYPE_QCRYPTO_SECRET "secret"
index 4bf1d2e255ae954e980a09e2490f13a0db3d74f4..8e2babd5333d5f45fba18abd02f38c6be02d27f2 100644 (file)
@@ -21,7 +21,6 @@
 #ifndef QCRYPTO_TLSCRED_H__
 #define QCRYPTO_TLSCRED_H__
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #ifdef CONFIG_GNUTLS
index 43e295240cf73886389dd32a2c9d2f209f123c32..aa26c20499ea06c3f1057df8ffd3b02c0af4a1ea 100644 (file)
@@ -24,6 +24,7 @@
 #include "crypto/init.h"
 #include "crypto/secret.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 
 static void test_secret_direct(void)
 {