aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-09-01 15:00:42 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-06 11:23:51 +0200
commit8e217d5384a38bdb4727c4e22d7ed64c351361f7 (patch)
treea8a84a8b6be5afe68b0a62c41012031b2f48ac78
parentc30e624d5d04efdb581c841f9bf8b06302b96575 (diff)
qcow2: Properly initialise QcowL2Meta
Dependency list pointers filled with random garbage from the stack aren't a good idea. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/qcow2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index b725d68b1d..f26f7b66dc 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -526,13 +526,14 @@ static int qcow2_co_writev(BlockDriverState *bs,
int n_end;
int ret;
int cur_nr_sectors; /* number of sectors in current iteration */
- QCowL2Meta l2meta;
uint64_t cluster_offset;
QEMUIOVector hd_qiov;
uint64_t bytes_done = 0;
uint8_t *cluster_data = NULL;
+ QCowL2Meta l2meta = {
+ .nb_clusters = 0,
+ };
- l2meta.nb_clusters = 0;
qemu_co_queue_init(&l2meta.dependent_requests);
qemu_iovec_init(&hd_qiov, qiov->niov);