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 a6862418fe.

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>
This commit is contained in:
Andrey Shinkevich 2019-07-29 15:46:00 +03:00 committed by Thomas Huth
parent 375eae1c71
commit ca1ef1e62e
12 changed files with 35 additions and 16 deletions

View file

@ -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);