Lines Matching defs:zonepath

331  * Remove the sw inventory file from inside this zonepath that we picked up out
359 * Make a ZFS clone on zonepath from snapshot_name.
362 clone_snap(char *snapshot_name, char *zonepath)
387 "%s: out of memory\n"), zonepath);
391 err = zfs_clone(zhp, zonepath, props);
400 if ((clone = zfs_open(g_zfs, zonepath, ZFS_TYPE_DATASET)) == NULL)
424 * This function takes a zonepath and attempts to determine what the ZFS
426 * assume that zonepath is an existing directory or ZFS fs since we use
429 * The way this works is that we look at the parent directory of the zonepath
431 * append the last component of the zonepath to generate the ZFS name for the
432 * zonepath. This matches the algorithm that ZFS uses for automatically
452 path2name(char *zonepath, char *zfs_name, int len)
463 if ((bnm = strdup(zonepath)) == NULL)
466 if ((dnm = strdup(zonepath)) == NULL) {
821 * possible, or by copying the data from the snapshot to the zonepath.
824 clone_snapshot_zfs(char *snap_name, char *zonepath, char *validatesnap)
840 * The zonepath cannot be ZFS cloned, try to copy the data from
841 * within the snapshot to the zonepath.
843 if (path2name(zonepath, clone_name, sizeof (clone_name)) != Z_OK) {
844 if ((err = clone_copy(snap_path, zonepath)) == Z_OK)
848 "software inventory from %s\n"), zonepath);
859 if ((err = clone_copy(snap_path, zonepath)) == Z_OK)
864 zonepath);
887 * Attempt to clone a source_zone to a target zonepath by using a ZFS clone.
890 clone_zfs(char *source_zonepath, char *zonepath, char *presnapbuf,
905 * Check if there is a file system already mounted on zonepath. If so,
908 if (is_mountpnt(zonepath)) {
912 "preventing use of a ZFS clone.\n"), zonepath);
917 * Instead of using path2name to get the clone name from the zonepath,
920 * source instead of what the zonepath says. For example,
922 * source_zonepath zonepath
929 if (path2name(zonepath, clone_name, sizeof (clone_name)) != Z_OK) {
960 * Attempt to create a ZFS file system for the specified zonepath.
962 * on the zonepath or we don't. The caller doesn't care since a regular
963 * directory is used for the zonepath if no ZFS file system is mounted there.
966 create_zfs_zonepath(char *zonepath)
972 if (path2name(zonepath, zfs_name, sizeof (zfs_name)) != Z_OK)
1011 if (chmod(zonepath, S_IRWXU) != 0) {
1015 (void) destroy_zfs(zonepath);
1026 * If the zonepath is a ZFS file system, attempt to destroy it. We return Z_OK
1027 * if we were able to zfs_destroy the zonepath, otherwise we return Z_ERR
1028 * which means the caller should clean up the zonepath in the traditional
1032 destroy_zfs(char *zonepath)
1038 if ((zhp = mount2zhandle(zonepath)) == NULL)
1094 (void) rmdir(zonepath);
1124 is_zonepath_zfs(char *zonepath)
1131 if (statvfs64(zonepath, &buf1) != 0)
1137 if ((path = strdup(zonepath)) == NULL)
1159 move_zfs(char *zonepath, char *new_zonepath)
1164 if ((zhp = mount2zhandle(zonepath)) == NULL)
1173 (void) rmdir(zonepath);
1392 * interest in a zonepath. It also tallies the number of zone
1448 "subdirectories of %s.\n"), mounts->zonepath);
1456 * Initialize the specified zone_mounts_t structure for the given zonepath.
1458 * structure contains information about mounts in the specified zonepath.
1464 zone_mounts_init(zone_mounts_t *mounts, const char *zonepath)
1467 assert(zonepath != NULL);
1470 if ((mounts->zonepath = strdup(zonepath)) == NULL) {
1472 "for mounts in zonepath %s."), zonepath);
1475 mounts->zonepath_len = strlen(zonepath);
1476 if (zonecfg_find_mounts((char *)zonepath, zone_mounts_cb, mounts) ==
1479 "in zonepath %s."), zonepath);
1496 free(mounts->zonepath);
1503 * prior to the move) using the specified zonepath. mounts should refer to
1510 zone_mount_rootfs(zone_mounts_t *mounts, const char *zonepath)
1517 assert(zonepath != NULL);
1529 if (snprintf(zoneroot, sizeof (zoneroot), "%s/root", zonepath) >=
1531 zerror(gettext("Zonepath %s is too long.\n"), zonepath);
1591 * specified zonepath. mounts should refer to the zone_mounts_t structure
1600 zone_unmount_rootfs(zone_mounts_t *mounts, const char *zonepath,
1608 assert(zonepath != NULL);
1620 if (snprintf(zoneroot, sizeof (zoneroot), "%s/root", zonepath) >=
1622 zerror(gettext("Zonepath %s is too long.\n"), zonepath);