summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-08-19 15:07:31 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-08-22 13:37:35 +0200
commitad5bc00194a981af3435835b5ceb5d624a98caf7 (patch)
treef6da14396a5c93a15aa579d145c96525d2907b43
parent3febc4d4de97f330e9cabc5484c6815883967e0c (diff)
downloadqemu-ad5bc00194a981af3435835b5ceb5d624a98caf7.tar.gz
block: deprecate total_sectors, add total_bytes
This prepares for removal of 512-byte sector units. Since a length unit cannot be negative, let's use an unsigned integer for the new total_bytes unit. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--include/block/block_int.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 233489547e..07f3d4426c 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -301,8 +301,11 @@ typedef struct BdrvOpBlocker BdrvOpBlocker;
* copied as well.
*/
struct BlockDriverState {
+ /* TODO: replace by total_bytes */
+ __attribute__ ((deprecated))
int64_t total_sectors; /* if we are reading a disk image, give its
size in sectors */
+ uint64_t total_bytes; /* file size in bytes for reading from disk images */
int read_only; /* if true, the media is read only */
int open_flags; /* flags used to open the file, re-used for re-open */
int encrypted; /* if true, the media is encrypted */