From: Jack Lange Date: Wed, 14 Sep 2011 18:32:57 +0000 (-0400) Subject: atapi bug fix X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=47f2237e5c6a71a63f04bc3dc0215fbbe2f40490 atapi bug fix --- diff --git a/palacios/src/devices/atapi.h b/palacios/src/devices/atapi.h index 4962119..b41e9df 100644 --- a/palacios/src/devices/atapi.h +++ b/palacios/src/devices/atapi.h @@ -247,7 +247,7 @@ static int atapi_get_capacity(struct ide_internal * ide, struct ide_channel * ch struct atapi_rd_capacity_resp * resp = (struct atapi_rd_capacity_resp *)(drive->data_buf); uint32_t capacity = drive->ops->get_capacity(drive->private_data); - resp->lba = le_to_be_32(capacity / ATAPI_BLOCK_SIZE); + resp->lba = le_to_be_32((capacity / ATAPI_BLOCK_SIZE) - 1); resp->block_len = le_to_be_32(ATAPI_BLOCK_SIZE); atapi_setup_cmd_resp(ide, channel, sizeof(struct atapi_rd_capacity_resp));