Revision | 04e114049406dbb69fc9043c795ddd28fdba31a6 (tree) |
---|---|
Time | 2022-01-28 23:38:22 |
Author | Juan Quintela <quintela@redh...> |
Commiter | Juan Quintela |
migration: All this fields are unsigned
So printing it as %d is wrong. Notice that for the channel id, that
is an uint8_t, but I changed it anyways for consistency.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
@@ -51,7 +51,7 @@ static int zlib_send_setup(MultiFDSendParams *p, Error **errp) | ||
51 | 51 | zs->opaque = Z_NULL; |
52 | 52 | if (deflateInit(zs, migrate_multifd_zlib_level()) != Z_OK) { |
53 | 53 | g_free(z); |
54 | - error_setg(errp, "multifd %d: deflate init failed", p->id); | |
54 | + error_setg(errp, "multifd %u: deflate init failed", p->id); | |
55 | 55 | return -1; |
56 | 56 | } |
57 | 57 | /* To be safe, we reserve twice the size of the packet */ |
@@ -60,7 +60,7 @@ static int zlib_send_setup(MultiFDSendParams *p, Error **errp) | ||
60 | 60 | if (!z->zbuff) { |
61 | 61 | deflateEnd(&z->zs); |
62 | 62 | g_free(z); |
63 | - error_setg(errp, "multifd %d: out of memory for zbuff", p->id); | |
63 | + error_setg(errp, "multifd %u: out of memory for zbuff", p->id); | |
64 | 64 | return -1; |
65 | 65 | } |
66 | 66 | p->data = z; |
@@ -132,12 +132,12 @@ static int zlib_send_prepare(MultiFDSendParams *p, Error **errp) | ||
132 | 132 | ret = deflate(zs, flush); |
133 | 133 | } while (ret == Z_OK && zs->avail_in && zs->avail_out); |
134 | 134 | if (ret == Z_OK && zs->avail_in) { |
135 | - error_setg(errp, "multifd %d: deflate failed to compress all input", | |
135 | + error_setg(errp, "multifd %u: deflate failed to compress all input", | |
136 | 136 | p->id); |
137 | 137 | return -1; |
138 | 138 | } |
139 | 139 | if (ret != Z_OK) { |
140 | - error_setg(errp, "multifd %d: deflate returned %d instead of Z_OK", | |
140 | + error_setg(errp, "multifd %u: deflate returned %d instead of Z_OK", | |
141 | 141 | p->id, ret); |
142 | 142 | return -1; |
143 | 143 | } |
@@ -190,7 +190,7 @@ static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp) | ||
190 | 190 | zs->avail_in = 0; |
191 | 191 | zs->next_in = Z_NULL; |
192 | 192 | if (inflateInit(zs) != Z_OK) { |
193 | - error_setg(errp, "multifd %d: inflate init failed", p->id); | |
193 | + error_setg(errp, "multifd %u: inflate init failed", p->id); | |
194 | 194 | return -1; |
195 | 195 | } |
196 | 196 | /* To be safe, we reserve twice the size of the packet */ |
@@ -198,7 +198,7 @@ static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp) | ||
198 | 198 | z->zbuff = g_try_malloc(z->zbuff_len); |
199 | 199 | if (!z->zbuff) { |
200 | 200 | inflateEnd(zs); |
201 | - error_setg(errp, "multifd %d: out of memory for zbuff", p->id); | |
201 | + error_setg(errp, "multifd %u: out of memory for zbuff", p->id); | |
202 | 202 | return -1; |
203 | 203 | } |
204 | 204 | return 0; |
@@ -247,7 +247,7 @@ static int zlib_recv_pages(MultiFDRecvParams *p, Error **errp) | ||
247 | 247 | int i; |
248 | 248 | |
249 | 249 | if (flags != MULTIFD_FLAG_ZLIB) { |
250 | - error_setg(errp, "multifd %d: flags received %x flags expected %x", | |
250 | + error_setg(errp, "multifd %u: flags received %x flags expected %x", | |
251 | 251 | p->id, flags, MULTIFD_FLAG_ZLIB); |
252 | 252 | return -1; |
253 | 253 | } |
@@ -284,19 +284,19 @@ static int zlib_recv_pages(MultiFDRecvParams *p, Error **errp) | ||
284 | 284 | } while (ret == Z_OK && zs->avail_in |
285 | 285 | && (zs->total_out - start) < page_size); |
286 | 286 | if (ret == Z_OK && (zs->total_out - start) < page_size) { |
287 | - error_setg(errp, "multifd %d: inflate generated too few output", | |
287 | + error_setg(errp, "multifd %u: inflate generated too few output", | |
288 | 288 | p->id); |
289 | 289 | return -1; |
290 | 290 | } |
291 | 291 | if (ret != Z_OK) { |
292 | - error_setg(errp, "multifd %d: inflate returned %d instead of Z_OK", | |
292 | + error_setg(errp, "multifd %u: inflate returned %d instead of Z_OK", | |
293 | 293 | p->id, ret); |
294 | 294 | return -1; |
295 | 295 | } |
296 | 296 | } |
297 | 297 | out_size = zs->total_out - out_size; |
298 | 298 | if (out_size != expected_size) { |
299 | - error_setg(errp, "multifd %d: packet size received %d size expected %d", | |
299 | + error_setg(errp, "multifd %u: packet size received %u size expected %u", | |
300 | 300 | p->id, out_size, expected_size); |
301 | 301 | return -1; |
302 | 302 | } |
@@ -55,7 +55,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp) | ||
55 | 55 | z->zcs = ZSTD_createCStream(); |
56 | 56 | if (!z->zcs) { |
57 | 57 | g_free(z); |
58 | - error_setg(errp, "multifd %d: zstd createCStream failed", p->id); | |
58 | + error_setg(errp, "multifd %u: zstd createCStream failed", p->id); | |
59 | 59 | return -1; |
60 | 60 | } |
61 | 61 |
@@ -63,7 +63,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp) | ||
63 | 63 | if (ZSTD_isError(res)) { |
64 | 64 | ZSTD_freeCStream(z->zcs); |
65 | 65 | g_free(z); |
66 | - error_setg(errp, "multifd %d: initCStream failed with error %s", | |
66 | + error_setg(errp, "multifd %u: initCStream failed with error %s", | |
67 | 67 | p->id, ZSTD_getErrorName(res)); |
68 | 68 | return -1; |
69 | 69 | } |
@@ -73,7 +73,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp) | ||
73 | 73 | if (!z->zbuff) { |
74 | 74 | ZSTD_freeCStream(z->zcs); |
75 | 75 | g_free(z); |
76 | - error_setg(errp, "multifd %d: out of memory for zbuff", p->id); | |
76 | + error_setg(errp, "multifd %u: out of memory for zbuff", p->id); | |
77 | 77 | return -1; |
78 | 78 | } |
79 | 79 | return 0; |
@@ -144,12 +144,12 @@ static int zstd_send_prepare(MultiFDSendParams *p, Error **errp) | ||
144 | 144 | } while (ret > 0 && (z->in.size - z->in.pos > 0) |
145 | 145 | && (z->out.size - z->out.pos > 0)); |
146 | 146 | if (ret > 0 && (z->in.size - z->in.pos > 0)) { |
147 | - error_setg(errp, "multifd %d: compressStream buffer too small", | |
147 | + error_setg(errp, "multifd %u: compressStream buffer too small", | |
148 | 148 | p->id); |
149 | 149 | return -1; |
150 | 150 | } |
151 | 151 | if (ZSTD_isError(ret)) { |
152 | - error_setg(errp, "multifd %d: compressStream error %s", | |
152 | + error_setg(errp, "multifd %u: compressStream error %s", | |
153 | 153 | p->id, ZSTD_getErrorName(ret)); |
154 | 154 | return -1; |
155 | 155 | } |
@@ -198,7 +198,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp) | ||
198 | 198 | z->zds = ZSTD_createDStream(); |
199 | 199 | if (!z->zds) { |
200 | 200 | g_free(z); |
201 | - error_setg(errp, "multifd %d: zstd createDStream failed", p->id); | |
201 | + error_setg(errp, "multifd %u: zstd createDStream failed", p->id); | |
202 | 202 | return -1; |
203 | 203 | } |
204 | 204 |
@@ -206,7 +206,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp) | ||
206 | 206 | if (ZSTD_isError(ret)) { |
207 | 207 | ZSTD_freeDStream(z->zds); |
208 | 208 | g_free(z); |
209 | - error_setg(errp, "multifd %d: initDStream failed with error %s", | |
209 | + error_setg(errp, "multifd %u: initDStream failed with error %s", | |
210 | 210 | p->id, ZSTD_getErrorName(ret)); |
211 | 211 | return -1; |
212 | 212 | } |
@@ -217,7 +217,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp) | ||
217 | 217 | if (!z->zbuff) { |
218 | 218 | ZSTD_freeDStream(z->zds); |
219 | 219 | g_free(z); |
220 | - error_setg(errp, "multifd %d: out of memory for zbuff", p->id); | |
220 | + error_setg(errp, "multifd %u: out of memory for zbuff", p->id); | |
221 | 221 | return -1; |
222 | 222 | } |
223 | 223 | return 0; |
@@ -265,7 +265,7 @@ static int zstd_recv_pages(MultiFDRecvParams *p, Error **errp) | ||
265 | 265 | int i; |
266 | 266 | |
267 | 267 | if (flags != MULTIFD_FLAG_ZSTD) { |
268 | - error_setg(errp, "multifd %d: flags received %x flags expected %x", | |
268 | + error_setg(errp, "multifd %u: flags received %x flags expected %x", | |
269 | 269 | p->id, flags, MULTIFD_FLAG_ZSTD); |
270 | 270 | return -1; |
271 | 271 | } |
@@ -297,19 +297,19 @@ static int zstd_recv_pages(MultiFDRecvParams *p, Error **errp) | ||
297 | 297 | } while (ret > 0 && (z->in.size - z->in.pos > 0) |
298 | 298 | && (z->out.pos < page_size)); |
299 | 299 | if (ret > 0 && (z->out.pos < page_size)) { |
300 | - error_setg(errp, "multifd %d: decompressStream buffer too small", | |
300 | + error_setg(errp, "multifd %u: decompressStream buffer too small", | |
301 | 301 | p->id); |
302 | 302 | return -1; |
303 | 303 | } |
304 | 304 | if (ZSTD_isError(ret)) { |
305 | - error_setg(errp, "multifd %d: decompressStream returned %s", | |
305 | + error_setg(errp, "multifd %u: decompressStream returned %s", | |
306 | 306 | p->id, ZSTD_getErrorName(ret)); |
307 | 307 | return ret; |
308 | 308 | } |
309 | 309 | out_size += z->out.pos; |
310 | 310 | } |
311 | 311 | if (out_size != expected_size) { |
312 | - error_setg(errp, "multifd %d: packet size received %d size expected %d", | |
312 | + error_setg(errp, "multifd %u: packet size received %u size expected %u", | |
313 | 313 | p->id, out_size, expected_size); |
314 | 314 | return -1; |
315 | 315 | } |
@@ -148,7 +148,7 @@ static int nocomp_recv_pages(MultiFDRecvParams *p, Error **errp) | ||
148 | 148 | uint32_t flags = p->flags & MULTIFD_FLAG_COMPRESSION_MASK; |
149 | 149 | |
150 | 150 | if (flags != MULTIFD_FLAG_NOCOMP) { |
151 | - error_setg(errp, "multifd %d: flags received %x flags expected %x", | |
151 | + error_setg(errp, "multifd %u: flags received %x flags expected %x", | |
152 | 152 | p->id, flags, MULTIFD_FLAG_NOCOMP); |
153 | 153 | return -1; |
154 | 154 | } |
@@ -212,8 +212,8 @@ static int multifd_recv_initial_packet(QIOChannel *c, Error **errp) | ||
212 | 212 | } |
213 | 213 | |
214 | 214 | if (msg.version != MULTIFD_VERSION) { |
215 | - error_setg(errp, "multifd: received packet version %d " | |
216 | - "expected %d", msg.version, MULTIFD_VERSION); | |
215 | + error_setg(errp, "multifd: received packet version %u " | |
216 | + "expected %u", msg.version, MULTIFD_VERSION); | |
217 | 217 | return -1; |
218 | 218 | } |
219 | 219 |
@@ -229,8 +229,8 @@ static int multifd_recv_initial_packet(QIOChannel *c, Error **errp) | ||
229 | 229 | } |
230 | 230 | |
231 | 231 | if (msg.id > migrate_multifd_channels()) { |
232 | - error_setg(errp, "multifd: received channel version %d " | |
233 | - "expected %d", msg.version, MULTIFD_VERSION); | |
232 | + error_setg(errp, "multifd: received channel version %u " | |
233 | + "expected %u", msg.version, MULTIFD_VERSION); | |
234 | 234 | return -1; |
235 | 235 | } |
236 | 236 |
@@ -303,7 +303,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp) | ||
303 | 303 | packet->version = be32_to_cpu(packet->version); |
304 | 304 | if (packet->version != MULTIFD_VERSION) { |
305 | 305 | error_setg(errp, "multifd: received packet " |
306 | - "version %d and expected version %d", | |
306 | + "version %u and expected version %u", | |
307 | 307 | packet->version, MULTIFD_VERSION); |
308 | 308 | return -1; |
309 | 309 | } |
@@ -317,7 +317,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp) | ||
317 | 317 | */ |
318 | 318 | if (packet->pages_alloc > pages_max * 100) { |
319 | 319 | error_setg(errp, "multifd: received packet " |
320 | - "with size %d and expected a maximum size of %d", | |
320 | + "with size %u and expected a maximum size of %u", | |
321 | 321 | packet->pages_alloc, pages_max * 100) ; |
322 | 322 | return -1; |
323 | 323 | } |
@@ -333,7 +333,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp) | ||
333 | 333 | p->pages->num = be32_to_cpu(packet->pages_used); |
334 | 334 | if (p->pages->num > packet->pages_alloc) { |
335 | 335 | error_setg(errp, "multifd: received packet " |
336 | - "with %d pages and expected maximum pages are %d", | |
336 | + "with %u pages and expected maximum pages are %u", | |
337 | 337 | p->pages->num, packet->pages_alloc) ; |
338 | 338 | return -1; |
339 | 339 | } |
@@ -115,23 +115,23 @@ ram_write_tracking_ramblock_start(const char *block_id, size_t page_size, void * | ||
115 | 115 | ram_write_tracking_ramblock_stop(const char *block_id, size_t page_size, void *addr, size_t length) "%s: page_size: %zu addr: %p length: %zu" |
116 | 116 | |
117 | 117 | # multifd.c |
118 | -multifd_new_send_channel_async(uint8_t id) "channel %d" | |
119 | -multifd_recv(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flags, uint32_t next_packet_size) "channel %d packet_num %" PRIu64 " pages %d flags 0x%x next packet size %d" | |
120 | -multifd_recv_new_channel(uint8_t id) "channel %d" | |
118 | +multifd_new_send_channel_async(uint8_t id) "channel %u" | |
119 | +multifd_recv(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flags, uint32_t next_packet_size) "channel %u packet_num %" PRIu64 " pages %u flags 0x%x next packet size %u" | |
120 | +multifd_recv_new_channel(uint8_t id) "channel %u" | |
121 | 121 | multifd_recv_sync_main(long packet_num) "packet num %ld" |
122 | -multifd_recv_sync_main_signal(uint8_t id) "channel %d" | |
123 | -multifd_recv_sync_main_wait(uint8_t id) "channel %d" | |
122 | +multifd_recv_sync_main_signal(uint8_t id) "channel %u" | |
123 | +multifd_recv_sync_main_wait(uint8_t id) "channel %u" | |
124 | 124 | multifd_recv_terminate_threads(bool error) "error %d" |
125 | -multifd_recv_thread_end(uint8_t id, uint64_t packets, uint64_t pages) "channel %d packets %" PRIu64 " pages %" PRIu64 | |
126 | -multifd_recv_thread_start(uint8_t id) "%d" | |
127 | -multifd_send(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flags, uint32_t next_packet_size) "channel %d packet_num %" PRIu64 " pages %d flags 0x%x next packet size %d" | |
128 | -multifd_send_error(uint8_t id) "channel %d" | |
125 | +multifd_recv_thread_end(uint8_t id, uint64_t packets, uint64_t pages) "channel %u packets %" PRIu64 " pages %" PRIu64 | |
126 | +multifd_recv_thread_start(uint8_t id) "%u" | |
127 | +multifd_send(uint8_t id, uint64_t packet_num, uint32_t used, uint32_t flags, uint32_t next_packet_size) "channel %u packet_num %" PRIu64 " pages %u flags 0x%x next packet size %u" | |
128 | +multifd_send_error(uint8_t id) "channel %u" | |
129 | 129 | multifd_send_sync_main(long packet_num) "packet num %ld" |
130 | -multifd_send_sync_main_signal(uint8_t id) "channel %d" | |
131 | -multifd_send_sync_main_wait(uint8_t id) "channel %d" | |
130 | +multifd_send_sync_main_signal(uint8_t id) "channel %u" | |
131 | +multifd_send_sync_main_wait(uint8_t id) "channel %u" | |
132 | 132 | multifd_send_terminate_threads(bool error) "error %d" |
133 | -multifd_send_thread_end(uint8_t id, uint64_t packets, uint64_t pages) "channel %d packets %" PRIu64 " pages %" PRIu64 | |
134 | -multifd_send_thread_start(uint8_t id) "%d" | |
133 | +multifd_send_thread_end(uint8_t id, uint64_t packets, uint64_t pages) "channel %u packets %" PRIu64 " pages %" PRIu64 | |
134 | +multifd_send_thread_start(uint8_t id) "%u" | |
135 | 135 | multifd_tls_outgoing_handshake_start(void *ioc, void *tioc, const char *hostname) "ioc=%p tioc=%p hostname=%s" |
136 | 136 | multifd_tls_outgoing_handshake_error(void *ioc, const char *err) "ioc=%p err=%s" |
137 | 137 | multifd_tls_outgoing_handshake_complete(void *ioc) "ioc=%p" |