]> git.proxmox.com Git - mirror_qemu.git/blob - tests/migration-test.c
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180926' into staging
[mirror_qemu.git] / tests / migration-test.c
1 /*
2 * QTest testcase for migration
3 *
4 * Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates
5 * based on the vhost-user-test.c that is:
6 * Copyright (c) 2014 Virtual Open Systems Sarl.
7 *
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
10 *
11 */
12
13 #include "qemu/osdep.h"
14
15 #include "libqtest.h"
16 #include "qapi/qmp/qdict.h"
17 #include "qapi/qmp/qjson.h"
18 #include "qemu/option.h"
19 #include "qemu/range.h"
20 #include "qemu/sockets.h"
21 #include "chardev/char.h"
22 #include "sysemu/sysemu.h"
23
24 #include "migration/migration-test.h"
25
26 /* TODO actually test the results and get rid of this */
27 #define qtest_qmp_discard_response(...) qobject_unref(qtest_qmp(__VA_ARGS__))
28
29 unsigned start_address;
30 unsigned end_address;
31 bool got_stop;
32 static bool uffd_feature_thread_id;
33
34 #if defined(__linux__)
35 #include <sys/syscall.h>
36 #include <sys/vfs.h>
37 #endif
38
39 #if defined(__linux__) && defined(__NR_userfaultfd) && defined(CONFIG_EVENTFD)
40 #include <sys/eventfd.h>
41 #include <sys/ioctl.h>
42 #include <linux/userfaultfd.h>
43
44 static bool ufd_version_check(void)
45 {
46 struct uffdio_api api_struct;
47 uint64_t ioctl_mask;
48
49 int ufd = syscall(__NR_userfaultfd, O_CLOEXEC);
50
51 if (ufd == -1) {
52 g_test_message("Skipping test: userfaultfd not available");
53 return false;
54 }
55
56 api_struct.api = UFFD_API;
57 api_struct.features = 0;
58 if (ioctl(ufd, UFFDIO_API, &api_struct)) {
59 g_test_message("Skipping test: UFFDIO_API failed");
60 return false;
61 }
62 uffd_feature_thread_id = api_struct.features & UFFD_FEATURE_THREAD_ID;
63
64 ioctl_mask = (__u64)1 << _UFFDIO_REGISTER |
65 (__u64)1 << _UFFDIO_UNREGISTER;
66 if ((api_struct.ioctls & ioctl_mask) != ioctl_mask) {
67 g_test_message("Skipping test: Missing userfault feature");
68 return false;
69 }
70
71 return true;
72 }
73
74 #else
75 static bool ufd_version_check(void)
76 {
77 g_test_message("Skipping test: Userfault not available (builtdtime)");
78 return false;
79 }
80
81 #endif
82
83 static const char *tmpfs;
84
85 /* The boot file modifies memory area in [start_address, end_address)
86 * repeatedly. It outputs a 'B' at a fixed rate while it's still running.
87 */
88 #include "tests/migration/i386/a-b-bootblock.h"
89
90 static void init_bootfile_x86(const char *bootpath)
91 {
92 FILE *bootfile = fopen(bootpath, "wb");
93
94 g_assert_cmpint(fwrite(x86_bootsect, 512, 1, bootfile), ==, 1);
95 fclose(bootfile);
96 }
97
98 /*
99 * Wait for some output in the serial output file,
100 * we get an 'A' followed by an endless string of 'B's
101 * but on the destination we won't have the A.
102 */
103 static void wait_for_serial(const char *side)
104 {
105 char *serialpath = g_strdup_printf("%s/%s", tmpfs, side);
106 FILE *serialfile = fopen(serialpath, "r");
107 const char *arch = qtest_get_arch();
108 int started = (strcmp(side, "src_serial") == 0 &&
109 strcmp(arch, "ppc64") == 0) ? 0 : 1;
110
111 g_free(serialpath);
112 do {
113 int readvalue = fgetc(serialfile);
114
115 if (!started) {
116 /* SLOF prints its banner before starting test,
117 * to ignore it, mark the start of the test with '_',
118 * ignore all characters until this marker
119 */
120 switch (readvalue) {
121 case '_':
122 started = 1;
123 break;
124 case EOF:
125 fseek(serialfile, 0, SEEK_SET);
126 usleep(1000);
127 break;
128 }
129 continue;
130 }
131 switch (readvalue) {
132 case 'A':
133 /* Fine */
134 break;
135
136 case 'B':
137 /* It's alive! */
138 fclose(serialfile);
139 return;
140
141 case EOF:
142 started = (strcmp(side, "src_serial") == 0 &&
143 strcmp(arch, "ppc64") == 0) ? 0 : 1;
144 fseek(serialfile, 0, SEEK_SET);
145 usleep(1000);
146 break;
147
148 default:
149 fprintf(stderr, "Unexpected %d on %s serial\n", readvalue, side);
150 g_assert_not_reached();
151 }
152 } while (true);
153 }
154
155 static void stop_cb(void *opaque, const char *name, QDict *data)
156 {
157 if (!strcmp(name, "STOP")) {
158 got_stop = true;
159 }
160 }
161
162 /*
163 * Events can get in the way of responses we are actually waiting for.
164 */
165 GCC_FMT_ATTR(2, 3)
166 static QDict *wait_command(QTestState *who, const char *command, ...)
167 {
168 va_list ap;
169
170 va_start(ap, command);
171 qtest_qmp_vsend(who, command, ap);
172 va_end(ap);
173
174 return qtest_qmp_receive_success(who, stop_cb, NULL);
175 }
176
177 /*
178 * Note: caller is responsible to free the returned object via
179 * qobject_unref() after use
180 */
181 static QDict *migrate_query(QTestState *who)
182 {
183 return wait_command(who, "{ 'execute': 'query-migrate' }");
184 }
185
186 /*
187 * Note: caller is responsible to free the returned object via
188 * g_free() after use
189 */
190 static gchar *migrate_query_status(QTestState *who)
191 {
192 QDict *rsp_return = migrate_query(who);
193 gchar *status = g_strdup(qdict_get_str(rsp_return, "status"));
194
195 g_assert(status);
196 qobject_unref(rsp_return);
197
198 return status;
199 }
200
201 /*
202 * It's tricky to use qemu's migration event capability with qtest,
203 * events suddenly appearing confuse the qmp()/hmp() responses.
204 */
205
206 static uint64_t get_migration_pass(QTestState *who)
207 {
208 QDict *rsp_return, *rsp_ram;
209 uint64_t result;
210
211 rsp_return = migrate_query(who);
212 if (!qdict_haskey(rsp_return, "ram")) {
213 /* Still in setup */
214 result = 0;
215 } else {
216 rsp_ram = qdict_get_qdict(rsp_return, "ram");
217 result = qdict_get_try_int(rsp_ram, "dirty-sync-count", 0);
218 }
219 qobject_unref(rsp_return);
220 return result;
221 }
222
223 static void read_blocktime(QTestState *who)
224 {
225 QDict *rsp_return;
226
227 rsp_return = migrate_query(who);
228 g_assert(qdict_haskey(rsp_return, "postcopy-blocktime"));
229 qobject_unref(rsp_return);
230 }
231
232 static void wait_for_migration_status(QTestState *who,
233 const char *goal)
234 {
235 while (true) {
236 bool completed;
237 char *status;
238
239 status = migrate_query_status(who);
240 completed = strcmp(status, goal) == 0;
241 g_assert_cmpstr(status, !=, "failed");
242 g_free(status);
243 if (completed) {
244 return;
245 }
246 usleep(1000);
247 }
248 }
249
250 static void wait_for_migration_complete(QTestState *who)
251 {
252 wait_for_migration_status(who, "completed");
253 }
254
255 static void wait_for_migration_pass(QTestState *who)
256 {
257 uint64_t initial_pass = get_migration_pass(who);
258 uint64_t pass;
259
260 /* Wait for the 1st sync */
261 while (!got_stop && !initial_pass) {
262 usleep(1000);
263 initial_pass = get_migration_pass(who);
264 }
265
266 do {
267 usleep(1000);
268 pass = get_migration_pass(who);
269 } while (pass == initial_pass && !got_stop);
270 }
271
272 static void check_guests_ram(QTestState *who)
273 {
274 /* Our ASM test will have been incrementing one byte from each page from
275 * start_address to < end_address in order. This gives us a constraint
276 * that any page's byte should be equal or less than the previous pages
277 * byte (mod 256); and they should all be equal except for one transition
278 * at the point where we meet the incrementer. (We're running this with
279 * the guest stopped).
280 */
281 unsigned address;
282 uint8_t first_byte;
283 uint8_t last_byte;
284 bool hit_edge = false;
285 bool bad = false;
286
287 qtest_memread(who, start_address, &first_byte, 1);
288 last_byte = first_byte;
289
290 for (address = start_address + TEST_MEM_PAGE_SIZE; address < end_address;
291 address += TEST_MEM_PAGE_SIZE)
292 {
293 uint8_t b;
294 qtest_memread(who, address, &b, 1);
295 if (b != last_byte) {
296 if (((b + 1) % 256) == last_byte && !hit_edge) {
297 /* This is OK, the guest stopped at the point of
298 * incrementing the previous page but didn't get
299 * to us yet.
300 */
301 hit_edge = true;
302 last_byte = b;
303 } else {
304 fprintf(stderr, "Memory content inconsistency at %x"
305 " first_byte = %x last_byte = %x current = %x"
306 " hit_edge = %x\n",
307 address, first_byte, last_byte, b, hit_edge);
308 bad = true;
309 }
310 }
311 }
312 g_assert_false(bad);
313 }
314
315 static void cleanup(const char *filename)
316 {
317 char *path = g_strdup_printf("%s/%s", tmpfs, filename);
318
319 unlink(path);
320 g_free(path);
321 }
322
323 static void migrate_check_parameter(QTestState *who, const char *parameter,
324 long long value)
325 {
326 QDict *rsp_return;
327
328 rsp_return = wait_command(who,
329 "{ 'execute': 'query-migrate-parameters' }");
330 g_assert_cmpint(qdict_get_int(rsp_return, parameter), ==, value);
331 qobject_unref(rsp_return);
332 }
333
334 static void migrate_set_parameter(QTestState *who, const char *parameter,
335 long long value)
336 {
337 QDict *rsp;
338
339 rsp = qtest_qmp(who,
340 "{ 'execute': 'migrate-set-parameters',"
341 "'arguments': { %s: %lld } }",
342 parameter, value);
343 g_assert(qdict_haskey(rsp, "return"));
344 qobject_unref(rsp);
345 migrate_check_parameter(who, parameter, value);
346 }
347
348 static void migrate_pause(QTestState *who)
349 {
350 QDict *rsp;
351
352 rsp = wait_command(who, "{ 'execute': 'migrate-pause' }");
353 qobject_unref(rsp);
354 }
355
356 static void migrate_recover(QTestState *who, const char *uri)
357 {
358 QDict *rsp;
359
360 rsp = wait_command(who,
361 "{ 'execute': 'migrate-recover', "
362 " 'id': 'recover-cmd', "
363 " 'arguments': { 'uri': %s } }",
364 uri);
365 qobject_unref(rsp);
366 }
367
368 static void migrate_set_capability(QTestState *who, const char *capability,
369 bool value)
370 {
371 QDict *rsp;
372
373 rsp = qtest_qmp(who,
374 "{ 'execute': 'migrate-set-capabilities',"
375 "'arguments': { "
376 "'capabilities': [ { "
377 "'capability': %s, 'state': %i } ] } }",
378 capability, value);
379 g_assert(qdict_haskey(rsp, "return"));
380 qobject_unref(rsp);
381 }
382
383 /*
384 * Send QMP command "migrate".
385 * Arguments are built from @fmt... (formatted like
386 * qobject_from_jsonf_nofail()) with "uri": @uri spliced in.
387 */
388 GCC_FMT_ATTR(3, 4)
389 static void migrate(QTestState *who, const char *uri, const char *fmt, ...)
390 {
391 va_list ap;
392 QDict *args, *rsp;
393
394 va_start(ap, fmt);
395 args = qdict_from_vjsonf_nofail(fmt, ap);
396 va_end(ap);
397
398 g_assert(!qdict_haskey(args, "uri"));
399 qdict_put_str(args, "uri", uri);
400
401 rsp = qmp("{ 'execute': 'migrate', 'arguments': %p}", args);
402 g_assert(qdict_haskey(rsp, "return"));
403 qobject_unref(rsp);
404 }
405
406 static void migrate_postcopy_start(QTestState *from, QTestState *to)
407 {
408 QDict *rsp;
409
410 rsp = wait_command(from, "{ 'execute': 'migrate-start-postcopy' }");
411 qobject_unref(rsp);
412
413 if (!got_stop) {
414 qtest_qmp_eventwait(from, "STOP");
415 }
416
417 qtest_qmp_eventwait(to, "RESUME");
418 }
419
420 static int test_migrate_start(QTestState **from, QTestState **to,
421 const char *uri, bool hide_stderr)
422 {
423 gchar *cmd_src, *cmd_dst;
424 char *bootpath = g_strdup_printf("%s/bootsect", tmpfs);
425 const char *arch = qtest_get_arch();
426 const char *accel = "kvm:tcg";
427
428 got_stop = false;
429
430 if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
431 init_bootfile_x86(bootpath);
432 cmd_src = g_strdup_printf("-machine accel=%s -m 150M"
433 " -name source,debug-threads=on"
434 " -serial file:%s/src_serial"
435 " -drive file=%s,format=raw",
436 accel, tmpfs, bootpath);
437 cmd_dst = g_strdup_printf("-machine accel=%s -m 150M"
438 " -name target,debug-threads=on"
439 " -serial file:%s/dest_serial"
440 " -drive file=%s,format=raw"
441 " -incoming %s",
442 accel, tmpfs, bootpath, uri);
443 start_address = X86_TEST_MEM_START;
444 end_address = X86_TEST_MEM_END;
445 } else if (strcmp(arch, "ppc64") == 0) {
446 cmd_src = g_strdup_printf("-machine accel=%s -m 256M -nodefaults"
447 " -name source,debug-threads=on"
448 " -serial file:%s/src_serial"
449 " -prom-env 'use-nvramrc?=true' -prom-env "
450 "'nvramrc=hex .\" _\" begin %x %x "
451 "do i c@ 1 + i c! 1000 +loop .\" B\" 0 "
452 "until'", accel, tmpfs, end_address,
453 start_address);
454 cmd_dst = g_strdup_printf("-machine accel=%s -m 256M"
455 " -name target,debug-threads=on"
456 " -serial file:%s/dest_serial"
457 " -incoming %s",
458 accel, tmpfs, uri);
459
460 start_address = PPC_TEST_MEM_START;
461 end_address = PPC_TEST_MEM_END;
462 } else {
463 g_assert_not_reached();
464 }
465
466 g_free(bootpath);
467
468 if (hide_stderr) {
469 gchar *tmp;
470 tmp = g_strdup_printf("%s 2>/dev/null", cmd_src);
471 g_free(cmd_src);
472 cmd_src = tmp;
473
474 tmp = g_strdup_printf("%s 2>/dev/null", cmd_dst);
475 g_free(cmd_dst);
476 cmd_dst = tmp;
477 }
478
479 *from = qtest_start(cmd_src);
480 g_free(cmd_src);
481
482 *to = qtest_init(cmd_dst);
483 g_free(cmd_dst);
484 return 0;
485 }
486
487 static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
488 {
489 unsigned char dest_byte_a, dest_byte_b, dest_byte_c, dest_byte_d;
490
491 qtest_quit(from);
492
493 if (test_dest) {
494 qtest_memread(to, start_address, &dest_byte_a, 1);
495
496 /* Destination still running, wait for a byte to change */
497 do {
498 qtest_memread(to, start_address, &dest_byte_b, 1);
499 usleep(1000 * 10);
500 } while (dest_byte_a == dest_byte_b);
501
502 qtest_qmp_discard_response(to, "{ 'execute' : 'stop'}");
503
504 /* With it stopped, check nothing changes */
505 qtest_memread(to, start_address, &dest_byte_c, 1);
506 usleep(1000 * 200);
507 qtest_memread(to, start_address, &dest_byte_d, 1);
508 g_assert_cmpint(dest_byte_c, ==, dest_byte_d);
509
510 check_guests_ram(to);
511 }
512
513 qtest_quit(to);
514
515 cleanup("bootsect");
516 cleanup("migsocket");
517 cleanup("src_serial");
518 cleanup("dest_serial");
519 }
520
521 static void deprecated_set_downtime(QTestState *who, const double value)
522 {
523 QDict *rsp;
524
525 rsp = qtest_qmp(who,
526 "{ 'execute': 'migrate_set_downtime',"
527 " 'arguments': { 'value': %f } }", value);
528 g_assert(qdict_haskey(rsp, "return"));
529 qobject_unref(rsp);
530 migrate_check_parameter(who, "downtime-limit", value * 1000);
531 }
532
533 static void deprecated_set_speed(QTestState *who, long long value)
534 {
535 QDict *rsp;
536
537 rsp = qtest_qmp(who, "{ 'execute': 'migrate_set_speed',"
538 "'arguments': { 'value': %lld } }", value);
539 g_assert(qdict_haskey(rsp, "return"));
540 qobject_unref(rsp);
541 migrate_check_parameter(who, "max-bandwidth", value);
542 }
543
544 static void test_deprecated(void)
545 {
546 QTestState *from;
547
548 from = qtest_start("");
549
550 deprecated_set_downtime(from, 0.12345);
551 deprecated_set_speed(from, 12345);
552
553 qtest_quit(from);
554 }
555
556 static int migrate_postcopy_prepare(QTestState **from_ptr,
557 QTestState **to_ptr,
558 bool hide_error)
559 {
560 char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
561 QTestState *from, *to;
562
563 if (test_migrate_start(&from, &to, uri, hide_error)) {
564 return -1;
565 }
566
567 migrate_set_capability(from, "postcopy-ram", true);
568 migrate_set_capability(to, "postcopy-ram", true);
569 migrate_set_capability(to, "postcopy-blocktime", true);
570
571 /* We want to pick a speed slow enough that the test completes
572 * quickly, but that it doesn't complete precopy even on a slow
573 * machine, so also set the downtime.
574 */
575 migrate_set_parameter(from, "max-bandwidth", 100000000);
576 migrate_set_parameter(from, "downtime-limit", 1);
577
578 /* Wait for the first serial output from the source */
579 wait_for_serial("src_serial");
580
581 migrate(from, uri, "{}");
582 g_free(uri);
583
584 wait_for_migration_pass(from);
585
586 *from_ptr = from;
587 *to_ptr = to;
588
589 return 0;
590 }
591
592 static void migrate_postcopy_complete(QTestState *from, QTestState *to)
593 {
594 wait_for_migration_complete(from);
595
596 /* Make sure we get at least one "B" on destination */
597 wait_for_serial("dest_serial");
598
599 if (uffd_feature_thread_id) {
600 read_blocktime(to);
601 }
602
603 test_migrate_end(from, to, true);
604 }
605
606 static void test_postcopy(void)
607 {
608 QTestState *from, *to;
609
610 if (migrate_postcopy_prepare(&from, &to, false)) {
611 return;
612 }
613 migrate_postcopy_start(from, to);
614 migrate_postcopy_complete(from, to);
615 }
616
617 static void test_postcopy_recovery(void)
618 {
619 QTestState *from, *to;
620 char *uri;
621
622 if (migrate_postcopy_prepare(&from, &to, true)) {
623 return;
624 }
625
626 /* Turn postcopy speed down, 4K/s is slow enough on any machines */
627 migrate_set_parameter(from, "max-postcopy-bandwidth", 4096);
628
629 /* Now we start the postcopy */
630 migrate_postcopy_start(from, to);
631
632 /*
633 * Wait until postcopy is really started; we can only run the
634 * migrate-pause command during a postcopy
635 */
636 wait_for_migration_status(from, "postcopy-active");
637
638 /*
639 * Manually stop the postcopy migration. This emulates a network
640 * failure with the migration socket
641 */
642 migrate_pause(from);
643
644 /*
645 * Wait for destination side to reach postcopy-paused state. The
646 * migrate-recover command can only succeed if destination machine
647 * is in the paused state
648 */
649 wait_for_migration_status(to, "postcopy-paused");
650
651 /*
652 * Create a new socket to emulate a new channel that is different
653 * from the broken migration channel; tell the destination to
654 * listen to the new port
655 */
656 uri = g_strdup_printf("unix:%s/migsocket-recover", tmpfs);
657 migrate_recover(to, uri);
658
659 /*
660 * Try to rebuild the migration channel using the resume flag and
661 * the newly created channel
662 */
663 wait_for_migration_status(from, "postcopy-paused");
664 migrate(from, uri, "{'resume': true}");
665 g_free(uri);
666
667 /* Restore the postcopy bandwidth to unlimited */
668 migrate_set_parameter(from, "max-postcopy-bandwidth", 0);
669
670 migrate_postcopy_complete(from, to);
671 }
672
673 static void test_baddest(void)
674 {
675 QTestState *from, *to;
676 QDict *rsp_return;
677 char *status;
678 bool failed;
679
680 if (test_migrate_start(&from, &to, "tcp:0:0", true)) {
681 return;
682 }
683 migrate(from, "tcp:0:0", "{}");
684 do {
685 status = migrate_query_status(from);
686 g_assert(!strcmp(status, "setup") || !(strcmp(status, "failed")));
687 failed = !strcmp(status, "failed");
688 g_free(status);
689 } while (!failed);
690
691 /* Is the machine currently running? */
692 rsp_return = wait_command(from, "{ 'execute': 'query-status' }");
693 g_assert(qdict_haskey(rsp_return, "running"));
694 g_assert(qdict_get_bool(rsp_return, "running"));
695 qobject_unref(rsp_return);
696
697 test_migrate_end(from, to, false);
698 }
699
700 static void test_precopy_unix(void)
701 {
702 char *uri = g_strdup_printf("unix:%s/migsocket", tmpfs);
703 QTestState *from, *to;
704
705 if (test_migrate_start(&from, &to, uri, false)) {
706 return;
707 }
708
709 /* We want to pick a speed slow enough that the test completes
710 * quickly, but that it doesn't complete precopy even on a slow
711 * machine, so also set the downtime.
712 */
713 /* 1 ms should make it not converge*/
714 migrate_set_parameter(from, "downtime-limit", 1);
715 /* 1GB/s */
716 migrate_set_parameter(from, "max-bandwidth", 1000000000);
717
718 /* Wait for the first serial output from the source */
719 wait_for_serial("src_serial");
720
721 migrate(from, uri, "{}");
722
723 wait_for_migration_pass(from);
724
725 /* 300 ms should converge */
726 migrate_set_parameter(from, "downtime-limit", 300);
727
728 if (!got_stop) {
729 qtest_qmp_eventwait(from, "STOP");
730 }
731
732 qtest_qmp_eventwait(to, "RESUME");
733
734 wait_for_serial("dest_serial");
735 wait_for_migration_complete(from);
736
737 test_migrate_end(from, to, true);
738 g_free(uri);
739 }
740
741 int main(int argc, char **argv)
742 {
743 char template[] = "/tmp/migration-test-XXXXXX";
744 int ret;
745
746 g_test_init(&argc, &argv, NULL);
747
748 if (!ufd_version_check()) {
749 return 0;
750 }
751
752 /*
753 * On ppc64, the test only works with kvm-hv, but not with kvm-pr and TCG
754 * is touchy due to race conditions on dirty bits (especially on PPC for
755 * some reason)
756 */
757 if (g_str_equal(qtest_get_arch(), "ppc64") &&
758 access("/sys/module/kvm_hv", F_OK)) {
759 g_test_message("Skipping test: kvm_hv not available");
760 return 0;
761 }
762
763 tmpfs = mkdtemp(template);
764 if (!tmpfs) {
765 g_test_message("mkdtemp on path (%s): %s\n", template, strerror(errno));
766 }
767 g_assert(tmpfs);
768
769 module_call_init(MODULE_INIT_QOM);
770
771 qtest_add_func("/migration/postcopy/unix", test_postcopy);
772 qtest_add_func("/migration/postcopy/recovery", test_postcopy_recovery);
773 qtest_add_func("/migration/deprecated", test_deprecated);
774 qtest_add_func("/migration/bad_dest", test_baddest);
775 qtest_add_func("/migration/precopy/unix", test_precopy_unix);
776
777 ret = g_test_run();
778
779 g_assert_cmpint(ret, ==, 0);
780
781 ret = rmdir(tmpfs);
782 if (ret != 0) {
783 g_test_message("unable to rmdir: path (%s): %s\n",
784 tmpfs, strerror(errno));
785 }
786
787 return ret;
788 }