aboutsummaryrefslogtreecommitdiff
path: root/tests/test-blockjob.c
diff options
context:
space:
mode:
authorAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>2019-07-29 15:46:00 +0300
committerThomas Huth <thuth@redhat.com>2019-08-15 19:23:59 +0200
commitca1ef1e62e581f61c40f8be49d222007739691c4 (patch)
treea44dd28fac7c1cbdd918227bac161b408983dd74 /tests/test-blockjob.c
parent375eae1c716bd55936d65ad545ae2ea0c9909b91 (diff)
downloadqemu-ca1ef1e62e581f61c40f8be49d222007739691c4.zip
qemu-ca1ef1e62e581f61c40f8be49d222007739691c4.tar.gz
qemu-ca1ef1e62e581f61c40f8be49d222007739691c4.tar.bz2
tests: Set read-zeroes on for null-co driver
This patch is to reduce the number of Valgrind report messages about using uninitialized memory with the null-co driver. It helps to filter real memory issues and is the same work done for the iotests with the commit ID a6862418fec4072. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Message-Id: <1564404360-733987-1-git-send-email-andrey.shinkevich@virtuozzo.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/test-blockjob.c')
-rw-r--r--tests/test-blockjob.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c
index b33f899..68a0819 100644
--- a/tests/test-blockjob.c
+++ b/tests/test-blockjob.c
@@ -15,6 +15,7 @@
#include "qemu/main-loop.h"
#include "block/blockjob_int.h"
#include "sysemu/block-backend.h"
+#include "qapi/qmp/qdict.h"
static const BlockJobDriver test_block_job_driver = {
.job_driver = {
@@ -71,7 +72,9 @@ static BlockBackend *create_blk(const char *name)
BlockBackend *blk = blk_new(qemu_get_aio_context(), 0, BLK_PERM_ALL);
BlockDriverState *bs;
- bs = bdrv_open("null-co://", NULL, NULL, 0, &error_abort);
+ QDict *opt = qdict_new();
+ qdict_put_str(opt, "file.read-zeroes", "on");
+ bs = bdrv_open("null-co://", NULL, opt, 0, &error_abort);
g_assert_nonnull(bs);
blk_insert_bs(blk, bs, &error_abort);