aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qemu-img.c6
-rw-r--r--qemu-io.c6
-rw-r--r--qemu-nbd.c7
3 files changed, 19 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 17c5cfdffe..1697762606 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -37,6 +37,7 @@
#include "block/block_int.h"
#include "block/blockjob.h"
#include "block/qapi.h"
+#include "crypto/init.h"
#include <getopt.h>
#define QEMU_IMG_VERSION "qemu-img version " QEMU_VERSION QEMU_PKGVERSION \
@@ -3486,6 +3487,11 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
+ if (qcrypto_init(&local_error) < 0) {
+ error_reportf_err(local_error, "cannot initialize crypto: ");
+ exit(1);
+ }
+
module_call_init(MODULE_INIT_QOM);
bdrv_init();
if (argc < 2) {
diff --git a/qemu-io.c b/qemu-io.c
index 0a738f12f0..288bba84b9 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -23,6 +23,7 @@
#include "sysemu/block-backend.h"
#include "block/block_int.h"
#include "trace/control.h"
+#include "crypto/init.h"
#define CMD_NOFILE_OK 0x01
@@ -443,6 +444,11 @@ int main(int argc, char **argv)
progname = basename(argv[0]);
qemu_init_exec_dir(argv[0]);
+ if (qcrypto_init(&local_error) < 0) {
+ error_reportf_err(local_error, "cannot initialize crypto: ");
+ exit(1);
+ }
+
module_call_init(MODULE_INIT_QOM);
qemu_add_opts(&qemu_object_opts);
bdrv_init();
diff --git a/qemu-nbd.c b/qemu-nbd.c
index c2e4d3f64c..b5751f853b 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -31,6 +31,7 @@
#include "qapi/qmp/qstring.h"
#include "qom/object_interfaces.h"
#include "io/channel-socket.h"
+#include "crypto/init.h"
#include <getopt.h>
#include <libgen.h>
@@ -519,6 +520,12 @@ int main(int argc, char **argv)
memset(&sa_sigterm, 0, sizeof(sa_sigterm));
sa_sigterm.sa_handler = termsig_handler;
sigaction(SIGTERM, &sa_sigterm, NULL);
+
+ if (qcrypto_init(&local_err) < 0) {
+ error_reportf_err(local_err, "cannot initialize crypto: ");
+ exit(1);
+ }
+
module_call_init(MODULE_INIT_QOM);
qemu_add_opts(&qemu_object_opts);
qemu_init_exec_dir(argv[0]);