aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-07-10 11:12:41 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-17 16:48:30 +0200
commit1f24d7b47e1f18b5e7f0f050f915a42e9aa645db (patch)
tree31468afd9a369f7e0f6d6ef9e5b33fcd8a9f68bc /hw
parent8a4bc5aafa7286e03bbced8abdb43aa6abdf95ea (diff)
hd-geometry: Switch to uint32_t to match BlockConf
Best to use the same type, to avoid unwanted truncation or sign extension. BlockConf can't use plain int for cyls, heads and secs, because integer properties require an exact width. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block-common.h2
-rw-r--r--hw/hd-geometry.c4
-rw-r--r--hw/ide/core.c2
-rw-r--r--hw/scsi-disk.c2
-rw-r--r--hw/virtio-blk.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/hw/block-common.h b/hw/block-common.h
index bba817a5ba..2f651867d2 100644
--- a/hw/block-common.h
+++ b/hw/block-common.h
@@ -16,7 +16,7 @@
/* Hard disk geometry */
void hd_geometry_guess(BlockDriverState *bs,
- int *pcyls, int *pheads, int *psecs,
+ uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs,
int *ptrans);
#endif
diff --git a/hw/hd-geometry.c b/hw/hd-geometry.c
index 4d746b7155..7626cbbe9c 100644
--- a/hw/hd-geometry.c
+++ b/hw/hd-geometry.c
@@ -98,7 +98,7 @@ static int guess_disk_lchs(BlockDriverState *bs,
}
static void guess_chs_for_size(BlockDriverState *bs,
- int *pcyls, int *pheads, int *psecs)
+ uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs)
{
uint64_t nb_sectors;
int cylinders;
@@ -117,7 +117,7 @@ static void guess_chs_for_size(BlockDriverState *bs,
}
void hd_geometry_guess(BlockDriverState *bs,
- int *pcyls, int *pheads, int *psecs,
+ uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs,
int *ptrans)
{
int cylinders, heads, secs, translation;
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 7f5ad0788b..f1966e37f1 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1927,7 +1927,7 @@ int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind,
const char *version, const char *serial, const char *model,
uint64_t wwn)
{
- int cylinders, heads, secs;
+ uint32_t cylinders, heads, secs;
uint64_t nb_sectors;
s->bs = bs;
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index fc077f5951..c881acf011 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -968,7 +968,7 @@ static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf,
};
BlockDriverState *bdrv = s->qdev.conf.bs;
- int cylinders, heads, secs;
+ uint32_t cylinders, heads, secs;
uint8_t *p = *p_outbuf;
if ((mode_sense_valid[page] & (1 << s->qdev.type)) == 0) {
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index d2709a741e..4344e28380 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -590,7 +590,7 @@ static const BlockDevOps virtio_block_ops = {
VirtIODevice *virtio_blk_init(DeviceState *dev, VirtIOBlkConf *blk)
{
VirtIOBlock *s;
- int cylinders, heads, secs;
+ uint32_t cylinders, heads, secs;
static int virtio_blk_id;
DriveInfo *dinfo;