Re: [Qemu-devel] [PATCH] ISCSI: Readcapacity retruned the lba of the last sector. Total number of sectors is one more.

2012-05-04 Thread Paolo Bonzini
Il 04/05/2012 10:15, Ronnie Sahlberg ha scritto:
>  itask->iscsilun->num_blocks = rc16->returned_lba;
> -itask->bs->total_sectors= rc16->returned_lba *
> +itask->bs->total_sectors= (rc16->returned_lba + 1) *

What about itask->iscsilun->num_blocks? :)  No need to resend, I fixed
this locally.



[Qemu-devel] [PATCH] ISCSI: Readcapacity retruned the lba of the last sector. Total number of sectors is one more.

2012-05-04 Thread Ronnie Sahlberg
Thanks to Paolo for spotting.

Signed-off-by: Ronnie Sahlberg 
---
 block/iscsi.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index eb49093..7c1970d 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -482,7 +482,7 @@ iscsi_readcapacity16_cb(struct iscsi_context *iscsi, int 
status,
 
 itask->iscsilun->block_size = rc16->block_length;
 itask->iscsilun->num_blocks = rc16->returned_lba;
-itask->bs->total_sectors= rc16->returned_lba *
+itask->bs->total_sectors= (rc16->returned_lba + 1) *
rc16->block_length / BDRV_SECTOR_SIZE ;
 
 itask->status   = 0;
-- 
1.7.3.1