1 /* Create a "/hello" file on /dev/sda1. */
9 main (int argc, char *argv[])
13 if (argc != 2 || access (argv[1], F_OK) != 0) {
14 fprintf (stderr, "Usage: hello disk-image\n");
18 if (!(g = guestfs_create ())) exit (1);
20 guestfs_set_verbose (g, 1);
21 if (guestfs_add_drive (g, argv[1]) == -1) exit (1);
23 if (guestfs_launch (g) == -1) exit (1);
24 if (guestfs_wait_ready (g) == -1) exit (1);
26 if (guestfs_mount (g, "/dev/sda1", "/") == -1) exit (1);
28 if (guestfs_touch (g, "/hello") == -1) exit (1);