thebeanogamer / rpms / qemu-kvm

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