Re: [Qemu-devel] [PATCH 2/2] iscsi: add intelligent has_zero_init check

2013-06-21 Thread Peter Lieven
Von meinem iPhone gesendet Am 21.06.2013 um 22:00 schrieb Paolo Bonzini : > Il 20/06/2013 20:20, Peter Lieven ha scritto: >> +for (lba = 0; lba < iscsilun->num_blocks; lba += 1 << 26) { >> +nb_sectors = 1 << 26; >> +if (lba + nb_sectors > iscsilun->num_blocks) { >> +

Re: [Qemu-devel] [PATCH 2/2] iscsi: add intelligent has_zero_init check

2013-06-21 Thread Paolo Bonzini
Il 20/06/2013 20:20, Peter Lieven ha scritto: > +for (lba = 0; lba < iscsilun->num_blocks; lba += 1 << 26) { > +nb_sectors = 1 << 26; > +if (lba + nb_sectors > iscsilun->num_blocks) { > +nb_sectors = iscsilun->num_blocks - lba; > +} > +nb_sectors *= (

[Qemu-devel] [PATCH 2/2] iscsi: add intelligent has_zero_init check

2013-06-20 Thread Peter Lieven
iscsi targets are not created by bdrv_create and thus we cannot blindly assume that a target is empty. to avoid writing and allocating blocks of zeroes we now check if all blocks of an existing target are unallocated and return 1 for bdrv_has_zero_init if the target is completely unalloacted and un

[Qemu-devel] [PATCH 2/2] iscsi: add intelligent has_zero_init check

2013-06-20 Thread Peter Lieven
iscsi targets are not created by bdrv_create and thus we cannot blindly assume that a target is empty. to avoid writing and allocating blocks of zeroes we now check if all blocks of an existing target are unallocated and return 1 for bdrv_has_zero_init if the target is completely unalloacted and un