diff options
Diffstat (limited to 'hw/scsi-generic.c')
-rw-r--r-- | hw/scsi-generic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index 4d7ad828f1..fcf23cd8cd 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -174,9 +174,11 @@ static void scsi_read_complete(void * opaque, int ret) /* Snoop READ CAPACITY output to set the blocksize. */ if (r->req.cmd.buf[0] == READ_CAPACITY_10) { s->blocksize = ldl_be_p(&r->buf[4]); + s->max_lba = ldl_be_p(&r->buf[0]); } else if (r->req.cmd.buf[0] == SERVICE_ACTION_IN_16 && (r->req.cmd.buf[1] & 31) == SAI_READ_CAPACITY_16) { s->blocksize = ldl_be_p(&r->buf[8]); + s->max_lba = ldq_be_p(&r->buf[0]); } bdrv_set_buffer_alignment(s->conf.bs, s->blocksize); |