]> git.proxmox.com Git - qemu.git/blobdiff - qemu-img.c
Fix bdrv_get_geometry to return uint64_t, by Andre Przywara.
[qemu.git] / qemu-img.c
index f1a8aebf5e1ac783eba596e6052760dc997678e3..2dffe8e3a45ea1d65732e55f7f2ab4bc0dc3739b 100644 (file)
@@ -235,7 +235,7 @@ static int img_create(int argc, char **argv)
     const char *fmt = "raw";
     const char *filename;
     const char *base_filename = NULL;
-    int64_t size;
+    uint64_t size;
     const char *p;
     BlockDriver *drv;
 
@@ -300,7 +300,7 @@ static int img_create(int argc, char **argv)
         printf(", backing_file=%s",
                base_filename);
     }
-    printf(", size=%" PRId64 " kB\n", (int64_t) (size / 1024));
+    printf(", size=%" PRIu64 " kB\n", size / 1024);
     ret = bdrv_create(drv, filename, size / 512, base_filename, flags);
     if (ret < 0) {
         if (ret == -ENOTSUP) {
@@ -410,7 +410,8 @@ static int img_convert(int argc, char **argv)
     const char *fmt, *out_fmt, *out_filename;
     BlockDriver *drv;
     BlockDriverState **bs, *out_bs;
-    int64_t total_sectors, nb_sectors, sector_num, bs_offset, bs_sectors;
+    int64_t total_sectors, nb_sectors, sector_num, bs_offset;
+    uint64_t bs_sectors;
     uint8_t buf[IO_BUF_SIZE];
     const uint8_t *buf1;
     BlockDriverInfo bdi;
@@ -655,7 +656,8 @@ static int img_info(int argc, char **argv)
     BlockDriver *drv;
     BlockDriverState *bs;
     char fmt_name[128], size_buf[128], dsize_buf[128];
-    int64_t total_sectors, allocated_size;
+    uint64_t total_sectors;
+    int64_t allocated_size;
     char backing_filename[1024];
     char backing_filename2[1024];
     BlockDriverInfo bdi;