qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

tests: Do not use "\n" in g_test_message() strings

g_test_message() takes care of the newline on its own, so we
should not use \n in the strings here.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>

+24 -26
+2 -2
tests/ivshmem-test.c
··· 74 74 unsigned res; 75 75 76 76 res = qpci_io_readl(s->dev, s->reg_bar, reg); 77 - g_test_message("*%s -> %x\n", name, res); 77 + g_test_message("*%s -> %x", name, res); 78 78 79 79 return res; 80 80 } ··· 83 83 { 84 84 const char *name = reg2str(reg); 85 85 86 - g_test_message("%x -> *%s\n", v, name); 86 + g_test_message("%x -> *%s", v, name); 87 87 qpci_io_writel(s->dev, s->reg_bar, reg, v); 88 88 } 89 89
+2 -2
tests/m48t59-test.c
··· 199 199 t = (long)mktime(datep); 200 200 s = (long)mktime(&start); 201 201 if (t < s) { 202 - g_test_message("RTC is %ld second(s) behind wall-clock\n", (s - t)); 202 + g_test_message("RTC is %ld second(s) behind wall-clock", (s - t)); 203 203 } else { 204 - g_test_message("RTC is %ld second(s) ahead of wall-clock\n", (t - s)); 204 + g_test_message("RTC is %ld second(s) ahead of wall-clock", (t - s)); 205 205 } 206 206 207 207 g_assert_cmpint(ABS(t - s), <=, wiggle);
+2 -2
tests/migration-test.c
··· 1066 1066 1067 1067 tmpfs = mkdtemp(template); 1068 1068 if (!tmpfs) { 1069 - g_test_message("mkdtemp on path (%s): %s\n", template, strerror(errno)); 1069 + g_test_message("mkdtemp on path (%s): %s", template, strerror(errno)); 1070 1070 } 1071 1071 g_assert(tmpfs); 1072 1072 ··· 1087 1087 1088 1088 ret = rmdir(tmpfs); 1089 1089 if (ret != 0) { 1090 - g_test_message("unable to rmdir: path (%s): %s\n", 1090 + g_test_message("unable to rmdir: path (%s): %s", 1091 1091 tmpfs, strerror(errno)); 1092 1092 } 1093 1093
+2 -2
tests/rtc-test.c
··· 165 165 t = (long)mktime(datep); 166 166 s = (long)mktime(&start); 167 167 if (t < s) { 168 - g_test_message("RTC is %ld second(s) behind wall-clock\n", (s - t)); 168 + g_test_message("RTC is %ld second(s) behind wall-clock", (s - t)); 169 169 } else { 170 - g_test_message("RTC is %ld second(s) ahead of wall-clock\n", (t - s)); 170 + g_test_message("RTC is %ld second(s) ahead of wall-clock", (t - s)); 171 171 } 172 172 173 173 g_assert_cmpint(ABS(t - s), <=, wiggle);
+3 -3
tests/rtl8139-test.c
··· 46 46 static unsigned __attribute__((unused)) in_##name(void) \ 47 47 { \ 48 48 unsigned res = qpci_io_read##len(dev, dev_bar, (val)); \ 49 - g_test_message("*%s -> %x\n", #name, res); \ 49 + g_test_message("*%s -> %x", #name, res); \ 50 50 return res; \ 51 51 } \ 52 52 static void out_##name(unsigned v) \ 53 53 { \ 54 - g_test_message("%x -> *%s\n", v, #name); \ 54 + g_test_message("%x -> *%s", v, #name); \ 55 55 qpci_io_write##len(dev, dev_bar, (val), v); \ 56 56 } 57 57 ··· 176 176 } 177 177 } 178 178 179 - g_test_message("Everythink is ok!\n"); 179 + g_test_message("Everythink is ok!"); 180 180 } 181 181 182 182
+4 -4
tests/test-aio-multithread.c
··· 178 178 } 179 179 180 180 join_aio_contexts(); 181 - g_test_message("scheduled %d, queued %d, retry %d, total %d\n", 181 + g_test_message("scheduled %d, queued %d, retry %d, total %d", 182 182 count_other, count_here, count_retry, 183 183 count_here + count_other + count_retry); 184 184 } ··· 242 242 } 243 243 244 244 join_aio_contexts(); 245 - g_test_message("%d iterations/second\n", counter / seconds); 245 + g_test_message("%d iterations/second", counter / seconds); 246 246 g_assert_cmpint(counter, ==, atomic_counter); 247 247 } 248 248 ··· 361 361 } 362 362 363 363 join_aio_contexts(); 364 - g_test_message("%d iterations/second\n", counter / seconds); 364 + g_test_message("%d iterations/second", counter / seconds); 365 365 g_assert_cmpint(counter, ==, atomic_counter); 366 366 } 367 367 ··· 417 417 } 418 418 419 419 join_aio_contexts(); 420 - g_test_message("%d iterations/second\n", counter / seconds); 420 + g_test_message("%d iterations/second", counter / seconds); 421 421 g_assert_cmpint(counter, ==, atomic_counter); 422 422 } 423 423
+4 -6
tests/test-coroutine.c
··· 369 369 } 370 370 duration = g_test_timer_elapsed(); 371 371 372 - g_test_message("Lifecycle %u iterations: %f s\n", max, duration); 372 + g_test_message("Lifecycle %u iterations: %f s", max, duration); 373 373 } 374 374 375 375 static void perf_nesting(void) ··· 393 393 } 394 394 duration = g_test_timer_elapsed(); 395 395 396 - g_test_message("Nesting %u iterations of %u depth each: %f s\n", 396 + g_test_message("Nesting %u iterations of %u depth each: %f s", 397 397 maxcycles, maxnesting, duration); 398 398 } 399 399 ··· 426 426 } 427 427 duration = g_test_timer_elapsed(); 428 428 429 - g_test_message("Yield %u iterations: %f s\n", 430 - maxcycles, duration); 429 + g_test_message("Yield %u iterations: %f s", maxcycles, duration); 431 430 } 432 431 433 432 static __attribute__((noinline)) void dummy(unsigned *i) ··· 449 448 } 450 449 duration = g_test_timer_elapsed(); 451 450 452 - g_test_message("Function call %u iterations: %f s\n", 453 - maxcycles, duration); 451 + g_test_message("Function call %u iterations: %f s", maxcycles, duration); 454 452 } 455 453 456 454 static __attribute__((noinline)) void perf_cost_func(void *opaque)
+5 -5
tests/vhost-user-test.c
··· 337 337 } 338 338 339 339 if (size != VHOST_USER_HDR_SIZE) { 340 - g_test_message("Wrong message size received %d\n", size); 340 + g_test_message("Wrong message size received %d", size); 341 341 return; 342 342 } 343 343 ··· 348 348 p += VHOST_USER_HDR_SIZE; 349 349 size = qemu_chr_fe_read_all(chr, p, msg.size); 350 350 if (size != msg.size) { 351 - g_test_message("Wrong message size received %d != %d\n", 351 + g_test_message("Wrong message size received %d != %d", 352 352 size, msg.size); 353 353 return; 354 354 } ··· 476 476 } 477 477 478 478 if (access(path, R_OK | W_OK | X_OK)) { 479 - g_test_message("access on path (%s): %s\n", path, strerror(errno)); 479 + g_test_message("access on path (%s): %s", path, strerror(errno)); 480 480 abort(); 481 481 return NULL; 482 482 } ··· 486 486 } while (ret != 0 && errno == EINTR); 487 487 488 488 if (ret != 0) { 489 - g_test_message("statfs on path (%s): %s\n", path, strerror(errno)); 489 + g_test_message("statfs on path (%s): %s", path, strerror(errno)); 490 490 abort(); 491 491 return NULL; 492 492 } 493 493 494 494 if (fs.f_type != HUGETLBFS_MAGIC) { 495 - g_test_message("Warning: path not on HugeTLBFS: %s\n", path); 495 + g_test_message("Warning: path not on HugeTLBFS: %s", path); 496 496 abort(); 497 497 return NULL; 498 498 }