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

tests/migration: fix unreachable path in stress test

If stressone() or stress() exits it's because of a failure
because the test runs forever otherwise, so change stressone
and stress type to void to make the exit_failure() as the exit
function of main().

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200603080904.997083-3-maozhongyi@cmss.chinamobile.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

authored by

Mao Zhongyi and committed by
Dr. David Alan Gilbert
71cfce73 f663492f

+5 -8
+5 -8
tests/migration/stress.c
··· 167 167 return (tv.tv_sec * 1000ull) + (tv.tv_usec / 1000ull); 168 168 } 169 169 170 - static int stressone(unsigned long long ramsizeMB) 170 + static void stressone(unsigned long long ramsizeMB) 171 171 { 172 172 size_t pagesPerMB = 1024 * 1024 / PAGE_SIZE; 173 173 g_autofree char *ram = g_malloc(ramsizeMB * 1024 * 1024); ··· 186 186 memset(ram, 0xfe, ramsizeMB * 1024 * 1024); 187 187 188 188 if (random_bytes(data, PAGE_SIZE) < 0) { 189 - return -1; 189 + return; 190 190 } 191 191 192 192 before = now(); ··· 225 225 return NULL; 226 226 } 227 227 228 - static int stress(unsigned long long ramsizeGB, int ncpus) 228 + static void stress(unsigned long long ramsizeGB, int ncpus) 229 229 { 230 230 size_t i; 231 231 unsigned long long ramsizeMB = ramsizeGB * 1024 / ncpus; ··· 238 238 } 239 239 240 240 stressone(ramsizeMB); 241 - 242 - return 0; 243 241 } 244 242 245 243 ··· 335 333 fprintf(stdout, "%s (%05d): INFO: RAM %llu GiB across %d CPUs\n", 336 334 argv0, gettid(), ramsizeGB, ncpus); 337 335 338 - if (stress(ramsizeGB, ncpus) < 0) 339 - exit_failure(); 336 + stress(ramsizeGB, ncpus); 340 337 341 - exit_success(); 338 + exit_failure(); 342 339 }