diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-08-17 12:36:20 +1000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-08-28 14:50:08 +0200 |
commit | 135b9088780d7d8e5eae027b4fba6b33562f7006 (patch) | |
tree | 4059c8c4d7ce60614056e5c6a51fa4d8459464c9 /block/raw-win32.c | |
parent | 0f1da449ec65403bc5c028eb9618d0ee598a3615 (diff) |
iscsi: Set number of blocks to 0 for blank CDROM devices
The number of blocks of the device is used to compute the device size
in bdrv_getlength()/iscsi_getlength().
For MMC devices, the ReturnedLogicalBlockAddress in the READCAPACITY10
has a special meaning when it is 0.
In this case it does not mean that LBA 0 is the last accessible LBA,
and thus the device has 1 readable block, but instead it means that the
disc is blank and there are no readable blocks.
This change ensures that when the iSCSI LUN is loaded with a blank
DVD-R disk or similar that bdrv_getlength() will return the correct
size of the device as 0 bytes.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Diffstat (limited to 'block/raw-win32.c')
0 files changed, 0 insertions, 0 deletions