• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision04e114049406dbb69fc9043c795ddd28fdba31a6 (tree)
Time2022-01-28 23:38:22
AuthorJuan Quintela <quintela@redh...>
CommiterJuan Quintela

Log Message

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>

Change Summary

Incremental Difference

--- a/migration/multifd-zlib.c
+++ b/migration/multifd-zlib.c
@@ -51,7 +51,7 @@ static int zlib_send_setup(MultiFDSendParams *p, Error **errp)
5151 zs->opaque = Z_NULL;
5252 if (deflateInit(zs, migrate_multifd_zlib_level()) != Z_OK) {
5353 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);
5555 return -1;
5656 }
5757 /* To be safe, we reserve twice the size of the packet */
@@ -60,7 +60,7 @@ static int zlib_send_setup(MultiFDSendParams *p, Error **errp)
6060 if (!z->zbuff) {
6161 deflateEnd(&z->zs);
6262 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);
6464 return -1;
6565 }
6666 p->data = z;
@@ -132,12 +132,12 @@ static int zlib_send_prepare(MultiFDSendParams *p, Error **errp)
132132 ret = deflate(zs, flush);
133133 } while (ret == Z_OK && zs->avail_in && zs->avail_out);
134134 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",
136136 p->id);
137137 return -1;
138138 }
139139 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",
141141 p->id, ret);
142142 return -1;
143143 }
@@ -190,7 +190,7 @@ static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp)
190190 zs->avail_in = 0;
191191 zs->next_in = Z_NULL;
192192 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);
194194 return -1;
195195 }
196196 /* To be safe, we reserve twice the size of the packet */
@@ -198,7 +198,7 @@ static int zlib_recv_setup(MultiFDRecvParams *p, Error **errp)
198198 z->zbuff = g_try_malloc(z->zbuff_len);
199199 if (!z->zbuff) {
200200 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);
202202 return -1;
203203 }
204204 return 0;
@@ -247,7 +247,7 @@ static int zlib_recv_pages(MultiFDRecvParams *p, Error **errp)
247247 int i;
248248
249249 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",
251251 p->id, flags, MULTIFD_FLAG_ZLIB);
252252 return -1;
253253 }
@@ -284,19 +284,19 @@ static int zlib_recv_pages(MultiFDRecvParams *p, Error **errp)
284284 } while (ret == Z_OK && zs->avail_in
285285 && (zs->total_out - start) < page_size);
286286 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",
288288 p->id);
289289 return -1;
290290 }
291291 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",
293293 p->id, ret);
294294 return -1;
295295 }
296296 }
297297 out_size = zs->total_out - out_size;
298298 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",
300300 p->id, out_size, expected_size);
301301 return -1;
302302 }
--- a/migration/multifd-zstd.c
+++ b/migration/multifd-zstd.c
@@ -55,7 +55,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp)
5555 z->zcs = ZSTD_createCStream();
5656 if (!z->zcs) {
5757 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);
5959 return -1;
6060 }
6161
@@ -63,7 +63,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp)
6363 if (ZSTD_isError(res)) {
6464 ZSTD_freeCStream(z->zcs);
6565 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",
6767 p->id, ZSTD_getErrorName(res));
6868 return -1;
6969 }
@@ -73,7 +73,7 @@ static int zstd_send_setup(MultiFDSendParams *p, Error **errp)
7373 if (!z->zbuff) {
7474 ZSTD_freeCStream(z->zcs);
7575 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);
7777 return -1;
7878 }
7979 return 0;
@@ -144,12 +144,12 @@ static int zstd_send_prepare(MultiFDSendParams *p, Error **errp)
144144 } while (ret > 0 && (z->in.size - z->in.pos > 0)
145145 && (z->out.size - z->out.pos > 0));
146146 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",
148148 p->id);
149149 return -1;
150150 }
151151 if (ZSTD_isError(ret)) {
152- error_setg(errp, "multifd %d: compressStream error %s",
152+ error_setg(errp, "multifd %u: compressStream error %s",
153153 p->id, ZSTD_getErrorName(ret));
154154 return -1;
155155 }
@@ -198,7 +198,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp)
198198 z->zds = ZSTD_createDStream();
199199 if (!z->zds) {
200200 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);
202202 return -1;
203203 }
204204
@@ -206,7 +206,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp)
206206 if (ZSTD_isError(ret)) {
207207 ZSTD_freeDStream(z->zds);
208208 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",
210210 p->id, ZSTD_getErrorName(ret));
211211 return -1;
212212 }
@@ -217,7 +217,7 @@ static int zstd_recv_setup(MultiFDRecvParams *p, Error **errp)
217217 if (!z->zbuff) {
218218 ZSTD_freeDStream(z->zds);
219219 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);
221221 return -1;
222222 }
223223 return 0;
@@ -265,7 +265,7 @@ static int zstd_recv_pages(MultiFDRecvParams *p, Error **errp)
265265 int i;
266266
267267 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",
269269 p->id, flags, MULTIFD_FLAG_ZSTD);
270270 return -1;
271271 }
@@ -297,19 +297,19 @@ static int zstd_recv_pages(MultiFDRecvParams *p, Error **errp)
297297 } while (ret > 0 && (z->in.size - z->in.pos > 0)
298298 && (z->out.pos < page_size));
299299 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",
301301 p->id);
302302 return -1;
303303 }
304304 if (ZSTD_isError(ret)) {
305- error_setg(errp, "multifd %d: decompressStream returned %s",
305+ error_setg(errp, "multifd %u: decompressStream returned %s",
306306 p->id, ZSTD_getErrorName(ret));
307307 return ret;
308308 }
309309 out_size += z->out.pos;
310310 }
311311 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",
313313 p->id, out_size, expected_size);
314314 return -1;
315315 }
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -148,7 +148,7 @@ static int nocomp_recv_pages(MultiFDRecvParams *p, Error **errp)
148148 uint32_t flags = p->flags & MULTIFD_FLAG_COMPRESSION_MASK;
149149
150150 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",
152152 p->id, flags, MULTIFD_FLAG_NOCOMP);
153153 return -1;
154154 }
@@ -212,8 +212,8 @@ static int multifd_recv_initial_packet(QIOChannel *c, Error **errp)
212212 }
213213
214214 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);
217217 return -1;
218218 }
219219
@@ -229,8 +229,8 @@ static int multifd_recv_initial_packet(QIOChannel *c, Error **errp)
229229 }
230230
231231 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);
234234 return -1;
235235 }
236236
@@ -303,7 +303,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
303303 packet->version = be32_to_cpu(packet->version);
304304 if (packet->version != MULTIFD_VERSION) {
305305 error_setg(errp, "multifd: received packet "
306- "version %d and expected version %d",
306+ "version %u and expected version %u",
307307 packet->version, MULTIFD_VERSION);
308308 return -1;
309309 }
@@ -317,7 +317,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
317317 */
318318 if (packet->pages_alloc > pages_max * 100) {
319319 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",
321321 packet->pages_alloc, pages_max * 100) ;
322322 return -1;
323323 }
@@ -333,7 +333,7 @@ static int multifd_recv_unfill_packet(MultiFDRecvParams *p, Error **errp)
333333 p->pages->num = be32_to_cpu(packet->pages_used);
334334 if (p->pages->num > packet->pages_alloc) {
335335 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",
337337 p->pages->num, packet->pages_alloc) ;
338338 return -1;
339339 }
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -115,23 +115,23 @@ ram_write_tracking_ramblock_start(const char *block_id, size_t page_size, void *
115115 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"
116116
117117 # 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"
121121 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"
124124 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"
129129 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"
132132 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"
135135 multifd_tls_outgoing_handshake_start(void *ioc, void *tioc, const char *hostname) "ioc=%p tioc=%p hostname=%s"
136136 multifd_tls_outgoing_handshake_error(void *ioc, const char *err) "ioc=%p err=%s"
137137 multifd_tls_outgoing_handshake_complete(void *ioc) "ioc=%p"