aboutsummaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-07-10 11:12:40 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-17 16:48:30 +0200
commit8a4bc5aafa7286e03bbced8abdb43aa6abdf95ea (patch)
tree3a5943e399917153be69debf5cd615824a1ee43b /block.h
parent317bb412293672ff930884d67235e970dad88566 (diff)
downloadqemu-8a4bc5aafa7286e03bbced8abdb43aa6abdf95ea.zip
qemu-8a4bc5aafa7286e03bbced8abdb43aa6abdf95ea.tar.gz
qemu-8a4bc5aafa7286e03bbced8abdb43aa6abdf95ea.tar.bz2
qdev: Introduce block geometry properties
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.h')
-rw-r--r--block.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/block.h b/block.h
index 993894e..1cd8a01 100644
--- a/block.h
+++ b/block.h
@@ -426,6 +426,8 @@ typedef struct BlockConf {
uint32_t opt_io_size;
int32_t bootindex;
uint32_t discard_granularity;
+ /* geometry, not all devices use this */
+ uint32_t cyls, heads, secs;
} BlockConf;
static inline unsigned int get_physical_block_exp(BlockConf *conf)
@@ -453,5 +455,9 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf)
DEFINE_PROP_UINT32("discard_granularity", _state, \
_conf.discard_granularity, 0)
-#endif
+#define DEFINE_BLOCK_CHS_PROPERTIES(_state, _conf) \
+ DEFINE_PROP_UINT32("cyls", _state, _conf.cyls, 0), \
+ DEFINE_PROP_UINT32("heads", _state, _conf.heads, 0), \
+ DEFINE_PROP_UINT32("secs", _state, _conf.secs, 0)
+#endif