cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
958e1b
From b343626ad339c1bb1cd1867a9f9ade2067c6d345 Mon Sep 17 00:00:00 2001
958e1b
Message-Id: <b343626ad339c1bb1cd1867a9f9ade2067c6d345.1418766606.git.jen@redhat.com>
958e1b
In-Reply-To: <6f81b4847eb68ebdf54a8f1a771e19d112d74152.1418766606.git.jen@redhat.com>
958e1b
References: <6f81b4847eb68ebdf54a8f1a771e19d112d74152.1418766606.git.jen@redhat.com>
958e1b
From: Fam Zheng <famz@redhat.com>
958e1b
Date: Thu, 4 Dec 2014 00:05:10 -0600
958e1b
Subject: [CHANGE 16/31] vmdk: Fix %d and %lld to PRI* in format strings
958e1b
To: rhvirt-patches@redhat.com,
958e1b
    jen@redhat.com
958e1b
958e1b
RH-Author: Fam Zheng <famz@redhat.com>
958e1b
Message-id: <1417651524-18041-17-git-send-email-famz@redhat.com>
958e1b
Patchwork-id: 62689
958e1b
O-Subject: [RHEL-7.1 qemu-kvm PATCH v5 16/30] vmdk: Fix %d and %lld to PRI* in format strings
958e1b
Bugzilla: 1134251
958e1b
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
958e1b
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
958e1b
RH-Acked-by: Max Reitz <mreitz@redhat.com>
958e1b
958e1b
Signed-off-by: Fam Zheng <famz@redhat.com>
958e1b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
958e1b
(cherry picked from commit 4ab9dab5b9be0381e714d3fbe518689a72459011)
958e1b
Signed-off-by: Fam Zheng <famz@redhat.com>
958e1b
Signed-off-by: Jeff E. Nelson <jen@redhat.com>
958e1b
---
958e1b
 block/vmdk.c | 13 +++++++------
958e1b
 1 file changed, 7 insertions(+), 6 deletions(-)
958e1b
958e1b
diff --git a/block/vmdk.c b/block/vmdk.c
958e1b
index e78a184..0a01a2b 100644
958e1b
--- a/block/vmdk.c
958e1b
+++ b/block/vmdk.c
958e1b
@@ -640,7 +640,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
958e1b
 
958e1b
     if (le32_to_cpu(header.version) > 3) {
958e1b
         char buf[64];
958e1b
-        snprintf(buf, sizeof(buf), "VMDK version %d",
958e1b
+        snprintf(buf, sizeof(buf), "VMDK version %" PRId32,
958e1b
                  le32_to_cpu(header.version));
958e1b
         error_set(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
958e1b
                   bs->device_name, "vmdk", buf);
958e1b
@@ -671,8 +671,9 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
958e1b
     }
958e1b
     if (bdrv_getlength(file) <
958e1b
             le64_to_cpu(header.grain_offset) * BDRV_SECTOR_SIZE) {
958e1b
-        error_setg(errp, "File truncated, expecting at least %lld bytes",
958e1b
-                   le64_to_cpu(header.grain_offset) * BDRV_SECTOR_SIZE);
958e1b
+        error_setg(errp, "File truncated, expecting at least %" PRId64 " bytes",
958e1b
+                   (int64_t)(le64_to_cpu(header.grain_offset)
958e1b
+                             * BDRV_SECTOR_SIZE));
958e1b
         return -EINVAL;
958e1b
     }
958e1b
 
958e1b
@@ -1717,7 +1718,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options,
958e1b
         "\n"
958e1b
         "ddb.virtualHWVersion = \"%d\"\n"
958e1b
         "ddb.geometry.cylinders = \"%" PRId64 "\"\n"
958e1b
-        "ddb.geometry.heads = \"%d\"\n"
958e1b
+        "ddb.geometry.heads = \"%" PRIu32 "\"\n"
958e1b
         "ddb.geometry.sectors = \"63\"\n"
958e1b
         "ddb.adapterType = \"%s\"\n";
958e1b
 
958e1b
@@ -1777,9 +1778,9 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options,
958e1b
              strcmp(fmt, "twoGbMaxExtentFlat"));
958e1b
     compress = !strcmp(fmt, "streamOptimized");
958e1b
     if (flat) {
958e1b
-        desc_extent_line = "RW %lld FLAT \"%s\" 0\n";
958e1b
+        desc_extent_line = "RW %" PRId64 " FLAT \"%s\" 0\n";
958e1b
     } else {
958e1b
-        desc_extent_line = "RW %lld SPARSE \"%s\"\n";
958e1b
+        desc_extent_line = "RW %" PRId64 " SPARSE \"%s\"\n";
958e1b
     }
958e1b
     if (flat && backing_file) {
958e1b
         error_setg(errp, "Flat image can't have backing file");
958e1b
-- 
958e1b
2.1.0
958e1b