Lines Matching defs:zonepath
330 * Remove the sw inventory file from inside this zonepath that we picked up out
358 * Make a ZFS clone on zonepath from snapshot_name.
361 clone_snap(char *snapshot_name, char *zonepath)
386 "%s: out of memory\n"), zonepath);
390 err = zfs_clone(zhp, zonepath, props);
399 if ((clone = zfs_open(g_zfs, zonepath, ZFS_TYPE_DATASET)) == NULL)
423 * This function takes a zonepath and attempts to determine what the ZFS
425 * assume that zonepath is an existing directory or ZFS fs since we use
428 * The way this works is that we look at the parent directory of the zonepath
430 * append the last component of the zonepath to generate the ZFS name for the
431 * zonepath. This matches the algorithm that ZFS uses for automatically
451 path2name(char *zonepath, char *zfs_name, int len)
462 if ((bnm = strdup(zonepath)) == NULL)
465 if ((dnm = strdup(zonepath)) == NULL) {
820 * possible, or by copying the data from the snapshot to the zonepath.
823 clone_snapshot_zfs(char *snap_name, char *zonepath, char *validatesnap)
839 * The zonepath cannot be ZFS cloned, try to copy the data from
840 * within the snapshot to the zonepath.
842 if (path2name(zonepath, clone_name, sizeof (clone_name)) != Z_OK) {
843 if ((err = clone_copy(snap_path, zonepath)) == Z_OK)
847 "software inventory from %s\n"), zonepath);
858 if ((err = clone_copy(snap_path, zonepath)) == Z_OK)
863 zonepath);
886 * Attempt to clone a source_zone to a target zonepath by using a ZFS clone.
889 clone_zfs(char *source_zonepath, char *zonepath, char *presnapbuf,
904 * Check if there is a file system already mounted on zonepath. If so,
907 if (is_mountpnt(zonepath)) {
911 "preventing use of a ZFS clone.\n"), zonepath);
916 * Instead of using path2name to get the clone name from the zonepath,
919 * source instead of what the zonepath says. For example,
921 * source_zonepath zonepath
928 if (path2name(zonepath, clone_name, sizeof (clone_name)) != Z_OK) {
959 * Attempt to create a ZFS file system for the specified zonepath.
961 * on the zonepath or we don't. The caller doesn't care since a regular
962 * directory is used for the zonepath if no ZFS file system is mounted there.
965 create_zfs_zonepath(char *zonepath)
971 if (path2name(zonepath, zfs_name, sizeof (zfs_name)) != Z_OK)
1010 if (chmod(zonepath, S_IRWXU) != 0) {
1014 (void) destroy_zfs(zonepath);
1025 * If the zonepath is a ZFS file system, attempt to destroy it. We return Z_OK
1026 * if we were able to zfs_destroy the zonepath, otherwise we return Z_ERR
1027 * which means the caller should clean up the zonepath in the traditional
1031 destroy_zfs(char *zonepath)
1037 if ((zhp = mount2zhandle(zonepath)) == NULL)
1093 (void) rmdir(zonepath);
1123 is_zonepath_zfs(char *zonepath)
1130 if (statvfs64(zonepath, &buf1) != 0)
1136 if ((path = strdup(zonepath)) == NULL)
1158 move_zfs(char *zonepath, char *new_zonepath)
1163 if ((zhp = mount2zhandle(zonepath)) == NULL)
1172 (void) rmdir(zonepath);
1391 * interest in a zonepath. It also tallies the number of zone
1447 "subdirectories of %s.\n"), mounts->zonepath);
1455 * Initialize the specified zone_mounts_t structure for the given zonepath.
1457 * structure contains information about mounts in the specified zonepath.
1463 zone_mounts_init(zone_mounts_t *mounts, const char *zonepath)
1466 assert(zonepath != NULL);
1469 if ((mounts->zonepath = strdup(zonepath)) == NULL) {
1471 "for mounts in zonepath %s."), zonepath);
1474 mounts->zonepath_len = strlen(zonepath);
1475 if (zonecfg_find_mounts((char *)zonepath, zone_mounts_cb, mounts) ==
1478 "in zonepath %s."), zonepath);
1495 free(mounts->zonepath);
1502 * prior to the move) using the specified zonepath. mounts should refer to
1509 zone_mount_rootfs(zone_mounts_t *mounts, const char *zonepath)
1516 assert(zonepath != NULL);
1528 if (snprintf(zoneroot, sizeof (zoneroot), "%s/root", zonepath) >=
1530 zerror(gettext("Zonepath %s is too long.\n"), zonepath);
1590 * specified zonepath. mounts should refer to the zone_mounts_t structure
1599 zone_unmount_rootfs(zone_mounts_t *mounts, const char *zonepath,
1607 assert(zonepath != NULL);
1619 if (snprintf(zoneroot, sizeof (zoneroot), "%s/root", zonepath) >=
1621 zerror(gettext("Zonepath %s is too long.\n"), zonepath);