-
-/* List is built in reverse order, so add them in reverse order. */
-static void
-add_drives (struct drv *drv)
-{
- int r;
- struct guestfs_add_drive_opts_argv ad_optargs;
-
- if (drv) {
- add_drives (drv->next);
-
- ad_optargs.bitmask = 0;
- if (read_only) {
- ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK;
- ad_optargs.readonly = 1;
- }
- if (drv->format) {
- ad_optargs.bitmask |= GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK;
- ad_optargs.format = drv->format;
- }
- r = guestfs_add_drive_opts_argv (g, drv->filename, &ad_optargs);
- if (r == -1)
- exit (EXIT_FAILURE);
- }
-}
-
-/* List is built in reverse order, so mount them in reverse order. */
-static void
-mount_mps (struct mp *mp)
-{
- int r;
-
- if (mp) {
- mount_mps (mp->next);
-
- /* Don't use guestfs_mount here because that will default to mount
- * options -o sync,noatime. For more information, see guestfs(3)
- * section "LIBGUESTFS GOTCHAS".
- */
- const char *options = read_only ? "ro" : "";
- r = guestfs_mount_options (g, options, mp->device, mp->mountpoint);
- if (r == -1)
- exit (EXIT_FAILURE);
- }
-}