Generated code for 'sh' and 'sh-lines' commands.
[libguestfs.git] / capitests / tests.c
index 959d09b..e5466b5 100644 (file)
 static guestfs_h *g;
 static int suppress_error = 0;
 
-/* This will be 's' or 'h' depending on whether the guest kernel
- * names IDE devices /dev/sd* or /dev/hd*.
- */
-static char devchar = 's';
-
 static void print_error (guestfs_h *g, void *data, const char *msg)
 {
   if (!suppress_error)
@@ -94,6 +89,7 @@ static void no_test_warnings (void)
   fprintf (stderr, "warning: \"guestfs_kill_subprocess\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_add_drive\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_add_cdrom\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_add_drive_ro\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_config\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_qemu\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_get_qemu\" has no tests\n");
@@ -152,6 +148,218 @@ static void no_test_warnings (void)
   fprintf (stderr, "warning: \"guestfs_vg_activate\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_resize2fs\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_e2fsck_f\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_sh\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_sh_lines\" has no tests\n");
+}
+
+static int test_ntfs_3g_probe_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("SKIP_TEST_NTFS_3G_PROBE_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_NTFS_3G_PROBE");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_ntfs_3g_probe_0 (void)
+{
+  if (test_ntfs_3g_probe_0_skip ()) {
+    printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_ntfs_3g_probe_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_ntfs_3g_probe_0 */
+  {
+    char device[] = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputInt for ntfs_3g_probe (0) */
+  {
+    char device[] = "/dev/sda";
+    char lines_0[] = ",";
+    char *lines[] = {
+      lines_0,
+      NULL
+    };
+    int r;
+    suppress_error = 0;
+    r = guestfs_sfdisk (g, device, 0, 0, 0, lines);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char fstype[] = "ntfs";
+    char device[] = "/dev/sda1";
+    int r;
+    suppress_error = 0;
+    r = guestfs_mkfs (g, fstype, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char device[] = "/dev/sda1";
+    int r;
+    suppress_error = 0;
+    r = guestfs_ntfs_3g_probe (g, 1, device);
+    if (r == -1)
+      return -1;
+    if (r != 0) {
+      fprintf (stderr, "test_ntfs_3g_probe_0: expected 0 but got %d\n",               (int) r);
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_ntfs_3g_probe_1_skip (void)
+{
+  const char *str;
+
+  str = getenv ("SKIP_TEST_NTFS_3G_PROBE_1");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_NTFS_3G_PROBE");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_ntfs_3g_probe_1 (void)
+{
+  if (test_ntfs_3g_probe_1_skip ()) {
+    printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_ntfs_3g_probe_1");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_ntfs_3g_probe_1 */
+  {
+    char device[] = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputInt for ntfs_3g_probe (1) */
+  {
+    char device[] = "/dev/sda";
+    char lines_0[] = ",";
+    char *lines[] = {
+      lines_0,
+      NULL
+    };
+    int r;
+    suppress_error = 0;
+    r = guestfs_sfdisk (g, device, 0, 0, 0, lines);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char fstype[] = "ext2";
+    char device[] = "/dev/sda1";
+    int r;
+    suppress_error = 0;
+    r = guestfs_mkfs (g, fstype, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char device[] = "/dev/sda1";
+    int r;
+    suppress_error = 0;
+    r = guestfs_ntfs_3g_probe (g, 1, device);
+    if (r == -1)
+      return -1;
+    if (r != 12) {
+      fprintf (stderr, "test_ntfs_3g_probe_1: expected 12 but got %d\n",               (int) r);
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_sleep_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("SKIP_TEST_SLEEP_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_SLEEP");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_sleep_0 (void)
+{
+  if (test_sleep_0_skip ()) {
+    printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_sleep_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_sleep_0 */
+  {
+    char device[] = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestRun for sleep (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_sleep (g, 1);
+    if (r == -1)
+      return -1;
+  }
+  return 0;
 }
 
 static int test_find_0_skip (void)
@@ -175,7 +383,6 @@ static int test_find_0 (void)
   /* InitBasicFS for test_find_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -198,7 +405,6 @@ static int test_find_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -213,7 +419,6 @@ static int test_find_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -222,7 +427,6 @@ static int test_find_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -284,7 +488,6 @@ static int test_find_1 (void)
   /* InitBasicFS for test_find_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -307,7 +510,6 @@ static int test_find_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -322,7 +524,6 @@ static int test_find_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -331,7 +532,6 @@ static int test_find_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -453,7 +653,6 @@ static int test_find_2 (void)
   /* InitBasicFS for test_find_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -476,7 +675,6 @@ static int test_find_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -491,7 +689,6 @@ static int test_find_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -500,7 +697,6 @@ static int test_find_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -590,7 +786,6 @@ static int test_lvresize_0 (void)
   /* InitNone|InitEmpty for test_lvresize_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -615,7 +810,6 @@ static int test_lvresize_0 (void)
   char expected[] = "test content";
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -629,7 +823,6 @@ static int test_lvresize_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -639,7 +832,6 @@ static int test_lvresize_0 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -764,7 +956,6 @@ static int test_zerofree_0 (void)
   /* InitNone|InitEmpty for test_zerofree_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -789,7 +980,6 @@ static int test_zerofree_0 (void)
   char expected[] = "test file";
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -804,7 +994,6 @@ static int test_zerofree_0 (void)
   {
     char fstype[] = "ext3";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -813,7 +1002,6 @@ static int test_zerofree_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -832,7 +1020,6 @@ static int test_zerofree_0 (void)
   }
   {
     char pathordevice[] = "/dev/sda1";
-    pathordevice[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_umount (g, pathordevice);
@@ -841,7 +1028,6 @@ static int test_zerofree_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_zerofree (g, device);
@@ -850,7 +1036,6 @@ static int test_zerofree_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -895,7 +1080,6 @@ static int test_hexdump_0 (void)
   /* InitBasicFS for test_hexdump_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -918,7 +1102,6 @@ static int test_hexdump_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -933,7 +1116,6 @@ static int test_hexdump_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -942,7 +1124,6 @@ static int test_hexdump_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -998,7 +1179,6 @@ static int test_strings_e_0 (void)
   /* InitBasicFS for test_strings_e_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1021,7 +1201,6 @@ static int test_strings_e_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1036,7 +1215,6 @@ static int test_strings_e_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1045,7 +1223,6 @@ static int test_strings_e_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -1127,7 +1304,6 @@ static int test_strings_0 (void)
   /* InitBasicFS for test_strings_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1150,7 +1326,6 @@ static int test_strings_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1165,7 +1340,6 @@ static int test_strings_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1174,7 +1348,6 @@ static int test_strings_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -1257,7 +1430,6 @@ static int test_strings_1 (void)
   /* InitBasicFS for test_strings_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1280,7 +1452,6 @@ static int test_strings_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1295,7 +1466,6 @@ static int test_strings_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1304,7 +1474,6 @@ static int test_strings_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -1362,7 +1531,6 @@ static int test_equal_0 (void)
   /* InitBasicFS for test_equal_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1385,7 +1553,6 @@ static int test_equal_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1400,7 +1567,6 @@ static int test_equal_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1409,7 +1575,6 @@ static int test_equal_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -1473,7 +1638,6 @@ static int test_equal_1 (void)
   /* InitBasicFS for test_equal_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1496,7 +1660,6 @@ static int test_equal_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1511,7 +1674,6 @@ static int test_equal_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1520,7 +1682,6 @@ static int test_equal_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -1584,7 +1745,6 @@ static int test_equal_2 (void)
   /* InitBasicFS for test_equal_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1607,7 +1767,6 @@ static int test_equal_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1622,7 +1781,6 @@ static int test_equal_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1631,7 +1789,6 @@ static int test_equal_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -1673,7 +1830,6 @@ static int test_ping_daemon_0 (void)
   /* InitNone|InitEmpty for test_ping_daemon_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1726,7 +1882,6 @@ static int test_dmesg_0 (void)
   /* InitNone|InitEmpty for test_dmesg_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1780,7 +1935,6 @@ static int test_drop_caches_0 (void)
   /* InitNone|InitEmpty for test_drop_caches_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1833,7 +1987,6 @@ static int test_mv_0 (void)
   /* InitBasicFS for test_mv_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1856,7 +2009,6 @@ static int test_mv_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1871,7 +2023,6 @@ static int test_mv_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1880,7 +2031,6 @@ static int test_mv_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -1945,7 +2095,6 @@ static int test_mv_1 (void)
   /* InitBasicFS for test_mv_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -1968,7 +2117,6 @@ static int test_mv_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -1983,7 +2131,6 @@ static int test_mv_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -1992,7 +2139,6 @@ static int test_mv_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2055,7 +2201,6 @@ static int test_cp_a_0 (void)
   /* InitBasicFS for test_cp_a_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2078,7 +2223,6 @@ static int test_cp_a_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2093,7 +2237,6 @@ static int test_cp_a_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2102,7 +2245,6 @@ static int test_cp_a_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2183,7 +2325,6 @@ static int test_cp_0 (void)
   /* InitBasicFS for test_cp_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2206,7 +2347,6 @@ static int test_cp_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2221,7 +2361,6 @@ static int test_cp_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2230,7 +2369,6 @@ static int test_cp_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2295,7 +2433,6 @@ static int test_cp_1 (void)
   /* InitBasicFS for test_cp_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2318,7 +2455,6 @@ static int test_cp_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2333,7 +2469,6 @@ static int test_cp_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2342,7 +2477,6 @@ static int test_cp_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2405,7 +2539,6 @@ static int test_cp_2 (void)
   /* InitBasicFS for test_cp_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2428,7 +2561,6 @@ static int test_cp_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2443,7 +2575,6 @@ static int test_cp_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2452,7 +2583,6 @@ static int test_cp_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2525,7 +2655,6 @@ static int test_grub_install_0 (void)
   /* InitBasicFS for test_grub_install_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2548,7 +2677,6 @@ static int test_grub_install_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2563,7 +2691,6 @@ static int test_grub_install_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2572,7 +2699,6 @@ static int test_grub_install_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2584,7 +2710,6 @@ static int test_grub_install_0 (void)
   {
     char root[] = "/";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_grub_install (g, root, device);
@@ -2627,7 +2752,6 @@ static int test_zero_0 (void)
   /* InitBasicFS for test_zero_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2650,7 +2774,6 @@ static int test_zero_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2665,7 +2788,6 @@ static int test_zero_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2674,7 +2796,6 @@ static int test_zero_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2686,7 +2807,6 @@ static int test_zero_0 (void)
   char expected[] = "data";
   {
     char pathordevice[] = "/dev/sda1";
-    pathordevice[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_umount (g, pathordevice);
@@ -2695,7 +2815,6 @@ static int test_zero_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_zero (g, device);
@@ -2704,7 +2823,6 @@ static int test_zero_0 (void)
   }
   {
     char path[] = "/dev/sda1";
-    path[5] = devchar;
     char *r;
     suppress_error = 0;
     r = guestfs_file (g, path);
@@ -2740,7 +2858,6 @@ static int test_fsck_0 (void)
   /* InitBasicFS for test_fsck_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2763,7 +2880,6 @@ static int test_fsck_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2778,7 +2894,6 @@ static int test_fsck_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2787,7 +2902,6 @@ static int test_fsck_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2798,7 +2912,6 @@ static int test_fsck_0 (void)
   /* TestOutputInt for fsck (0) */
   {
     char pathordevice[] = "/dev/sda1";
-    pathordevice[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_umount (g, pathordevice);
@@ -2808,7 +2921,6 @@ static int test_fsck_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_fsck (g, fstype, device);
@@ -2843,7 +2955,6 @@ static int test_fsck_1 (void)
   /* InitBasicFS for test_fsck_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2866,7 +2977,6 @@ static int test_fsck_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2881,7 +2991,6 @@ static int test_fsck_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -2890,7 +2999,6 @@ static int test_fsck_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -2901,7 +3009,6 @@ static int test_fsck_1 (void)
   /* TestOutputInt for fsck (1) */
   {
     char pathordevice[] = "/dev/sda1";
-    pathordevice[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_umount (g, pathordevice);
@@ -2910,7 +3017,6 @@ static int test_fsck_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_zero (g, device);
@@ -2920,7 +3026,6 @@ static int test_fsck_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_fsck (g, fstype, device);
@@ -2955,7 +3060,6 @@ static int test_set_e2uuid_0 (void)
   /* InitBasicFS for test_set_e2uuid_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -2978,7 +3082,6 @@ static int test_set_e2uuid_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -2993,7 +3096,6 @@ static int test_set_e2uuid_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -3002,7 +3104,6 @@ static int test_set_e2uuid_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -3014,7 +3115,6 @@ static int test_set_e2uuid_0 (void)
   char expected[] = "a3a61220-882b-4f61-89f4-cf24dcc7297d";
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char uuid[] = "a3a61220-882b-4f61-89f4-cf24dcc7297d";
     int r;
     suppress_error = 0;
@@ -3024,7 +3124,6 @@ static int test_set_e2uuid_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char *r;
     suppress_error = 0;
     r = guestfs_get_e2uuid (g, device);
@@ -3060,7 +3159,6 @@ static int test_set_e2uuid_1 (void)
   /* InitBasicFS for test_set_e2uuid_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3083,7 +3181,6 @@ static int test_set_e2uuid_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3098,7 +3195,6 @@ static int test_set_e2uuid_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -3107,7 +3203,6 @@ static int test_set_e2uuid_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -3119,7 +3214,6 @@ static int test_set_e2uuid_1 (void)
   char expected[] = "";
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char uuid[] = "clear";
     int r;
     suppress_error = 0;
@@ -3129,7 +3223,6 @@ static int test_set_e2uuid_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char *r;
     suppress_error = 0;
     r = guestfs_get_e2uuid (g, device);
@@ -3165,7 +3258,6 @@ static int test_set_e2uuid_2 (void)
   /* InitBasicFS for test_set_e2uuid_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3188,7 +3280,6 @@ static int test_set_e2uuid_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3203,7 +3294,6 @@ static int test_set_e2uuid_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -3212,7 +3302,6 @@ static int test_set_e2uuid_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -3223,7 +3312,6 @@ static int test_set_e2uuid_2 (void)
   /* TestRun for set_e2uuid (2) */
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char uuid[] = "random";
     int r;
     suppress_error = 0;
@@ -3255,7 +3343,6 @@ static int test_set_e2uuid_3 (void)
   /* InitBasicFS for test_set_e2uuid_3: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3278,7 +3365,6 @@ static int test_set_e2uuid_3 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3293,7 +3379,6 @@ static int test_set_e2uuid_3 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -3302,7 +3387,6 @@ static int test_set_e2uuid_3 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -3313,7 +3397,6 @@ static int test_set_e2uuid_3 (void)
   /* TestRun for set_e2uuid (3) */
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char uuid[] = "time";
     int r;
     suppress_error = 0;
@@ -3345,7 +3428,6 @@ static int test_set_e2label_0 (void)
   /* InitBasicFS for test_set_e2label_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3368,7 +3450,6 @@ static int test_set_e2label_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3383,7 +3464,6 @@ static int test_set_e2label_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -3392,7 +3472,6 @@ static int test_set_e2label_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -3404,7 +3483,6 @@ static int test_set_e2label_0 (void)
   char expected[] = "testlabel";
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char label[] = "testlabel";
     int r;
     suppress_error = 0;
@@ -3414,7 +3492,6 @@ static int test_set_e2label_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char *r;
     suppress_error = 0;
     r = guestfs_get_e2label (g, device);
@@ -3450,7 +3527,6 @@ static int test_pvremove_0 (void)
   /* InitNone|InitEmpty for test_pvremove_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3471,10 +3547,9 @@ static int test_pvremove_0 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for pvremove (0) */
+  /* TestOutputListOfDevices for pvremove (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3488,7 +3563,6 @@ static int test_pvremove_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -3498,7 +3572,6 @@ static int test_pvremove_0 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -3537,7 +3610,6 @@ static int test_pvremove_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvremove (g, device);
@@ -3584,7 +3656,6 @@ static int test_pvremove_1 (void)
   /* InitNone|InitEmpty for test_pvremove_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3605,10 +3676,9 @@ static int test_pvremove_1 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for pvremove (1) */
+  /* TestOutputListOfDevices for pvremove (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3622,7 +3692,6 @@ static int test_pvremove_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -3632,7 +3701,6 @@ static int test_pvremove_1 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -3671,7 +3739,6 @@ static int test_pvremove_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvremove (g, device);
@@ -3718,7 +3785,6 @@ static int test_pvremove_2 (void)
   /* InitNone|InitEmpty for test_pvremove_2 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3739,10 +3805,9 @@ static int test_pvremove_2 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for pvremove (2) */
+  /* TestOutputListOfDevices for pvremove (2) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3756,7 +3821,6 @@ static int test_pvremove_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -3766,7 +3830,6 @@ static int test_pvremove_2 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -3805,7 +3868,6 @@ static int test_pvremove_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvremove (g, device);
@@ -3852,7 +3914,6 @@ static int test_vgremove_0 (void)
   /* InitNone|InitEmpty for test_vgremove_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -3876,7 +3937,6 @@ static int test_vgremove_0 (void)
   /* TestOutputList for vgremove (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -3890,7 +3950,6 @@ static int test_vgremove_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -3900,7 +3959,6 @@ static int test_vgremove_0 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -3977,7 +4035,6 @@ static int test_vgremove_1 (void)
   /* InitNone|InitEmpty for test_vgremove_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4001,7 +4058,6 @@ static int test_vgremove_1 (void)
   /* TestOutputList for vgremove (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4015,7 +4071,6 @@ static int test_vgremove_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -4025,7 +4080,6 @@ static int test_vgremove_1 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -4102,7 +4156,6 @@ static int test_lvremove_0 (void)
   /* InitNone|InitEmpty for test_lvremove_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4126,7 +4179,6 @@ static int test_lvremove_0 (void)
   /* TestOutputList for lvremove (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4140,7 +4192,6 @@ static int test_lvremove_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -4150,7 +4201,6 @@ static int test_lvremove_0 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -4239,7 +4289,6 @@ static int test_lvremove_1 (void)
   /* InitNone|InitEmpty for test_lvremove_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4263,7 +4312,6 @@ static int test_lvremove_1 (void)
   /* TestOutputList for lvremove (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4277,7 +4325,6 @@ static int test_lvremove_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -4287,7 +4334,6 @@ static int test_lvremove_1 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -4364,7 +4410,6 @@ static int test_lvremove_2 (void)
   /* InitNone|InitEmpty for test_lvremove_2 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4388,7 +4433,6 @@ static int test_lvremove_2 (void)
   /* TestOutputList for lvremove (2) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4402,7 +4446,6 @@ static int test_lvremove_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -4412,7 +4455,6 @@ static int test_lvremove_2 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -4501,7 +4543,6 @@ static int test_mount_ro_0 (void)
   /* InitBasicFS for test_mount_ro_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4524,7 +4565,6 @@ static int test_mount_ro_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4539,7 +4579,6 @@ static int test_mount_ro_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -4548,7 +4587,6 @@ static int test_mount_ro_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -4567,7 +4605,6 @@ static int test_mount_ro_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -4607,7 +4644,6 @@ static int test_mount_ro_1 (void)
   /* InitBasicFS for test_mount_ro_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4630,7 +4666,6 @@ static int test_mount_ro_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4645,7 +4680,6 @@ static int test_mount_ro_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -4654,7 +4688,6 @@ static int test_mount_ro_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -4683,7 +4716,6 @@ static int test_mount_ro_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -4728,7 +4760,6 @@ static int test_tgz_in_0 (void)
   /* InitBasicFS for test_tgz_in_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4751,7 +4782,6 @@ static int test_tgz_in_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4766,7 +4796,6 @@ static int test_tgz_in_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -4775,7 +4804,6 @@ static int test_tgz_in_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -4830,7 +4858,6 @@ static int test_tar_in_0 (void)
   /* InitBasicFS for test_tar_in_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4853,7 +4880,6 @@ static int test_tar_in_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4868,7 +4894,6 @@ static int test_tar_in_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -4877,7 +4902,6 @@ static int test_tar_in_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -4932,7 +4956,6 @@ static int test_checksum_0 (void)
   /* InitBasicFS for test_checksum_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -4955,7 +4978,6 @@ static int test_checksum_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -4970,7 +4992,6 @@ static int test_checksum_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -4979,7 +5000,6 @@ static int test_checksum_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5036,7 +5056,6 @@ static int test_checksum_1 (void)
   /* InitBasicFS for test_checksum_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5059,7 +5078,6 @@ static int test_checksum_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5074,7 +5092,6 @@ static int test_checksum_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5083,7 +5100,6 @@ static int test_checksum_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5126,7 +5142,6 @@ static int test_checksum_2 (void)
   /* InitBasicFS for test_checksum_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5149,7 +5164,6 @@ static int test_checksum_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5164,7 +5178,6 @@ static int test_checksum_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5173,7 +5186,6 @@ static int test_checksum_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5230,7 +5242,6 @@ static int test_checksum_3 (void)
   /* InitBasicFS for test_checksum_3: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5253,7 +5264,6 @@ static int test_checksum_3 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5268,7 +5278,6 @@ static int test_checksum_3 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5277,7 +5286,6 @@ static int test_checksum_3 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5334,7 +5342,6 @@ static int test_checksum_4 (void)
   /* InitBasicFS for test_checksum_4: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5357,7 +5364,6 @@ static int test_checksum_4 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5372,7 +5378,6 @@ static int test_checksum_4 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5381,7 +5386,6 @@ static int test_checksum_4 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5438,7 +5442,6 @@ static int test_checksum_5 (void)
   /* InitBasicFS for test_checksum_5: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5461,7 +5464,6 @@ static int test_checksum_5 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5476,7 +5478,6 @@ static int test_checksum_5 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5485,7 +5486,6 @@ static int test_checksum_5 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5542,7 +5542,6 @@ static int test_checksum_6 (void)
   /* InitBasicFS for test_checksum_6: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5565,7 +5564,6 @@ static int test_checksum_6 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5580,7 +5578,6 @@ static int test_checksum_6 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5589,7 +5586,6 @@ static int test_checksum_6 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5646,7 +5642,6 @@ static int test_checksum_7 (void)
   /* InitBasicFS for test_checksum_7: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5669,7 +5664,6 @@ static int test_checksum_7 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5684,7 +5678,6 @@ static int test_checksum_7 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5693,7 +5686,6 @@ static int test_checksum_7 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5729,6 +5721,108 @@ static int test_checksum_7 (void)
   return 0;
 }
 
+static int test_checksum_8_skip (void)
+{
+  const char *str;
+
+  str = getenv ("SKIP_TEST_CHECKSUM_8");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_CHECKSUM");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_checksum_8 (void)
+{
+  if (test_checksum_8_skip ()) {
+    printf ("%s skipped (reason: SKIP_TEST_* variable set)\n", "test_checksum_8");
+    return 0;
+  }
+
+  /* InitBasicFS for test_checksum_8: create ext2 on /dev/sda1 */
+  {
+    char device[] = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char device[] = "/dev/sda";
+    char lines_0[] = ",";
+    char *lines[] = {
+      lines_0,
+      NULL
+    };
+    int r;
+    suppress_error = 0;
+    r = guestfs_sfdisk (g, device, 0, 0, 0, lines);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char fstype[] = "ext2";
+    char device[] = "/dev/sda1";
+    int r;
+    suppress_error = 0;
+    r = guestfs_mkfs (g, fstype, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char device[] = "/dev/sda1";
+    char mountpoint[] = "/";
+    int r;
+    suppress_error = 0;
+    r = guestfs_mount (g, device, mountpoint);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutput for checksum (8) */
+  char expected[] = "46d6ca27ee07cdc6fa99c2e138cc522c";
+  {
+    char options[] = "ro";
+    char vfstype[] = "squashfs";
+    char device[] = "/dev/sdd";
+    char mountpoint[] = "/";
+    int r;
+    suppress_error = 0;
+    r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint);
+    if (r == -1)
+      return -1;
+  }
+  {
+    char csumtype[] = "md5";
+    char path[] = "/known-3";
+    char *r;
+    suppress_error = 0;
+    r = guestfs_checksum (g, csumtype, path);
+    if (r == NULL)
+      return -1;
+    if (strcmp (r, expected) != 0) {
+      fprintf (stderr, "test_checksum_8: expected \"%s\" but got \"%s\"\n", expected, r);
+      return -1;
+    }
+    free (r);
+  }
+  return 0;
+}
+
 static int test_download_0_skip (void)
 {
   const char *str;
@@ -5750,7 +5844,6 @@ static int test_download_0 (void)
   /* InitBasicFS for test_download_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5773,7 +5866,6 @@ static int test_download_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5788,7 +5880,6 @@ static int test_download_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5797,7 +5888,6 @@ static int test_download_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5869,7 +5959,6 @@ static int test_upload_0 (void)
   /* InitBasicFS for test_upload_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5892,7 +5981,6 @@ static int test_upload_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -5907,7 +5995,6 @@ static int test_upload_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -5916,7 +6003,6 @@ static int test_upload_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -5972,7 +6058,6 @@ static int test_blockdev_rereadpt_0 (void)
   /* InitNone|InitEmpty for test_blockdev_rereadpt_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -5996,7 +6081,6 @@ static int test_blockdev_rereadpt_0 (void)
   /* TestRun for blockdev_rereadpt (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_rereadpt (g, device);
@@ -6027,7 +6111,6 @@ static int test_blockdev_flushbufs_0 (void)
   /* InitNone|InitEmpty for test_blockdev_flushbufs_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6051,7 +6134,6 @@ static int test_blockdev_flushbufs_0 (void)
   /* TestRun for blockdev_flushbufs (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_flushbufs (g, device);
@@ -6082,7 +6164,6 @@ static int test_blockdev_getsize64_0 (void)
   /* InitNone|InitEmpty for test_blockdev_getsize64_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6106,7 +6187,6 @@ static int test_blockdev_getsize64_0 (void)
   /* TestOutputInt for blockdev_getsize64 (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int64_t r;
     suppress_error = 0;
     r = guestfs_blockdev_getsize64 (g, device);
@@ -6141,7 +6221,6 @@ static int test_blockdev_getsz_0 (void)
   /* InitNone|InitEmpty for test_blockdev_getsz_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6165,7 +6244,6 @@ static int test_blockdev_getsz_0 (void)
   /* TestOutputInt for blockdev_getsz (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int64_t r;
     suppress_error = 0;
     r = guestfs_blockdev_getsz (g, device);
@@ -6200,7 +6278,6 @@ static int test_blockdev_getbsz_0 (void)
   /* InitNone|InitEmpty for test_blockdev_getbsz_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6224,7 +6301,6 @@ static int test_blockdev_getbsz_0 (void)
   /* TestOutputInt for blockdev_getbsz (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_getbsz (g, device);
@@ -6259,7 +6335,6 @@ static int test_blockdev_getss_0 (void)
   /* InitNone|InitEmpty for test_blockdev_getss_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6283,7 +6358,6 @@ static int test_blockdev_getss_0 (void)
   /* TestOutputInt for blockdev_getss (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_getss (g, device);
@@ -6318,7 +6392,6 @@ static int test_blockdev_getro_0 (void)
   /* InitNone|InitEmpty for test_blockdev_getro_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6342,7 +6415,6 @@ static int test_blockdev_getro_0 (void)
   /* TestOutputTrue for blockdev_getro (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setro (g, device);
@@ -6351,7 +6423,6 @@ static int test_blockdev_getro_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_getro (g, device);
@@ -6386,7 +6457,6 @@ static int test_blockdev_setrw_0 (void)
   /* InitNone|InitEmpty for test_blockdev_setrw_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6410,7 +6480,6 @@ static int test_blockdev_setrw_0 (void)
   /* TestOutputFalse for blockdev_setrw (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6419,7 +6488,6 @@ static int test_blockdev_setrw_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_getro (g, device);
@@ -6454,7 +6522,6 @@ static int test_blockdev_setro_0 (void)
   /* InitNone|InitEmpty for test_blockdev_setro_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6478,7 +6545,6 @@ static int test_blockdev_setro_0 (void)
   /* TestOutputTrue for blockdev_setro (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setro (g, device);
@@ -6487,7 +6553,6 @@ static int test_blockdev_setro_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_getro (g, device);
@@ -6522,7 +6587,6 @@ static int test_statvfs_0 (void)
   /* InitBasicFS for test_statvfs_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6545,7 +6609,6 @@ static int test_statvfs_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -6560,7 +6623,6 @@ static int test_statvfs_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -6569,7 +6631,6 @@ static int test_statvfs_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -6626,7 +6687,6 @@ static int test_lstat_0 (void)
   /* InitBasicFS for test_lstat_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6649,7 +6709,6 @@ static int test_lstat_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -6664,7 +6723,6 @@ static int test_lstat_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -6673,7 +6731,6 @@ static int test_lstat_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -6728,7 +6785,6 @@ static int test_stat_0 (void)
   /* InitBasicFS for test_stat_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6751,7 +6807,6 @@ static int test_stat_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -6766,7 +6821,6 @@ static int test_stat_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -6775,7 +6829,6 @@ static int test_stat_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -6830,7 +6883,6 @@ static int test_command_lines_0 (void)
   /* InitBasicFS for test_command_lines_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6853,7 +6905,6 @@ static int test_command_lines_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -6868,7 +6919,6 @@ static int test_command_lines_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -6877,7 +6927,6 @@ static int test_command_lines_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -6961,7 +7010,6 @@ static int test_command_lines_1 (void)
   /* InitBasicFS for test_command_lines_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -6984,7 +7032,6 @@ static int test_command_lines_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -6999,7 +7046,6 @@ static int test_command_lines_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7008,7 +7054,6 @@ static int test_command_lines_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -7092,7 +7137,6 @@ static int test_command_lines_2 (void)
   /* InitBasicFS for test_command_lines_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -7115,7 +7159,6 @@ static int test_command_lines_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -7130,7 +7173,6 @@ static int test_command_lines_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7139,7 +7181,6 @@ static int test_command_lines_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -7235,7 +7276,6 @@ static int test_command_lines_3 (void)
   /* InitBasicFS for test_command_lines_3: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -7258,7 +7298,6 @@ static int test_command_lines_3 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -7273,7 +7312,6 @@ static int test_command_lines_3 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7282,7 +7320,6 @@ static int test_command_lines_3 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -7378,7 +7415,6 @@ static int test_command_lines_4 (void)
   /* InitBasicFS for test_command_lines_4: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -7401,7 +7437,6 @@ static int test_command_lines_4 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -7416,7 +7451,6 @@ static int test_command_lines_4 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7425,7 +7459,6 @@ static int test_command_lines_4 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -7533,7 +7566,6 @@ static int test_command_lines_5 (void)
   /* InitBasicFS for test_command_lines_5: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -7556,7 +7588,6 @@ static int test_command_lines_5 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -7571,7 +7602,6 @@ static int test_command_lines_5 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7580,7 +7610,6 @@ static int test_command_lines_5 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -7700,7 +7729,6 @@ static int test_command_lines_6 (void)
   /* InitBasicFS for test_command_lines_6: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -7723,7 +7751,6 @@ static int test_command_lines_6 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -7738,7 +7765,6 @@ static int test_command_lines_6 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7747,7 +7773,6 @@ static int test_command_lines_6 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -7819,7 +7844,6 @@ static int test_command_lines_7 (void)
   /* InitBasicFS for test_command_lines_7: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -7842,7 +7866,6 @@ static int test_command_lines_7 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -7857,7 +7880,6 @@ static int test_command_lines_7 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7866,7 +7888,6 @@ static int test_command_lines_7 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -7950,7 +7971,6 @@ static int test_command_lines_8 (void)
   /* InitBasicFS for test_command_lines_8: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -7973,7 +7993,6 @@ static int test_command_lines_8 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -7988,7 +8007,6 @@ static int test_command_lines_8 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -7997,7 +8015,6 @@ static int test_command_lines_8 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8093,7 +8110,6 @@ static int test_command_lines_9 (void)
   /* InitBasicFS for test_command_lines_9: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8116,7 +8132,6 @@ static int test_command_lines_9 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8131,7 +8146,6 @@ static int test_command_lines_9 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -8140,7 +8154,6 @@ static int test_command_lines_9 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8236,7 +8249,6 @@ static int test_command_lines_10 (void)
   /* InitBasicFS for test_command_lines_10: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8259,7 +8271,6 @@ static int test_command_lines_10 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8274,7 +8285,6 @@ static int test_command_lines_10 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -8283,7 +8293,6 @@ static int test_command_lines_10 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8379,7 +8388,6 @@ static int test_command_0 (void)
   /* InitBasicFS for test_command_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8402,7 +8410,6 @@ static int test_command_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8417,7 +8424,6 @@ static int test_command_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -8426,7 +8432,6 @@ static int test_command_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8495,7 +8500,6 @@ static int test_command_1 (void)
   /* InitBasicFS for test_command_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8518,7 +8522,6 @@ static int test_command_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8533,7 +8536,6 @@ static int test_command_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -8542,7 +8544,6 @@ static int test_command_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8611,7 +8612,6 @@ static int test_command_2 (void)
   /* InitBasicFS for test_command_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8634,7 +8634,6 @@ static int test_command_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8649,7 +8648,6 @@ static int test_command_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -8658,7 +8656,6 @@ static int test_command_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8727,7 +8724,6 @@ static int test_command_3 (void)
   /* InitBasicFS for test_command_3: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8750,7 +8746,6 @@ static int test_command_3 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8765,7 +8760,6 @@ static int test_command_3 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -8774,7 +8768,6 @@ static int test_command_3 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8843,7 +8836,6 @@ static int test_command_4 (void)
   /* InitBasicFS for test_command_4: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8866,7 +8858,6 @@ static int test_command_4 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8881,7 +8872,6 @@ static int test_command_4 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -8890,7 +8880,6 @@ static int test_command_4 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -8959,7 +8948,6 @@ static int test_command_5 (void)
   /* InitBasicFS for test_command_5: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -8982,7 +8970,6 @@ static int test_command_5 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -8997,7 +8984,6 @@ static int test_command_5 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9006,7 +8992,6 @@ static int test_command_5 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9075,7 +9060,6 @@ static int test_command_6 (void)
   /* InitBasicFS for test_command_6: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9098,7 +9082,6 @@ static int test_command_6 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9113,7 +9096,6 @@ static int test_command_6 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9122,7 +9104,6 @@ static int test_command_6 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9191,7 +9172,6 @@ static int test_command_7 (void)
   /* InitBasicFS for test_command_7: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9214,7 +9194,6 @@ static int test_command_7 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9229,7 +9208,6 @@ static int test_command_7 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9238,7 +9216,6 @@ static int test_command_7 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9307,7 +9284,6 @@ static int test_command_8 (void)
   /* InitBasicFS for test_command_8: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9330,7 +9306,6 @@ static int test_command_8 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9345,7 +9320,6 @@ static int test_command_8 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9354,7 +9328,6 @@ static int test_command_8 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9423,7 +9396,6 @@ static int test_command_9 (void)
   /* InitBasicFS for test_command_9: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9446,7 +9418,6 @@ static int test_command_9 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9461,7 +9432,6 @@ static int test_command_9 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9470,7 +9440,6 @@ static int test_command_9 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9539,7 +9508,6 @@ static int test_command_10 (void)
   /* InitBasicFS for test_command_10: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9562,7 +9530,6 @@ static int test_command_10 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9577,7 +9544,6 @@ static int test_command_10 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9586,7 +9552,6 @@ static int test_command_10 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9655,7 +9620,6 @@ static int test_command_11 (void)
   /* InitBasicFS for test_command_11: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9678,7 +9642,6 @@ static int test_command_11 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9693,7 +9656,6 @@ static int test_command_11 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9702,7 +9664,6 @@ static int test_command_11 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9764,7 +9725,6 @@ static int test_file_0 (void)
   /* InitBasicFS for test_file_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9787,7 +9747,6 @@ static int test_file_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9802,7 +9761,6 @@ static int test_file_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9811,7 +9769,6 @@ static int test_file_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9866,7 +9823,6 @@ static int test_file_1 (void)
   /* InitBasicFS for test_file_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9889,7 +9845,6 @@ static int test_file_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -9904,7 +9859,6 @@ static int test_file_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -9913,7 +9867,6 @@ static int test_file_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -9969,7 +9922,6 @@ static int test_file_2 (void)
   /* InitBasicFS for test_file_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -9992,7 +9944,6 @@ static int test_file_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10007,7 +9958,6 @@ static int test_file_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10016,7 +9966,6 @@ static int test_file_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10058,7 +10007,6 @@ static int test_umount_all_0 (void)
   /* InitBasicFS for test_umount_all_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10081,7 +10029,6 @@ static int test_umount_all_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10096,7 +10043,6 @@ static int test_umount_all_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10105,7 +10051,6 @@ static int test_umount_all_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10161,7 +10106,6 @@ static int test_umount_all_1 (void)
   /* InitNone|InitEmpty for test_umount_all_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10185,7 +10129,6 @@ static int test_umount_all_1 (void)
   /* TestOutputList for umount_all (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -10204,7 +10147,6 @@ static int test_umount_all_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10214,7 +10156,6 @@ static int test_umount_all_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10224,7 +10165,6 @@ static int test_umount_all_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10233,7 +10173,6 @@ static int test_umount_all_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10251,7 +10190,6 @@ static int test_umount_all_1 (void)
   }
   {
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     char mountpoint[] = "/mp1";
     int r;
     suppress_error = 0;
@@ -10269,7 +10207,6 @@ static int test_umount_all_1 (void)
   }
   {
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     char mountpoint[] = "/mp1/mp2";
     int r;
     suppress_error = 0;
@@ -10332,7 +10269,6 @@ static int test_mounts_0 (void)
   /* InitBasicFS for test_mounts_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10355,7 +10291,6 @@ static int test_mounts_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10370,7 +10305,6 @@ static int test_mounts_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10379,7 +10313,6 @@ static int test_mounts_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10387,7 +10320,7 @@ static int test_mounts_0 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for mounts (0) */
+  /* TestOutputListOfDevices for mounts (0) */
   {
     char **r;
     int i;
@@ -10402,7 +10335,7 @@ static int test_mounts_0 (void)
     }
     {
       char expected[] = "/dev/sda1";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_mounts_0: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -10441,7 +10374,6 @@ static int test_umount_0 (void)
   /* InitNone|InitEmpty for test_umount_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10462,10 +10394,9 @@ static int test_umount_0 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for umount (0) */
+  /* TestOutputListOfDevices for umount (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10480,7 +10411,6 @@ static int test_umount_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10489,7 +10419,6 @@ static int test_umount_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10511,7 +10440,7 @@ static int test_umount_0 (void)
     }
     {
       char expected[] = "/dev/sda1";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_umount_0: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -10550,7 +10479,6 @@ static int test_umount_1 (void)
   /* InitNone|InitEmpty for test_umount_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10574,7 +10502,6 @@ static int test_umount_1 (void)
   /* TestOutputList for umount (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10589,7 +10516,6 @@ static int test_umount_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10598,7 +10524,6 @@ static int test_umount_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10654,7 +10579,6 @@ static int test_write_file_0 (void)
   /* InitBasicFS for test_write_file_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10677,7 +10601,6 @@ static int test_write_file_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10692,7 +10615,6 @@ static int test_write_file_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10701,7 +10623,6 @@ static int test_write_file_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10757,7 +10678,6 @@ static int test_write_file_1 (void)
   /* InitBasicFS for test_write_file_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10780,7 +10700,6 @@ static int test_write_file_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10795,7 +10714,6 @@ static int test_write_file_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10804,7 +10722,6 @@ static int test_write_file_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10860,7 +10777,6 @@ static int test_write_file_2 (void)
   /* InitBasicFS for test_write_file_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10883,7 +10799,6 @@ static int test_write_file_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -10898,7 +10813,6 @@ static int test_write_file_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -10907,7 +10821,6 @@ static int test_write_file_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -10963,7 +10876,6 @@ static int test_write_file_3 (void)
   /* InitBasicFS for test_write_file_3: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -10986,7 +10898,6 @@ static int test_write_file_3 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -11001,7 +10912,6 @@ static int test_write_file_3 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -11010,7 +10920,6 @@ static int test_write_file_3 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -11066,7 +10975,6 @@ static int test_write_file_4 (void)
   /* InitBasicFS for test_write_file_4: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -11089,7 +10997,6 @@ static int test_write_file_4 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -11104,7 +11011,6 @@ static int test_write_file_4 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -11113,7 +11019,6 @@ static int test_write_file_4 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -11169,7 +11074,6 @@ static int test_write_file_5 (void)
   /* InitBasicFS for test_write_file_5: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -11192,7 +11096,6 @@ static int test_write_file_5 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -11207,7 +11110,6 @@ static int test_write_file_5 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -11216,7 +11118,6 @@ static int test_write_file_5 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -11272,7 +11173,6 @@ static int test_mkfs_0 (void)
   /* InitNone|InitEmpty for test_mkfs_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -11297,7 +11197,6 @@ static int test_mkfs_0 (void)
   char expected[] = "new file contents";
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -11312,7 +11211,6 @@ static int test_mkfs_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -11321,7 +11219,6 @@ static int test_mkfs_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -11375,7 +11272,6 @@ static int test_lvcreate_0 (void)
   /* InitNone|InitEmpty for test_lvcreate_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -11399,7 +11295,6 @@ static int test_lvcreate_0 (void)
   /* TestOutputList for lvcreate (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -11417,7 +11312,6 @@ static int test_lvcreate_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11426,7 +11320,6 @@ static int test_lvcreate_0 (void)
   }
   {
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11435,7 +11328,6 @@ static int test_lvcreate_0 (void)
   }
   {
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11445,9 +11337,7 @@ static int test_lvcreate_0 (void)
   {
     char volgroup[] = "VG1";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char physvols_1[] = "/dev/sda2";
-    physvols_1[5] = devchar;
     char *physvols[] = {
       physvols_0,
       physvols_1,
@@ -11462,7 +11352,6 @@ static int test_lvcreate_0 (void)
   {
     char volgroup[] = "VG2";
     char physvols_0[] = "/dev/sda3";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -11618,7 +11507,6 @@ static int test_vgcreate_0 (void)
   /* InitNone|InitEmpty for test_vgcreate_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -11642,7 +11530,6 @@ static int test_vgcreate_0 (void)
   /* TestOutputList for vgcreate (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -11660,7 +11547,6 @@ static int test_vgcreate_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11669,7 +11555,6 @@ static int test_vgcreate_0 (void)
   }
   {
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11678,7 +11563,6 @@ static int test_vgcreate_0 (void)
   }
   {
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11688,9 +11572,7 @@ static int test_vgcreate_0 (void)
   {
     char volgroup[] = "VG1";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char physvols_1[] = "/dev/sda2";
-    physvols_1[5] = devchar;
     char *physvols[] = {
       physvols_0,
       physvols_1,
@@ -11705,7 +11587,6 @@ static int test_vgcreate_0 (void)
   {
     char volgroup[] = "VG2";
     char physvols_0[] = "/dev/sda3";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -11780,7 +11661,6 @@ static int test_pvcreate_0 (void)
   /* InitNone|InitEmpty for test_pvcreate_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -11801,10 +11681,9 @@ static int test_pvcreate_0 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for pvcreate (0) */
+  /* TestOutputListOfDevices for pvcreate (0) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -11822,7 +11701,6 @@ static int test_pvcreate_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11831,7 +11709,6 @@ static int test_pvcreate_0 (void)
   }
   {
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11840,7 +11717,6 @@ static int test_pvcreate_0 (void)
   }
   {
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -11861,7 +11737,7 @@ static int test_pvcreate_0 (void)
     }
     {
       char expected[] = "/dev/sda1";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_pvcreate_0: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -11874,7 +11750,7 @@ static int test_pvcreate_0 (void)
     }
     {
       char expected[] = "/dev/sda2";
-      expected[5] = devchar;
+      r[1][5] = 's';
       if (strcmp (r[1], expected) != 0) {
         fprintf (stderr, "test_pvcreate_0: expected \"%s\" but got \"%s\"\n", expected, r[1]);
         return -1;
@@ -11887,7 +11763,7 @@ static int test_pvcreate_0 (void)
     }
     {
       char expected[] = "/dev/sda3";
-      expected[5] = devchar;
+      r[2][5] = 's';
       if (strcmp (r[2], expected) != 0) {
         fprintf (stderr, "test_pvcreate_0: expected \"%s\" but got \"%s\"\n", expected, r[2]);
         return -1;
@@ -11926,7 +11802,6 @@ static int test_is_dir_0 (void)
   /* InitBasicFS for test_is_dir_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -11949,7 +11824,6 @@ static int test_is_dir_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -11964,7 +11838,6 @@ static int test_is_dir_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -11973,7 +11846,6 @@ static int test_is_dir_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12026,7 +11898,6 @@ static int test_is_dir_1 (void)
   /* InitBasicFS for test_is_dir_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12049,7 +11920,6 @@ static int test_is_dir_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12064,7 +11934,6 @@ static int test_is_dir_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12073,7 +11942,6 @@ static int test_is_dir_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12126,7 +11994,6 @@ static int test_is_file_0 (void)
   /* InitBasicFS for test_is_file_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12149,7 +12016,6 @@ static int test_is_file_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12164,7 +12030,6 @@ static int test_is_file_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12173,7 +12038,6 @@ static int test_is_file_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12226,7 +12090,6 @@ static int test_is_file_1 (void)
   /* InitBasicFS for test_is_file_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12249,7 +12112,6 @@ static int test_is_file_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12264,7 +12126,6 @@ static int test_is_file_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12273,7 +12134,6 @@ static int test_is_file_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12326,7 +12186,6 @@ static int test_exists_0 (void)
   /* InitBasicFS for test_exists_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12349,7 +12208,6 @@ static int test_exists_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12364,7 +12222,6 @@ static int test_exists_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12373,7 +12230,6 @@ static int test_exists_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12426,7 +12282,6 @@ static int test_exists_1 (void)
   /* InitBasicFS for test_exists_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12449,7 +12304,6 @@ static int test_exists_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12464,7 +12318,6 @@ static int test_exists_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12473,7 +12326,6 @@ static int test_exists_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12526,7 +12378,6 @@ static int test_mkdir_p_0 (void)
   /* InitBasicFS for test_mkdir_p_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12549,7 +12400,6 @@ static int test_mkdir_p_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12564,7 +12414,6 @@ static int test_mkdir_p_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12573,7 +12422,6 @@ static int test_mkdir_p_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12626,7 +12474,6 @@ static int test_mkdir_p_1 (void)
   /* InitBasicFS for test_mkdir_p_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12649,7 +12496,6 @@ static int test_mkdir_p_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12664,7 +12510,6 @@ static int test_mkdir_p_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12673,7 +12518,6 @@ static int test_mkdir_p_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12726,7 +12570,6 @@ static int test_mkdir_p_2 (void)
   /* InitBasicFS for test_mkdir_p_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12749,7 +12592,6 @@ static int test_mkdir_p_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12764,7 +12606,6 @@ static int test_mkdir_p_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12773,7 +12614,6 @@ static int test_mkdir_p_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12826,7 +12666,6 @@ static int test_mkdir_p_3 (void)
   /* InitBasicFS for test_mkdir_p_3: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12849,7 +12688,6 @@ static int test_mkdir_p_3 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12864,7 +12702,6 @@ static int test_mkdir_p_3 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12873,7 +12710,6 @@ static int test_mkdir_p_3 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -12922,7 +12758,6 @@ static int test_mkdir_p_4 (void)
   /* InitBasicFS for test_mkdir_p_4: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -12945,7 +12780,6 @@ static int test_mkdir_p_4 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -12960,7 +12794,6 @@ static int test_mkdir_p_4 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -12969,7 +12802,6 @@ static int test_mkdir_p_4 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13018,7 +12850,6 @@ static int test_mkdir_0 (void)
   /* InitBasicFS for test_mkdir_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13041,7 +12872,6 @@ static int test_mkdir_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13056,7 +12886,6 @@ static int test_mkdir_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13065,7 +12894,6 @@ static int test_mkdir_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13118,7 +12946,6 @@ static int test_mkdir_1 (void)
   /* InitBasicFS for test_mkdir_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13141,7 +12968,6 @@ static int test_mkdir_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13156,7 +12982,6 @@ static int test_mkdir_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13165,7 +12990,6 @@ static int test_mkdir_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13206,7 +13030,6 @@ static int test_rm_rf_0 (void)
   /* InitBasicFS for test_rm_rf_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13229,7 +13052,6 @@ static int test_rm_rf_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13244,7 +13066,6 @@ static int test_rm_rf_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13253,7 +13074,6 @@ static int test_rm_rf_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13330,7 +13150,6 @@ static int test_rmdir_0 (void)
   /* InitBasicFS for test_rmdir_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13353,7 +13172,6 @@ static int test_rmdir_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13368,7 +13186,6 @@ static int test_rmdir_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13377,7 +13194,6 @@ static int test_rmdir_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13426,7 +13242,6 @@ static int test_rmdir_1 (void)
   /* InitBasicFS for test_rmdir_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13449,7 +13264,6 @@ static int test_rmdir_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13464,7 +13278,6 @@ static int test_rmdir_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13473,7 +13286,6 @@ static int test_rmdir_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13514,7 +13326,6 @@ static int test_rmdir_2 (void)
   /* InitBasicFS for test_rmdir_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13537,7 +13348,6 @@ static int test_rmdir_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13552,7 +13362,6 @@ static int test_rmdir_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13561,7 +13370,6 @@ static int test_rmdir_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13610,7 +13418,6 @@ static int test_rm_0 (void)
   /* InitBasicFS for test_rm_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13633,7 +13440,6 @@ static int test_rm_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13648,7 +13454,6 @@ static int test_rm_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13657,7 +13462,6 @@ static int test_rm_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13706,7 +13510,6 @@ static int test_rm_1 (void)
   /* InitBasicFS for test_rm_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13729,7 +13532,6 @@ static int test_rm_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13744,7 +13546,6 @@ static int test_rm_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13753,7 +13554,6 @@ static int test_rm_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13794,7 +13594,6 @@ static int test_rm_2 (void)
   /* InitBasicFS for test_rm_2: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13817,7 +13616,6 @@ static int test_rm_2 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13832,7 +13630,6 @@ static int test_rm_2 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13841,7 +13638,6 @@ static int test_rm_2 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -13890,7 +13686,6 @@ static int test_read_lines_0 (void)
   /* InitBasicFS for test_read_lines_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -13913,7 +13708,6 @@ static int test_read_lines_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -13928,7 +13722,6 @@ static int test_read_lines_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -13937,7 +13730,6 @@ static int test_read_lines_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -14032,7 +13824,6 @@ static int test_read_lines_1 (void)
   /* InitBasicFS for test_read_lines_1: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -14055,7 +13846,6 @@ static int test_read_lines_1 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -14070,7 +13860,6 @@ static int test_read_lines_1 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -14079,7 +13868,6 @@ static int test_read_lines_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -14138,7 +13926,6 @@ static int test_lvs_0 (void)
   /* InitBasicFSonLVM for test_lvs_0: create ext2 on /dev/VG/LV */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -14161,7 +13948,6 @@ static int test_lvs_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -14175,7 +13961,6 @@ static int test_lvs_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14185,7 +13970,6 @@ static int test_lvs_0 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -14276,7 +14060,6 @@ static int test_lvs_1 (void)
   /* InitNone|InitEmpty for test_lvs_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -14300,7 +14083,6 @@ static int test_lvs_1 (void)
   /* TestOutputList for lvs (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -14318,7 +14100,6 @@ static int test_lvs_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14327,7 +14108,6 @@ static int test_lvs_1 (void)
   }
   {
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14336,7 +14116,6 @@ static int test_lvs_1 (void)
   }
   {
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14346,9 +14125,7 @@ static int test_lvs_1 (void)
   {
     char volgroup[] = "VG1";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char physvols_1[] = "/dev/sda2";
-    physvols_1[5] = devchar;
     char *physvols[] = {
       physvols_0,
       physvols_1,
@@ -14363,7 +14140,6 @@ static int test_lvs_1 (void)
   {
     char volgroup[] = "VG2";
     char physvols_0[] = "/dev/sda3";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -14477,7 +14253,6 @@ static int test_vgs_0 (void)
   /* InitBasicFSonLVM for test_vgs_0: create ext2 on /dev/VG/LV */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -14500,7 +14275,6 @@ static int test_vgs_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -14514,7 +14288,6 @@ static int test_vgs_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14524,7 +14297,6 @@ static int test_vgs_0 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -14615,7 +14387,6 @@ static int test_vgs_1 (void)
   /* InitNone|InitEmpty for test_vgs_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -14639,7 +14410,6 @@ static int test_vgs_1 (void)
   /* TestOutputList for vgs (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -14657,7 +14427,6 @@ static int test_vgs_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14666,7 +14435,6 @@ static int test_vgs_1 (void)
   }
   {
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14675,7 +14443,6 @@ static int test_vgs_1 (void)
   }
   {
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14685,9 +14452,7 @@ static int test_vgs_1 (void)
   {
     char volgroup[] = "VG1";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char physvols_1[] = "/dev/sda2";
-    physvols_1[5] = devchar;
     char *physvols[] = {
       physvols_0,
       physvols_1,
@@ -14702,7 +14467,6 @@ static int test_vgs_1 (void)
   {
     char volgroup[] = "VG2";
     char physvols_0[] = "/dev/sda3";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -14777,7 +14541,6 @@ static int test_pvs_0 (void)
   /* InitBasicFSonLVM for test_pvs_0: create ext2 on /dev/VG/LV */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -14800,7 +14563,6 @@ static int test_pvs_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -14814,7 +14576,6 @@ static int test_pvs_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14824,7 +14585,6 @@ static int test_pvs_0 (void)
   {
     char volgroup[] = "VG";
     char physvols_0[] = "/dev/sda1";
-    physvols_0[5] = devchar;
     char *physvols[] = {
       physvols_0,
       NULL
@@ -14862,7 +14622,7 @@ static int test_pvs_0 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for pvs (0) */
+  /* TestOutputListOfDevices for pvs (0) */
   {
     char **r;
     int i;
@@ -14877,7 +14637,7 @@ static int test_pvs_0 (void)
     }
     {
       char expected[] = "/dev/sda1";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_pvs_0: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -14916,7 +14676,6 @@ static int test_pvs_1 (void)
   /* InitNone|InitEmpty for test_pvs_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -14937,10 +14696,9 @@ static int test_pvs_1 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for pvs (1) */
+  /* TestOutputListOfDevices for pvs (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -14958,7 +14716,6 @@ static int test_pvs_1 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14967,7 +14724,6 @@ static int test_pvs_1 (void)
   }
   {
     char device[] = "/dev/sda2";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14976,7 +14732,6 @@ static int test_pvs_1 (void)
   }
   {
     char device[] = "/dev/sda3";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_pvcreate (g, device);
@@ -14997,7 +14752,7 @@ static int test_pvs_1 (void)
     }
     {
       char expected[] = "/dev/sda1";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_pvs_1: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -15010,7 +14765,7 @@ static int test_pvs_1 (void)
     }
     {
       char expected[] = "/dev/sda2";
-      expected[5] = devchar;
+      r[1][5] = 's';
       if (strcmp (r[1], expected) != 0) {
         fprintf (stderr, "test_pvs_1: expected \"%s\" but got \"%s\"\n", expected, r[1]);
         return -1;
@@ -15023,7 +14778,7 @@ static int test_pvs_1 (void)
     }
     {
       char expected[] = "/dev/sda3";
-      expected[5] = devchar;
+      r[2][5] = 's';
       if (strcmp (r[2], expected) != 0) {
         fprintf (stderr, "test_pvs_1: expected \"%s\" but got \"%s\"\n", expected, r[2]);
         return -1;
@@ -15062,7 +14817,6 @@ static int test_list_partitions_0 (void)
   /* InitBasicFS for test_list_partitions_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15085,7 +14839,6 @@ static int test_list_partitions_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -15100,7 +14853,6 @@ static int test_list_partitions_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -15109,7 +14861,6 @@ static int test_list_partitions_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -15117,7 +14868,7 @@ static int test_list_partitions_0 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for list_partitions (0) */
+  /* TestOutputListOfDevices for list_partitions (0) */
   {
     char **r;
     int i;
@@ -15132,7 +14883,7 @@ static int test_list_partitions_0 (void)
     }
     {
       char expected[] = "/dev/sda1";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_list_partitions_0: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -15171,7 +14922,6 @@ static int test_list_partitions_1 (void)
   /* InitNone|InitEmpty for test_list_partitions_1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15192,10 +14942,9 @@ static int test_list_partitions_1 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for list_partitions (1) */
+  /* TestOutputListOfDevices for list_partitions (1) */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",10";
     char lines_1[] = ",20";
     char lines_2[] = ",";
@@ -15225,7 +14974,7 @@ static int test_list_partitions_1 (void)
     }
     {
       char expected[] = "/dev/sda1";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_list_partitions_1: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -15238,7 +14987,7 @@ static int test_list_partitions_1 (void)
     }
     {
       char expected[] = "/dev/sda2";
-      expected[5] = devchar;
+      r[1][5] = 's';
       if (strcmp (r[1], expected) != 0) {
         fprintf (stderr, "test_list_partitions_1: expected \"%s\" but got \"%s\"\n", expected, r[1]);
         return -1;
@@ -15251,7 +15000,7 @@ static int test_list_partitions_1 (void)
     }
     {
       char expected[] = "/dev/sda3";
-      expected[5] = devchar;
+      r[2][5] = 's';
       if (strcmp (r[2], expected) != 0) {
         fprintf (stderr, "test_list_partitions_1: expected \"%s\" but got \"%s\"\n", expected, r[2]);
         return -1;
@@ -15290,7 +15039,6 @@ static int test_list_devices_0 (void)
   /* InitNone|InitEmpty for test_list_devices_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15311,7 +15059,7 @@ static int test_list_devices_0 (void)
     if (r == -1)
       return -1;
   }
-  /* TestOutputList for list_devices (0) */
+  /* TestOutputListOfDevices for list_devices (0) */
   {
     char **r;
     int i;
@@ -15326,7 +15074,7 @@ static int test_list_devices_0 (void)
     }
     {
       char expected[] = "/dev/sda";
-      expected[5] = devchar;
+      r[0][5] = 's';
       if (strcmp (r[0], expected) != 0) {
         fprintf (stderr, "test_list_devices_0: expected \"%s\" but got \"%s\"\n", expected, r[0]);
         return -1;
@@ -15339,7 +15087,7 @@ static int test_list_devices_0 (void)
     }
     {
       char expected[] = "/dev/sdb";
-      expected[5] = devchar;
+      r[1][5] = 's';
       if (strcmp (r[1], expected) != 0) {
         fprintf (stderr, "test_list_devices_0: expected \"%s\" but got \"%s\"\n", expected, r[1]);
         return -1;
@@ -15352,13 +15100,26 @@ static int test_list_devices_0 (void)
     }
     {
       char expected[] = "/dev/sdc";
-      expected[5] = devchar;
+      r[2][5] = 's';
       if (strcmp (r[2], expected) != 0) {
         fprintf (stderr, "test_list_devices_0: expected \"%s\" but got \"%s\"\n", expected, r[2]);
         return -1;
       }
     }
-    if (r[3] != NULL) {
+    if (!r[3]) {
+      fprintf (stderr, "test_list_devices_0: short list returned from command\n");
+      print_strings (r);
+      return -1;
+    }
+    {
+      char expected[] = "/dev/sdd";
+      r[3][5] = 's';
+      if (strcmp (r[3], expected) != 0) {
+        fprintf (stderr, "test_list_devices_0: expected \"%s\" but got \"%s\"\n", expected, r[3]);
+        return -1;
+      }
+    }
+    if (r[4] != NULL) {
       fprintf (stderr, "test_list_devices_0: extra elements returned from command\n");
       print_strings (r);
       return -1;
@@ -15391,7 +15152,6 @@ static int test_ls_0 (void)
   /* InitBasicFS for test_ls_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15414,7 +15174,6 @@ static int test_ls_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -15429,7 +15188,6 @@ static int test_ls_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -15438,7 +15196,6 @@ static int test_ls_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -15560,7 +15317,6 @@ static int test_cat_0 (void)
   /* InitBasicFS for test_cat_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15583,7 +15339,6 @@ static int test_cat_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -15598,7 +15353,6 @@ static int test_cat_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -15607,7 +15361,6 @@ static int test_cat_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -15663,7 +15416,6 @@ static int test_touch_0 (void)
   /* InitBasicFS for test_touch_0: create ext2 on /dev/sda1 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15686,7 +15438,6 @@ static int test_touch_0 (void)
   }
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -15701,7 +15452,6 @@ static int test_touch_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -15710,7 +15460,6 @@ static int test_touch_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -15763,7 +15512,6 @@ static int test_sync_0 (void)
   /* InitNone|InitEmpty for test_sync_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15816,7 +15564,6 @@ static int test_mount_0 (void)
   /* InitNone|InitEmpty for test_mount_0 */
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_blockdev_setrw (g, device);
@@ -15841,7 +15588,6 @@ static int test_mount_0 (void)
   char expected[] = "new file contents";
   {
     char device[] = "/dev/sda";
-    device[5] = devchar;
     char lines_0[] = ",";
     char *lines[] = {
       lines_0,
@@ -15856,7 +15602,6 @@ static int test_mount_0 (void)
   {
     char fstype[] = "ext2";
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     int r;
     suppress_error = 0;
     r = guestfs_mkfs (g, fstype, device);
@@ -15865,7 +15610,6 @@ static int test_mount_0 (void)
   }
   {
     char device[] = "/dev/sda1";
-    device[5] = devchar;
     char mountpoint[] = "/";
     int r;
     suppress_error = 0;
@@ -15902,11 +15646,9 @@ int main (int argc, char *argv[])
 {
   char c = 0;
   int failed = 0;
-  const char *srcdir;
   const char *filename;
-  int fd, i;
+  int fd;
   int nr_tests, test_num = 0;
-  char **devs;
 
   no_test_warnings ();
 
@@ -16004,40 +15746,48 @@ int main (int argc, char *argv[])
     exit (1);
   }
 
+  if (guestfs_add_drive_ro (g, "../images/test.sqsh") == -1) {
+    printf ("guestfs_add_drive_ro ../images/test.sqsh FAILED\n");
+    exit (1);
+  }
+
   if (guestfs_launch (g) == -1) {
     printf ("guestfs_launch FAILED\n");
     exit (1);
   }
+
+  /* Set a timeout in case qemu hangs during launch (RHBZ#505329). */
+  alarm (600);
+
   if (guestfs_wait_ready (g) == -1) {
     printf ("guestfs_wait_ready FAILED\n");
     exit (1);
   }
 
-  /* Detect if the appliance uses /dev/sd* or /dev/hd* in device
-   * names.  This changed between RHEL 5 and RHEL 6 so we have to
-   * support both.
-   */
-  devs = guestfs_list_devices (g);
-  if (devs == NULL || devs[0] == NULL) {
-    printf ("guestfs_list_devices FAILED\n");
-    exit (1);
-  }
-  if (strncmp (devs[0], "/dev/sd", 7) == 0)
-    devchar = 's';
-  else if (strncmp (devs[0], "/dev/hd", 7) == 0)
-    devchar = 'h';
-  else {
-    printf ("guestfs_list_devices returned unexpected string '%s'\n",
-            devs[0]);
-    exit (1);
-  }
-  for (i = 0; devs[i] != NULL; ++i)
-    free (devs[i]);
-  free (devs);
+  /* Cancel previous alarm. */
+  alarm (0);
 
-  nr_tests = 142;
+  nr_tests = 146;
 
   test_num++;
+  printf ("%3d/%3d test_ntfs_3g_probe_0\n", test_num, nr_tests);
+  if (test_ntfs_3g_probe_0 () == -1) {
+    printf ("test_ntfs_3g_probe_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_ntfs_3g_probe_1\n", test_num, nr_tests);
+  if (test_ntfs_3g_probe_1 () == -1) {
+    printf ("test_ntfs_3g_probe_1 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_sleep_0\n", test_num, nr_tests);
+  if (test_sleep_0 () == -1) {
+    printf ("test_sleep_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
   printf ("%3d/%3d test_find_0\n", test_num, nr_tests);
   if (test_find_0 () == -1) {
     printf ("test_find_0 FAILED\n");
@@ -16344,6 +16094,12 @@ int main (int argc, char *argv[])
     failed++;
   }
   test_num++;
+  printf ("%3d/%3d test_checksum_8\n", test_num, nr_tests);
+  if (test_checksum_8 () == -1) {
+    printf ("test_checksum_8 FAILED\n");
+    failed++;
+  }
+  test_num++;
   printf ("%3d/%3d test_download_0\n", test_num, nr_tests);
   if (test_download_0 () == -1) {
     printf ("test_download_0 FAILED\n");