]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: fix a warning and possible truncation
authorBlue Swirl <blauwirbel@gmail.com>
Mon, 14 Jun 2010 18:55:33 +0000 (18:55 +0000)
committerKevin Wolf <kwolf@redhat.com>
Tue, 15 Jun 2010 07:42:30 +0000 (09:42 +0200)
Fix a warning from OpenBSD gcc (3.3.5 (propolice)):
/src/qemu/block.c: In function `bdrv_info_stats_bs':
/src/qemu/block.c:1548: warning: long long int format, long unsigned
int arg (arg 6)

There may be also truncation effects.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c

diff --git a/block.c b/block.c
index 383d59fb0ae4ac54cc592842bd1b7a7e536a2ccf..3fc296921130faef71e4edcf105ddb168c400b6b 100644 (file)
--- a/block.c
+++ b/block.c
@@ -1574,7 +1574,8 @@ static QObject* bdrv_info_stats_bs(BlockDriverState *bs)
                              "} }",
                              bs->rd_bytes, bs->wr_bytes,
                              bs->rd_ops, bs->wr_ops,
-                             bs->wr_highest_sector * (long)BDRV_SECTOR_SIZE);
+                             bs->wr_highest_sector *
+                             (uint64_t)BDRV_SECTOR_SIZE);
     dict  = qobject_to_qdict(res);
 
     if (*bs->device_name) {