Correct .dmg support
PATCH 1/1 Correct .dmg support
Hi,
looks like the dmg driver doesnt sets the total_sectors variable, thus I cannot convert the images.
Fixed.
Signature · 2 lines
Alex Beregszaszi e-mail: [email protected] Free Software Network cell: +36 70 3144424
Index: block-dmg.c
===================================================================
RCS file: /cvsroot/qemu/qemu/block-dmg.c,v
retrieving revision 1.2
block-dmg.c +3 -0
@@ -106,6 +106,8 @@if (lseek (s->fd,0xf8 ,SEEK_CUR )<0 ) goto dmg_close; + bs->total_sectors =0 ; +/* read offsets */ last_in_offset = last_out_offset =0 ;while (lseek (s->fd,0 ,SEEK_CUR )<info_end) {
@@ -151,6 +153,7 @@ max_compressed_size = s->lengths[i];if (s->sectorcounts[i]>max_sectors_per_chunk) max_sectors_per_chunk = s->sectorcounts[i]; + bs->total_sectors += s->sectorcounts[i]; } s->n_chunks+=chunk_count; }