diff mbox

[17/32] qdev: Introduce block geometry properties

Message ID 1341557890-17464-18-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster July 6, 2012, 6:57 a.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 block.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/block.h b/block.h
index 052d0ce..e0121d5 100644
--- a/block.h
+++ b/block.h
@@ -427,6 +427,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)
@@ -454,5 +456,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