On Thu, 04/03 07:28, Jun Lee wrote: > > @@ -66,7 +63,18 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t > > min_size, > > > > new_l1_size2 = sizeof(uint64_t) * new_l1_size; > > new_l1_table = g_malloc0(align_offset(new_l1_size2, 512)); > > - memcpy(new_l1_table, s->l1_table, s->l1_size * sizeof(uint64_t)); > > + > > + /* shrinking the image */ > > + if (min_size <= s->l1_size) { > > + if (s->l1_table[new_l1_size] != 0) { > > Is this safe as advertised? Do we need to scan all the dropped l1 entries, > instead of only the first one? > -As the dropped l1 entries will not contain any value data.
I don't understand, how do you make sure of that without checking it? Fam