Skip to contentSkip to conversation

migration/ram: fix build on 32 bit hosts

PATCH In review Michael S. Tsirkin 2 participants 2 messages Nov 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration/ram: fix build on 32 bit hosts

ram_addr_t must be printed with RAM_ADDR_FMT not %z. Also, change size print to %zx to match what RAM_ADDR_FMT does.

---
 migration/ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
migration/ram.c +2 -2
index 62cf42b..80a67bb 100644
@@ -1184,7 +1184,7 @@ int ram_save_queue_pages(MigrationState *ms, const char *rbname,
     }
     trace_ram_save_queue_pages(ramblock->idstr, start, len);
     if (start+len > ramblock->used_length) {
-        error_report("%s request overrun start=%zx len=%zx blocklen=%zx",
+        error_report("%s request overrun start=0x" RAM_ADDR_FMT " len=0x" RAM_ADDR_FMT " blocklen=0x" RAM_ADDR_FMT,
                      __func__, start, len, ramblock->used_length);
         goto err;
     }
@@ -1845,7 +1845,7 @@ int ram_discard_range(MigrationIncomingState *mis,
         ret = postcopy_ram_discard_range(mis, host_startaddr, length);
     } else {
         error_report("ram_discard_range: Overrun block '%s' (%" PRIu64
-                     "/%zu/%zu)",
+                     "/%zx/0x" RAM_ADDR_FMT ")",
                      block_name, start, length, rb->used_length);
     }
 
Signature · 1 line
MST
#1 lore raw
Quoted 4 lines · Michael S. Tsirkin

ram_addr_t must be printed with RAM_ADDR_FMT not %z. Also, change size print to %zx to match what RAM_ADDR_FMT does.

Equivalent patch on queue and will be send with another couple of fixes later Today. Thanks.

Quoted 25 lines
---
 migration/ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
migration/ram.c +2 -2
index 62cf42b..80a67bb 100644
@@ -1184,7 +1184,7 @@ int ram_save_queue_pages(MigrationState *ms, const char *rbname,
     }
     trace_ram_save_queue_pages(ramblock->idstr, start, len);
     if (start+len > ramblock->used_length) {
-        error_report("%s request overrun start=%zx len=%zx blocklen=%zx",
+        error_report("%s request overrun start=0x" RAM_ADDR_FMT " len=0x" RAM_ADDR_FMT " blocklen=0x" RAM_ADDR_FMT,
                      __func__, start, len, ramblock->used_length);
         goto err;
     }
@@ -1845,7 +1845,7 @@ int ram_discard_range(MigrationIncomingState *mis,
         ret = postcopy_ram_discard_range(mis, host_startaddr, length);
     } else {
         error_report("ram_discard_range: Overrun block '%s' (%" PRIu64
-                     "/%zu/%zu)",
+                     "/%zx/0x" RAM_ADDR_FMT ")",
                      block_name, start, length, rb->used_length);
     }