Loading block/qcow2-refcount.c +15 −7 Original line number Diff line number Diff line Loading @@ -513,7 +513,11 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, l1_size2 = l1_size * sizeof(uint64_t); l1_allocated = 0; if (l1_table_offset != s->l1_table_offset) { if (l1_size2 != 0) { l1_table = qemu_mallocz(align_offset(l1_size2, 512)); } else { l1_table = NULL; } l1_allocated = 1; if (bdrv_pread(s->hd, l1_table_offset, l1_table, l1_size2) != l1_size2) Loading Loading @@ -769,12 +773,16 @@ static int check_refcounts_l1(BlockDriverState *bs, l1_table_offset, l1_size2); /* Read L1 table entries from disk */ if (l1_size2 == 0) { l1_table = NULL; } else { l1_table = qemu_malloc(l1_size2); if (bdrv_pread(s->hd, l1_table_offset, l1_table, l1_size2) != l1_size2) goto fail; for(i = 0;i < l1_size; i++) be64_to_cpus(&l1_table[i]); } /* Do the actual checks */ for(i = 0; i < l1_size; i++) { Loading block/qcow2-snapshot.c +6 −1 Original line number Diff line number Diff line Loading @@ -266,7 +266,12 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) sn->l1_table_offset = qcow2_alloc_clusters(bs, s->l1_size * sizeof(uint64_t)); sn->l1_size = s->l1_size; if (s->l1_size != 0) { l1_table = qemu_malloc(s->l1_size * sizeof(uint64_t)); } else { l1_table = NULL; } for(i = 0; i < s->l1_size; i++) { l1_table[i] = cpu_to_be64(s->l1_table[i]); } Loading Loading
block/qcow2-refcount.c +15 −7 Original line number Diff line number Diff line Loading @@ -513,7 +513,11 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, l1_size2 = l1_size * sizeof(uint64_t); l1_allocated = 0; if (l1_table_offset != s->l1_table_offset) { if (l1_size2 != 0) { l1_table = qemu_mallocz(align_offset(l1_size2, 512)); } else { l1_table = NULL; } l1_allocated = 1; if (bdrv_pread(s->hd, l1_table_offset, l1_table, l1_size2) != l1_size2) Loading Loading @@ -769,12 +773,16 @@ static int check_refcounts_l1(BlockDriverState *bs, l1_table_offset, l1_size2); /* Read L1 table entries from disk */ if (l1_size2 == 0) { l1_table = NULL; } else { l1_table = qemu_malloc(l1_size2); if (bdrv_pread(s->hd, l1_table_offset, l1_table, l1_size2) != l1_size2) goto fail; for(i = 0;i < l1_size; i++) be64_to_cpus(&l1_table[i]); } /* Do the actual checks */ for(i = 0; i < l1_size; i++) { Loading
block/qcow2-snapshot.c +6 −1 Original line number Diff line number Diff line Loading @@ -266,7 +266,12 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) sn->l1_table_offset = qcow2_alloc_clusters(bs, s->l1_size * sizeof(uint64_t)); sn->l1_size = s->l1_size; if (s->l1_size != 0) { l1_table = qemu_malloc(s->l1_size * sizeof(uint64_t)); } else { l1_table = NULL; } for(i = 0; i < s->l1_size; i++) { l1_table[i] = cpu_to_be64(s->l1_table[i]); } Loading