Lines Matching refs:zonepath

356  * Remove the sw inventory file from inside this zonepath that we picked up out
384 * Make a ZFS clone on zonepath from snapshot_name.
387 clone_snap(char *snapshot_name, char *zonepath)
413 "%s: out of memory\n"), zonepath);
417 err = zfs_clone(zhp, zonepath, props);
426 if ((clone = zfs_open(g_zfs, zonepath, ZFS_TYPE_DATASET)) == NULL)
450 * This function takes a zonepath and attempts to determine what the ZFS
452 * assume that zonepath is an existing directory or ZFS fs since we use
455 * The way this works is that we look at the parent directory of the zonepath
457 * append the last component of the zonepath to generate the ZFS name for the
458 * zonepath. This matches the algorithm that ZFS uses for automatically
478 path2name(char *zonepath, char *zfs_name, int len)
489 if ((bnm = strdup(zonepath)) == NULL)
492 if ((dnm = strdup(zonepath)) == NULL) {
847 * possible, or by copying the data from the snapshot to the zonepath.
850 clone_snapshot_zfs(char *snap_name, char *zonepath, char *validatesnap)
866 * The zonepath cannot be ZFS cloned, try to copy the data from
867 * within the snapshot to the zonepath.
869 if (path2name(zonepath, clone_name, sizeof (clone_name)) != Z_OK) {
870 if ((err = clone_copy(snap_path, zonepath)) == Z_OK)
874 "software inventory from %s\n"), zonepath);
885 if ((err = clone_copy(snap_path, zonepath)) == Z_OK)
890 zonepath);
913 * Attempt to clone a source_zone to a target zonepath by using a ZFS clone.
916 clone_zfs(char *source_zonepath, char *zonepath, char *presnapbuf,
931 * Check if there is a file system already mounted on zonepath. If so,
934 if (is_mountpnt(zonepath)) {
938 "preventing use of a ZFS clone.\n"), zonepath);
943 * Instead of using path2name to get the clone name from the zonepath,
946 * source instead of what the zonepath says. For example,
948 * source_zonepath zonepath
955 if (path2name(zonepath, clone_name, sizeof (clone_name)) != Z_OK) {
986 * Attempt to create a ZFS file system for the specified zonepath.
988 * on the zonepath or we don't. The caller doesn't care since a regular
989 * directory is used for the zonepath if no ZFS file system is mounted there.
992 create_zfs_zonepath(char *zonepath)
998 if (path2name(zonepath, zfs_name, sizeof (zfs_name)) != Z_OK)
1038 if (chmod(zonepath, S_IRWXU) != 0) {
1042 (void) destroy_zfs(zonepath);
1053 * If the zonepath is a ZFS file system, attempt to destroy it. We return Z_OK
1054 * if we were able to zfs_destroy the zonepath, otherwise we return Z_ERR
1055 * which means the caller should clean up the zonepath in the traditional
1059 destroy_zfs(char *zonepath)
1065 if ((zhp = mount2zhandle(zonepath)) == NULL)
1121 (void) rmdir(zonepath);
1151 is_zonepath_zfs(char *zonepath)
1158 if (statvfs64(zonepath, &buf1) != 0)
1164 if ((path = strdup(zonepath)) == NULL)
1186 move_zfs(char *zonepath, char *new_zonepath)
1191 if ((zhp = mount2zhandle(zonepath)) == NULL)
1200 (void) rmdir(zonepath);
1430 * interest in a zonepath. It also tallies the number of zone
1486 "subdirectories of %s.\n"), mounts->zonepath);
1494 * Initialize the specified zone_mounts_t structure for the given zonepath.
1496 * structure contains information about mounts in the specified zonepath.
1502 zone_mounts_init(zone_mounts_t *mounts, const char *zonepath)
1505 assert(zonepath != NULL);
1508 if ((mounts->zonepath = strdup(zonepath)) == NULL) {
1510 "for mounts in zonepath %s."), zonepath);
1513 mounts->zonepath_len = strlen(zonepath);
1514 if (zonecfg_find_mounts((char *)zonepath, zone_mounts_cb, mounts) ==
1517 "in zonepath %s."), zonepath);
1534 free(mounts->zonepath);
1541 * prior to the move) using the specified zonepath. mounts should refer to
1548 zone_mount_rootfs(zone_mounts_t *mounts, const char *zonepath)
1555 assert(zonepath != NULL);
1567 if (snprintf(zoneroot, sizeof (zoneroot), "%s/root", zonepath) >=
1569 zerror(gettext("Zonepath %s is too long.\n"), zonepath);
1629 * specified zonepath. mounts should refer to the zone_mounts_t structure
1638 zone_unmount_rootfs(zone_mounts_t *mounts, const char *zonepath,
1646 assert(zonepath != NULL);
1658 if (snprintf(zoneroot, sizeof (zoneroot), "%s/root", zonepath) >=
1660 zerror(gettext("Zonepath %s is too long.\n"), zonepath);