Lines Matching refs:zlogp

230 build_mnttable(zlog_t *zlogp, const char *zroot, size_t zrootlen, FILE *mnttab,  in build_mnttable()  argument
272 zerror(zlogp, B_TRUE, "memory allocation failed"); in build_mnttable()
297 lofs_read_mnttab(zlog_t *zlogp) in lofs_read_mnttab() argument
304 if (build_mnttable(zlogp, "", 0, mnttab, &resolve_lofs_mnts, in lofs_read_mnttab()
319 resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen) in resolve_lofs() argument
332 if (resolve_lofs_mnts == NULL && lofs_read_mnttab(zlogp) == -1) in resolve_lofs()
394 check_lofs_needed(zlog_t *zlogp, struct zone_fstab *fsptr) in check_lofs_needed() argument
400 if (resolve_lofs_mnts == NULL && lofs_read_mnttab(zlogp) == -1) in check_lofs_needed()
432 zerror(zlogp, B_TRUE, "cannot mount %s", in check_lofs_needed()
449 make_one_dir(zlog_t *zlogp, const char *prefix, const char *subdir, mode_t mode, in make_one_dir() argument
457 zerror(zlogp, B_FALSE, "pathname %s%s is too long", prefix, in make_one_dir()
476 zerror(zlogp, B_FALSE, in make_one_dir()
481 zerror(zlogp, B_FALSE, in make_one_dir()
491 zerror(zlogp, B_FALSE, "Could not mkdir %s.\nIt is on " in make_one_dir()
495 zerror(zlogp, B_TRUE, "mkdirp of %s failed", path); in make_one_dir()
516 get_remote_fstypes(zlog_t *zlogp) in get_remote_fstypes() argument
526 zerror(zlogp, B_TRUE, "failed to open %s", DFSTYPES); in get_remote_fstypes()
542 zerror(zlogp, B_TRUE, "memory allocation failed"); in get_remote_fstypes()
549 zerror(zlogp, B_FALSE, "unable to parse %s", DFSTYPES); in get_remote_fstypes()
556 zerror(zlogp, B_TRUE, "memory allocation failed"); in get_remote_fstypes()
587 root_to_lu(zlog_t *zlogp, char *zroot, size_t zrootlen, boolean_t isresolved) in root_to_lu() argument
590 resolve_lofs(zlogp, zroot, zrootlen); in root_to_lu()
624 unmount_filesystems(zlog_t *zlogp, zoneid_t zoneid, boolean_t unmount_cmd) in unmount_filesystems() argument
637 zerror(zlogp, B_FALSE, "unable to determine zone root"); in unmount_filesystems()
641 root_to_lu(zlogp, zroot, sizeof (zroot), B_FALSE); in unmount_filesystems()
651 tsol_unmounts(zlogp, zone_name); in unmount_filesystems()
654 zerror(zlogp, B_TRUE, "failed to open %s", MNTTAB); in unmount_filesystems()
662 zerror(zlogp, B_TRUE, "unable to configure %s", MNTTAB); in unmount_filesystems()
671 remote_fstypes = get_remote_fstypes(zlogp); in unmount_filesystems()
687 if (build_mnttable(zlogp, zroot, zrootlen, mnttab, &mnts, in unmount_filesystems()
722 zerror(zlogp, B_FALSE, in unmount_filesystems()
752 zerror(zlogp, B_TRUE, "unable to remove autofs nodes"); in unmount_filesystems()
785 forkexec(zlog_t *zlogp, const char *path, char *const argv[]) in forkexec() argument
797 zerror(zlogp, B_TRUE, "could not fork for %s", argv[0]); in forkexec()
819 zerror(zlogp, B_FALSE, "%s unexpectedly terminated due to " in forkexec()
825 zerror(zlogp, B_FALSE, "failed to exec %s", path); in forkexec()
843 dofsck(zlog_t *zlogp, const char *fstype, const char *rawdev) in dofsck() argument
855 zerror(zlogp, B_FALSE, "file-system type %s too long", fstype); in dofsck()
872 status = forkexec(zlogp, cmdbuf, argv); in dofsck()
875 zerror(zlogp, B_FALSE, "fsck of '%s' failed with exit status %d; " in dofsck()
881 domount(zlog_t *zlogp, const char *fstype, const char *opts, in domount() argument
894 zerror(zlogp, B_FALSE, "file-system type %s too long", fstype); in domount()
910 status = forkexec(zlogp, cmdbuf, argv); in domount()
914 zerror(zlogp, B_FALSE, "\"%s %s %s\" " in domount()
918 zerror(zlogp, B_FALSE, "\"%s -o %s %s %s\" " in domount()
938 valid_mount_point(zlog_t *zlogp, const char *path, const boolean_t leaf) in valid_mount_point() argument
947 zerror(zlogp, B_TRUE, "can't stat %s", path); in valid_mount_point()
951 zerror(zlogp, B_FALSE, "%s is a symlink", path); in valid_mount_point()
955 zerror(zlogp, B_FALSE, "%s is not a directory", path); in valid_mount_point()
959 zerror(zlogp, B_TRUE, "unable to resolve path %s", path); in valid_mount_point()
967 zerror(zlogp, B_FALSE, "%s is not a canonical path", path); in valid_mount_point()
987 valid_mount_path(zlog_t *zlogp, const char *rootpath, const char *spec, in valid_mount_path() argument
999 zerror(zlogp, B_FALSE, "invalid mount directory, " in valid_mount_path()
1014 zerror(zlogp, B_FALSE, "pathname %s%s is too long", in valid_mount_path()
1030 rv = valid_mount_point(zlogp, abspath, B_FALSE); in valid_mount_path()
1033 rv = valid_mount_point(zlogp, abspath, B_TRUE); in valid_mount_path()
1061 vplat_get_iptype(zlog_t *zlogp, zone_iptype_t *iptypep) in vplat_get_iptype() argument
1066 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in vplat_get_iptype()
1070 zerror(zlogp, B_FALSE, "invalid configuration"); in vplat_get_iptype()
1075 zerror(zlogp, B_FALSE, "invalid ip-type configuration"); in vplat_get_iptype()
1089 mount_one_dev(zlog_t *zlogp, char *devpath, zone_mnt_t mount_cmd) in mount_one_dev() argument
1102 zerror(zlogp, B_TRUE, "failed to initialize profile"); in mount_one_dev()
1118 zerror(zlogp, B_FALSE, "unable to determine zone brand"); in mount_one_dev()
1122 if (vplat_get_iptype(zlogp, &iptype) < 0) { in mount_one_dev()
1123 zerror(zlogp, B_TRUE, "unable to determine ip-type"); in mount_one_dev()
1137 zerror(zlogp, B_TRUE, "failed to add standard device"); in mount_one_dev()
1143 zerror(zlogp, B_TRUE, "failed to add standard symlink"); in mount_one_dev()
1149 zerror(zlogp, B_FALSE, "can't initialize zone handle"); in mount_one_dev()
1153 zerror(zlogp, B_FALSE, "can't get handle for zone " in mount_one_dev()
1158 zerror(zlogp, B_FALSE, "%s: %s", zone_name, in mount_one_dev()
1164 zerror(zlogp, B_TRUE, "failed to add " in mount_one_dev()
1173 zerror(zlogp, B_TRUE, "failed to commit profile"); in mount_one_dev()
1190 mount_one(zlog_t *zlogp, struct zone_fstab *fsptr, const char *rootpath, in mount_one() argument
1198 if ((rv = valid_mount_path(zlogp, rootpath, fsptr->zone_fs_special, in mount_one()
1200 zerror(zlogp, B_FALSE, "%s%s is not a valid mount point", in mount_one()
1205 if (make_one_dir(zlogp, rootpath, fsptr->zone_fs_dir, in mount_one()
1208 zerror(zlogp, B_FALSE, "failed to create mount point"); in mount_one()
1219 if ((rv = valid_mount_path(zlogp, rootpath, in mount_one()
1222 zerror(zlogp, B_FALSE, in mount_one()
1242 zerror(zlogp, B_FALSE, "cannot mount %s on %s: " in mount_one()
1266 if (check_lofs_needed(zlogp, fsptr) == -1) in mount_one()
1275 resolve_lofs(zlogp, fsptr->zone_fs_special, in mount_one()
1284 dofsck(zlogp, fsptr->zone_fs_type, fsptr->zone_fs_raw) != 0) { in mount_one()
1287 dofsck(zlogp, fsptr->zone_fs_type, fsptr->zone_fs_special) != 0) { in mount_one()
1306 if ((rv = domount(zlogp, fsptr->zone_fs_type, optstr, in mount_one()
1321 return (mount_one_dev(zlogp, path, mount_cmd)); in mount_one()
1354 build_mounted_pre_var(zlog_t *zlogp, char *rootpath, in build_mounted_pre_var() argument
1367 resolve_lofs(zlogp, rootpath, rootlen); in build_mounted_pre_var()
1369 resolve_lofs(zlogp, luroot, lurootlen); in build_mounted_pre_var()
1380 zerror(zlogp, B_TRUE, "cannot create %s", tmp); in build_mounted_pre_var()
1392 zerror(zlogp, B_TRUE, "memory allocation failed"); in build_mounted_pre_var()
1402 zerror(zlogp, B_TRUE, "cannot create %s", tmp); in build_mounted_pre_var()
1405 if (domount(zlogp, MNTTYPE_LOFS, RESOURCE_DEFAULT_OPTS, fromdir, in build_mounted_pre_var()
1407 zerror(zlogp, B_TRUE, "cannot mount %s on %s", tmp, in build_mounted_pre_var()
1416 zerror(zlogp, B_TRUE, "cannot open zone mapfile"); in build_mounted_pre_var()
1421 zerror(zlogp, B_TRUE, "cannot add zone mapfile entry"); in build_mounted_pre_var()
1425 if (domount(zlogp, MNTTYPE_LOFS, "", rootpath, tmp) != 0) in build_mounted_pre_var()
1433 build_mounted_post_var(zlog_t *zlogp, zone_mnt_t mount_cmd, char *rootpath, in build_mounted_post_var() argument
1471 zerror(zlogp, B_TRUE, "cannot create %s", tmp); in build_mounted_post_var()
1474 if (domount(zlogp, MNTTYPE_LOFS, "", fromdir, tmp) in build_mounted_post_var()
1476 zerror(zlogp, B_TRUE, "cannot mount %s on %s", in build_mounted_post_var()
1496 zerror(zlogp, B_TRUE, "cannot create %s", tmp); in build_mounted_post_var()
1500 zerror(zlogp, B_TRUE, "cannot stat %s", tmp); in build_mounted_post_var()
1512 if (domount(zlogp, MNTTYPE_LOFS, RESOURCE_DEFAULT_OPTS, *cpp, in build_mounted_post_var()
1514 zerror(zlogp, B_TRUE, "cannot mount %s on %s", tmp, in build_mounted_post_var()
1532 zerror(zlogp, B_TRUE, "cannot create %s", tmp); in build_mounted_post_var()
1542 zerror(zlogp, B_TRUE, "cannot chmod %s", tmp); in build_mounted_post_var()
1546 if (domount(zlogp, MNTTYPE_TMPFS, "", "swap", tmp) != 0) { in build_mounted_post_var()
1547 zerror(zlogp, B_TRUE, "cannot mount swap on %s", *cpp); in build_mounted_post_var()
1569 zlog_t *zlogp = cp->pgcd_zlogp; in plat_gmount_cb() local
1576 zerror(zlogp, B_TRUE, "memory allocation failed"); in plat_gmount_cb()
1595 zerror(zlogp, B_FALSE, "error adding property"); in plat_gmount_cb()
1603 mount_filesystems_fsent(zone_dochandle_t handle, zlog_t *zlogp, in mount_filesystems_fsent() argument
1613 zerror(zlogp, B_FALSE, "invalid configuration"); in mount_filesystems_fsent()
1629 zerror(zlogp, B_TRUE, "memory allocation failed"); in mount_filesystems_fsent()
1670 mount_filesystems(zlog_t *zlogp, zone_mnt_t mount_cmd) in mount_filesystems() argument
1685 zerror(zlogp, B_FALSE, in mount_filesystems()
1693 zerror(zlogp, B_TRUE, "unable to determine zone path"); in mount_filesystems()
1698 zerror(zlogp, B_TRUE, "unable to determine zone root"); in mount_filesystems()
1703 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in mount_filesystems()
1708 zerror(zlogp, B_FALSE, "invalid configuration"); in mount_filesystems()
1724 zerror(zlogp, B_FALSE, "unable to determine zone brand"); in mount_filesystems()
1733 cb.pgcd_zlogp = zlogp; in mount_filesystems()
1738 zerror(zlogp, B_FALSE, "unable to mount filesystems"); in mount_filesystems()
1751 if (mount_filesystems_fsent(handle, zlogp, &fs_ptr, &num_fs, in mount_filesystems()
1790 if (ALT_MOUNT(mount_cmd) && !build_mounted_pre_var(zlogp, in mount_filesystems()
1808 if (mount_one(zlogp, &fs_ptr[i], rootpath, mount_cmd) in mount_filesystems()
1814 if (mount_one(zlogp, &fs_ptr[i], rootpath, mount_cmd) != 0) in mount_filesystems()
1818 !build_mounted_post_var(zlogp, mount_cmd, rootpath, luroot)) in mount_filesystems()
1825 tsol_mounts(zlogp, zone_name, rootpath) != 0) in mount_filesystems()
1871 unconfigure_shared_network_interfaces(zlog_t *zlogp, zoneid_t zone_id) in unconfigure_shared_network_interfaces() argument
1882 zerror(zlogp, B_TRUE, "could not get socket"); in unconfigure_shared_network_interfaces()
1889 zerror(zlogp, B_TRUE, in unconfigure_shared_network_interfaces()
1897 zerror(zlogp, B_TRUE, "memory allocation failed"); in unconfigure_shared_network_interfaces()
1906 zerror(zlogp, B_TRUE, "could not get configured network " in unconfigure_shared_network_interfaces()
1916 zerror(zlogp, B_TRUE, "%s: could not get socket", in unconfigure_shared_network_interfaces()
1931 zerror(zlogp, B_TRUE, in unconfigure_shared_network_interfaces()
1939 zerror(zlogp, B_TRUE, in unconfigure_shared_network_interfaces()
1999 who_is_using(zlog_t *zlogp, struct lifreq *lifr) in who_is_using() argument
2013 zerror(zlogp, B_TRUE, "could not get routing socket"); in who_is_using()
2050 zerror(zlogp, B_TRUE, "writing to routing socket"); in who_is_using()
2053 zerror(zlogp, B_TRUE, in who_is_using()
2062 zerror(zlogp, B_TRUE, "reading from routing socket"); in who_is_using()
2067 zerror(zlogp, B_FALSE, in who_is_using()
2073 zerror(zlogp, B_FALSE, "message length mismatch, " in who_is_using()
2080 zerror(zlogp, B_TRUE, "RTM_GET routing socket message"); in who_is_using()
2084 zerror(zlogp, B_FALSE, "network interface not found"); in who_is_using()
2102 zerror(zlogp, B_FALSE, "network interface could not be " in who_is_using()
2121 zerror(zlogp, B_TRUE, in who_is_using()
2147 configure_one_interface(zlog_t *zlogp, zoneid_t zone_id, in configure_one_interface() argument
2165 zerror(zlogp, B_FALSE, "%s: %s", zonecfg_strerror(res), in configure_one_interface()
2173 zerror(zlogp, B_TRUE, "could not get socket"); in configure_one_interface()
2210 zerror(zlogp, B_TRUE, "%s: could not place network interface " in configure_one_interface()
2238 zerror(zlogp, B_FALSE, in configure_one_interface()
2259 zerror(zlogp, B_FALSE, in configure_one_interface()
2272 zerror(zlogp, B_TRUE, "%s: could not set netmask", in configure_one_interface()
2280 zerror(zlogp, B_TRUE, in configure_one_interface()
2287 zerror(zlogp, B_TRUE, "%s: could not get flags", in configure_one_interface()
2303 zerror(zlogp, B_TRUE, in configure_one_interface()
2309 zerror(zlogp, B_TRUE, "%s: could not get address", in configure_one_interface()
2313 zone_using = who_is_using(zlogp, &lifr); in configure_one_interface()
2316 zerror(zlogp, B_TRUE, in configure_one_interface()
2320 zerror(zlogp, B_TRUE, "%s: could not bring network " in configure_one_interface()
2360 zerror(zlogp, B_FALSE, "WARNING: %s; using default.", in configure_one_interface()
2363 zerror(zlogp, B_FALSE, in configure_one_interface()
2385 status = forkexec(zlogp, "/usr/sbin/route", argv); in configure_one_interface()
2387 zerror(zlogp, B_FALSE, "Unable to set route for " in configure_one_interface()
2410 configure_shared_network_interfaces(zlog_t *zlogp) in configure_shared_network_interfaces() argument
2417 zerror(zlogp, B_TRUE, "unable to get zoneid"); in configure_shared_network_interfaces()
2422 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in configure_shared_network_interfaces()
2426 zerror(zlogp, B_FALSE, "invalid configuration"); in configure_shared_network_interfaces()
2434 if (configure_one_interface(zlogp, zoneid, &nwiftab) != in configure_shared_network_interfaces()
2456 if (configure_one_interface(zlogp, zoneid, &loopback_iftab) != Z_OK) in configure_shared_network_interfaces()
2462 if (configure_one_interface(zlogp, zoneid, &loopback_iftab) != Z_OK) in configure_shared_network_interfaces()
2468 zdlerror(zlog_t *zlogp, dladm_status_t err, const char *dlname, const char *str) in zdlerror() argument
2473 zerror(zlogp, B_FALSE, "%s '%s': %s", str, dlname, errmsg); in zdlerror()
2477 add_datalink(zlog_t *zlogp, char *zone_name, datalink_id_t linkid, char *dlname) in add_datalink() argument
2486 zerror(zlogp, B_FALSE, "WARNING: skipping network interface " in add_datalink()
2495 zdlerror(zlogp, err, dlname, in add_datalink()
2508 zdlerror(zlogp, err, dlname, in add_datalink()
2514 zdlerror(zlogp, err, dlname, in add_datalink()
2523 zerror(zlogp, B_FALSE, "WARNING: unable to set " in add_datalink()
2597 add_net_for_linkid(zlog_t *zlogp, zoneid_t zoneid, zone_addr_list_t *start) in add_net_for_linkid() argument
2641 zerror(zlogp, B_FALSE, "invalid address [%s]\n", in add_net_for_linkid()
2716 zerror(zlogp, B_FALSE, "unable to check if protection is set"); in add_net_for_linkid()
2721 zerror(zlogp, B_FALSE, "Protection is already set"); in add_net_for_linkid()
2728 zerror(zlogp, B_FALSE, "unable to check if allowed-ips is set"); in add_net_for_linkid()
2732 zerror(zlogp, B_FALSE, "allowed-ips is already set"); in add_net_for_linkid()
2744 zerror(zlogp, B_FALSE, "could not set protection\n"); in add_net_for_linkid()
2751 zerror(zlogp, B_FALSE, "could not set allowed-ips\n"); in add_net_for_linkid()
2780 zerror(zlogp, B_FALSE, in add_net_for_linkid()
2809 add_net(zlog_t *zlogp, zoneid_t zoneid, zone_addr_list_t *zalist) in add_net() argument
2820 err = add_net_for_linkid(zlogp, zoneid, zalist); in add_net()
2828 err = add_net_for_linkid(zlogp, zoneid, ptr); in add_net()
2895 configure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid) in configure_exclusive_network_interfaces() argument
2907 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in configure_exclusive_network_interfaces()
2911 zerror(zlogp, B_FALSE, "invalid configuration"); in configure_exclusive_network_interfaces()
2930 zerror(zlogp, B_TRUE, in configure_exclusive_network_interfaces()
2939 zerror(zlogp, B_TRUE, in configure_exclusive_network_interfaces()
2958 add_datalink(zlogp, zone_name, linkid, in configure_exclusive_network_interfaces()
2964 zerror(zlogp, B_TRUE, "failed to add network device"); in configure_exclusive_network_interfaces()
2970 zerror(zlogp, B_TRUE, "no memory for %s", in configure_exclusive_network_interfaces()
2981 if ((errno = add_net(zlogp, zoneid, zalist)) != 0) { in configure_exclusive_network_interfaces()
2984 zerror(zlogp, B_TRUE, "failed to add address"); in configure_exclusive_network_interfaces()
2995 zerror(zlogp, B_TRUE, "failed to commit profile"); in configure_exclusive_network_interfaces()
3006 remove_datalink_pool(zlog_t *zlogp, zoneid_t zoneid) in remove_datalink_pool() argument
3019 if (vplat_get_iptype(zlogp, &iptype) < 0) { in remove_datalink_pool()
3020 zerror(zlogp, B_FALSE, "unable to determine ip-type"); in remove_datalink_pool()
3037 zerror(zlogp, B_TRUE, "unable to count network " in remove_datalink_pool()
3047 zerror(zlogp, B_TRUE, "memory allocation failed"); in remove_datalink_pool()
3051 zerror(zlogp, B_TRUE, "unable to list network " in remove_datalink_pool()
3061 zerror(zlogp, B_TRUE, in remove_datalink_pool()
3071 remove_datalink_protect(zlog_t *zlogp, zoneid_t zoneid) in remove_datalink_protect() argument
3081 if (vplat_get_iptype(zlogp, &iptype) < 0) { in remove_datalink_protect()
3082 zerror(zlogp, B_FALSE, "unable to determine ip-type"); in remove_datalink_protect()
3101 zerror(zlogp, B_TRUE, "unable to count network interfaces"); in remove_datalink_protect()
3109 zerror(zlogp, B_TRUE, "memory allocation failed"); in remove_datalink_protect()
3113 zerror(zlogp, B_TRUE, "unable to list network interfaces"); in remove_datalink_protect()
3128 zerror(zlogp, B_FALSE, in remove_datalink_protect()
3136 zerror(zlogp, B_FALSE, in remove_datalink_protect()
3147 unconfigure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid) in unconfigure_exclusive_network_interfaces() argument
3157 zerror(zlogp, B_TRUE, "unable to list network interfaces"); in unconfigure_exclusive_network_interfaces()
3161 zerror(zlogp, B_FALSE, in unconfigure_exclusive_network_interfaces()
3169 tcp_abort_conn(zlog_t *zlogp, zoneid_t zoneid, in tcp_abort_conn() argument
3189 zerror(zlogp, B_TRUE, "unable to open %s", "/dev/tcp"); in tcp_abort_conn()
3201 tcp_abort_connections(zlog_t *zlogp, zoneid_t zoneid) in tcp_abort_connections() argument
3223 if ((error = tcp_abort_conn(zlogp, zoneid, &l, &r)) != 0) in tcp_abort_connections()
3241 if ((error = tcp_abort_conn(zlogp, zoneid, &l, &r)) != 0) in tcp_abort_connections()
3247 get_privset(zlog_t *zlogp, priv_set_t *privs, zone_mnt_t mount_cmd) in get_privset() argument
3254 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in get_privset()
3258 zerror(zlogp, B_FALSE, "invalid configuration"); in get_privset()
3268 zerror(zlogp, B_TRUE, "unable to determine ip-type"); in get_privset()
3286 zerror(zlogp, B_FALSE, in get_privset()
3297 zerror(zlogp, B_FALSE, "privilege \"%s\" is not permitted " in get_privset()
3301 zerror(zlogp, B_FALSE, "required privilege \"%s\" is missing " in get_privset()
3305 zerror(zlogp, B_FALSE, "unknown privilege \"%s\" specified " in get_privset()
3309 zerror(zlogp, B_FALSE, "failed to determine the zone's " in get_privset()
3320 get_rctls(zlog_t *zlogp, char **bufp, size_t *bufsizep) in get_rctls() argument
3338 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in get_rctls()
3342 zerror(zlogp, B_FALSE, "invalid configuration"); in get_rctls()
3349 zerror(zlogp, B_TRUE, "%s failed", "nvlist_alloc"); in get_rctls()
3365 zerror(zlogp, B_FALSE, "unable to set max-lwps alias"); in get_rctls()
3371 zerror(zlogp, B_FALSE, "%s failed", "zonecfg_setrctlent"); in get_rctls()
3376 zerror(zlogp, B_TRUE, "memory allocation failed"); in get_rctls()
3404 zerror(zlogp, B_TRUE, "%s failed", in get_rctls()
3410 zerror(zlogp, B_FALSE, "invalid rctl value: " in get_rctls()
3418 zerror(zlogp, B_FALSE, in get_rctls()
3429 zerror(zlogp, B_FALSE, "%s failed", in get_rctls()
3435 zerror(zlogp, B_FALSE, "%s failed", in get_rctls()
3442 zerror(zlogp, B_FALSE, "%s failed", in get_rctls()
3451 zerror(zlogp, B_FALSE, "%s failed", in get_rctls()
3469 zerror(zlogp, B_FALSE, "%s failed", "nvlist_pack"); in get_rctls()
3491 get_implicit_datasets(zlog_t *zlogp, char **retstr) in get_implicit_datasets() argument
3502 if (do_subproc(zlogp, cmdbuf, retstr) != 0) in get_implicit_datasets()
3509 get_datasets(zlog_t *zlogp, char **bufp, size_t *bufsizep) in get_datasets() argument
3523 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in get_datasets()
3527 zerror(zlogp, B_FALSE, "invalid configuration"); in get_datasets()
3532 if (get_implicit_datasets(zlogp, &implicit_datasets) != 0) { in get_datasets()
3533 zerror(zlogp, B_FALSE, "getting implicit datasets failed"); in get_datasets()
3538 zerror(zlogp, B_FALSE, "%s failed", "zonecfg_setdsent"); in get_datasets()
3558 zerror(zlogp, B_TRUE, "memory allocation failed"); in get_datasets()
3563 zerror(zlogp, B_FALSE, "%s failed", "zonecfg_setdsent"); in get_datasets()
3596 validate_datasets(zlog_t *zlogp) in validate_datasets() argument
3604 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in validate_datasets()
3608 zerror(zlogp, B_FALSE, "invalid configuration"); in validate_datasets()
3614 zerror(zlogp, B_FALSE, "invalid configuration"); in validate_datasets()
3620 zerror(zlogp, B_FALSE, "opening ZFS library"); in validate_datasets()
3629 zerror(zlogp, B_FALSE, "cannot open ZFS dataset '%s'", in validate_datasets()
3643 zerror(zlogp, B_FALSE, "cannot set 'zoned' " in validate_datasets()
3704 validate_rootds_label(zlog_t *zlogp, char *rootpath, m_label_t *zone_sl) in validate_rootds_label() argument
3717 zerror(zlogp, B_TRUE, "unable to determine zone path"); in validate_rootds_label()
3725 zerror(zlogp, B_FALSE, "opening ZFS library"); in validate_rootds_label()
3731 zerror(zlogp, B_FALSE, "cannot open ZFS dataset for path '%s'", in validate_rootds_label()
3761 zerror(zlogp, B_FALSE, "cannot set 'mlslabel' " in validate_rootds_label()
3771 zerror(zlogp, B_FALSE, "invalid 'mlslabel' " in validate_rootds_label()
3782 zerror(zlogp, B_FALSE, "Rootpath dataset has mismatched label"); in validate_rootds_label()
3795 tsol_mounts(zlog_t *zlogp, char *zone_name, char *rootpath) in tsol_mounts() argument
3817 (void) make_one_dir(zlogp, rootpath, "/export/home", in tsol_mounts()
3830 zerror(zlogp, B_TRUE, "unable to list zones"); in tsol_mounts()
3842 zerror(zlogp, B_TRUE, "memory allocation failed"); in tsol_mounts()
3848 zerror(zlogp, B_TRUE, "unable to list zones"); in tsol_mounts()
3861 zerror(zlogp, B_TRUE, "%s failed", "priv_allocset"); in tsol_mounts()
3927 (void) make_one_dir(zlogp, "", in tsol_mounts()
3935 (void) domount(zlogp, MNTTYPE_AUTOFS, optstr, in tsol_mounts()
3996 if (make_one_dir(zlogp, in tsol_mounts()
4009 (void) mount_one(zlogp, &lower_fstab, "", in tsol_mounts()
4037 (void) mount_one(zlogp, &lower_fstab, "", in tsol_mounts()
4056 (void) forkexec(zlogp, "/usr/lib/zones/zoneshare", argv); in tsol_mounts()
4067 tsol_unmounts(zlog_t *zlogp, char *zone_name) in tsol_unmounts() argument
4098 zerror(zlogp, B_TRUE, "memory allocation failed"); in tsol_unmounts()
4179 (void) forkexec(zlogp, "/usr/lib/zones/zoneunshare", argv); in tsol_unmounts()
4191 (void) forkexec(zlogp, "/usr/sbin/deallocate", argv); in tsol_unmounts()
4200 get_zone_label(zlog_t *zlogp, priv_set_t *privs) in get_zone_label() argument
4207 zerror(zlogp, B_TRUE, "%s", TNZONECFG_PATH); in get_zone_label()
4227 zerror(zlogp, B_FALSE, "zone requires a label assignment. " in get_zone_label()
4236 zerror(zlogp, B_TRUE, "%s failed", "priv_allocset"); in get_zone_label()
4249 set_mlps(zlog_t *zlogp, zoneid_t zoneid, tsol_zcent_t *zcent) in set_mlps() argument
4262 zerror(zlogp, B_TRUE, "cannot set zone-specific MLP " in set_mlps()
4272 zerror(zlogp, B_TRUE, "cannot set shared MLP " in set_mlps()
4280 remove_mlps(zlog_t *zlogp, zoneid_t zoneid) in remove_mlps() argument
4290 zerror(zlogp, B_TRUE, "cannot flush MLPs"); in remove_mlps()
4305 duplicate_zone_root(zlog_t *zlogp, const char *rootpath) in duplicate_zone_root() argument
4318 zerror(zlogp, B_TRUE, "memory allocation failed"); in duplicate_zone_root()
4345 zerror(zlogp, B_FALSE, in duplicate_zone_root()
4361 duplicate_reachable_path(zlog_t *zlogp, const char *rootpath) in duplicate_reachable_path() argument
4367 zerror(zlogp, B_TRUE, "can't stat %s", rootpath); in duplicate_reachable_path()
4370 if (resolve_lofs_mnts == NULL && lofs_read_mnttab(zlogp) == -1) in duplicate_reachable_path()
4380 zerror(zlogp, B_FALSE, in duplicate_reachable_path()
4394 setup_zone_rm(zlog_t *zlogp, char *zone_name, zoneid_t zoneid) in setup_zone_rm() argument
4404 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in setup_zone_rm()
4409 zerror(zlogp, B_FALSE, "invalid configuration"); in setup_zone_rm()
4424 zerror(zlogp, B_TRUE, "could not set zone memory cap"); in setup_zone_rm()
4430 zerror(zlogp, B_FALSE, "enabling system/rcap service " in setup_zone_rm()
4442 zerror(zlogp, B_TRUE, "WARNING: unable to set the " in setup_zone_rm()
4458 zerror(zlogp, B_FALSE, "WARNING: unable to determine " in setup_zone_rm()
4462 zerror(zlogp, B_FALSE, "WARNING: The zone.cpu-shares " in setup_zone_rm()
4472 zerror(zlogp, B_TRUE, "WARNING: unable to set " in setup_zone_rm()
4492 zerror(zlogp, B_FALSE, "%s: %s\ndedicated-cpu setting " in setup_zone_rm()
4496 zerror(zlogp, B_FALSE, "could not bind zone to " in setup_zone_rm()
4506 zerror(zlogp, B_FALSE, "WARNING: A range of dedicated-cpus has " in setup_zone_rm()
4518 zerror(zlogp, B_FALSE, "WARNING: unable to bind to " in setup_zone_rm()
4521 zerror(zlogp, B_FALSE, "WARNING: %s: %s", in setup_zone_rm()
4524 zerror(zlogp, B_FALSE, "WARNING: %s", in setup_zone_rm()
4537 report_prop_err(zlog_t *zlogp, const char *name, const char *value, int res) in report_prop_err() argument
4541 zerror(zlogp, B_FALSE, "%s property value is too large.", name); in report_prop_err()
4545 zerror(zlogp, B_FALSE, "%s property value \"%s\" is not valid", in report_prop_err()
4550 zerror(zlogp, B_TRUE, "fetching property %s: %d", name, res); in report_prop_err()
4565 setup_zone_hostid(zone_dochandle_t handle, zlog_t *zlogp, zoneid_t zoneid) in setup_zone_hostid() argument
4576 report_prop_err(zlogp, "hostid", hostidp, res); in setup_zone_hostid()
4583 zerror(zlogp, B_TRUE, in setup_zone_hostid()
4592 setup_zone_fs_allowed(zone_dochandle_t handle, zlog_t *zlogp, zoneid_t zoneid) in setup_zone_fs_allowed() argument
4605 report_prop_err(zlogp, "fs-allowed", fsallowed, res); in setup_zone_fs_allowed()
4617 report_prop_err(zlogp, "fs-allowed", fsallowed, in setup_zone_fs_allowed()
4624 zerror(zlogp, B_TRUE, in setup_zone_fs_allowed()
4633 setup_zone_attrs(zlog_t *zlogp, char *zone_namep, zoneid_t zoneid) in setup_zone_attrs() argument
4639 zerror(zlogp, B_TRUE, "getting zone configuration handle"); in setup_zone_attrs()
4643 zerror(zlogp, B_FALSE, "invalid configuration"); in setup_zone_attrs()
4647 if ((res = setup_zone_hostid(handle, zlogp, zoneid)) != Z_OK) in setup_zone_attrs()
4650 if ((res = setup_zone_fs_allowed(handle, zlogp, zoneid)) != Z_OK) in setup_zone_attrs()
4659 vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd) in vplat_create() argument
4679 zerror(zlogp, B_TRUE, "unable to determine zone root"); in vplat_create()
4683 resolve_lofs(zlogp, rootpath, sizeof (rootpath)); in vplat_create()
4685 if (vplat_get_iptype(zlogp, &iptype) < 0) { in vplat_create()
4686 zerror(zlogp, B_TRUE, "unable to determine ip-type"); in vplat_create()
4699 zerror(zlogp, B_TRUE, "%s failed", "priv_allocset"); in vplat_create()
4703 if (get_privset(zlogp, privs, mount_cmd) != 0) in vplat_create()
4707 get_rctls(zlogp, &rctlbuf, &rctlbufsz) != 0) { in vplat_create()
4708 zerror(zlogp, B_FALSE, "Unable to get list of rctls"); in vplat_create()
4712 if (get_datasets(zlogp, &zfsbuf, &zfsbufsz) != 0) { in vplat_create()
4713 zerror(zlogp, B_FALSE, "Unable to get list of ZFS datasets"); in vplat_create()
4718 zcent = get_zone_label(zlogp, privs); in vplat_create()
4726 if (validate_rootds_label(zlogp, rootpath, zlabel) != 0) in vplat_create()
4738 if (duplicate_zone_root(zlogp, rootpath)) in vplat_create()
4740 if (duplicate_reachable_path(zlogp, rootpath)) in vplat_create()
4744 root_to_lu(zlogp, rootpath, sizeof (rootpath), B_TRUE); in vplat_create()
4756 zerror(zlogp, B_TRUE, "cannot create %s", rootpath); in vplat_create()
4759 if (domount(zlogp, "tmpfs", "", "swap", rootpath) != 0) in vplat_create()
4772 zerror(zlogp, B_TRUE, "cannot open mapfile"); in vplat_create()
4776 zerror(zlogp, B_TRUE, "cannot lock mapfile"); in vplat_create()
4781 zerror(zlogp, B_FALSE, "scratch zone already running"); in vplat_create()
4803 zerror(zlogp, B_FALSE, in vplat_create()
4808 zerror(zlogp, B_FALSE, in vplat_create()
4812 prtmount, zlogp); in vplat_create()
4815 zerror(zlogp, B_FALSE, "%s: " in vplat_create()
4822 zerror(zlogp, B_FALSE, "The zone label is already " in vplat_create()
4825 zerror(zlogp, B_TRUE, "%s failed", "zone_create"); in vplat_create()
4833 zerror(zlogp, B_TRUE, "cannot add mapfile entry"); in vplat_create()
4846 if (setup_zone_attrs(zlogp, zone_name, zoneid) != Z_OK) in vplat_create()
4850 zerror(zlogp, B_FALSE, in vplat_create()
4858 zerror(zlogp, B_FALSE, in vplat_create()
4869 zerror(zlogp, B_FALSE, in vplat_create()
4882 zerror(zlogp, B_TRUE, in vplat_create()
4888 if (setup_zone_rm(zlogp, zone_name, zoneid) != Z_OK) in vplat_create()
4891 set_mlps(zlogp, zoneid, zcent); in vplat_create()
4990 vplat_bringup(zlog_t *zlogp, zone_mnt_t mount_cmd, zoneid_t zoneid) in vplat_bringup() argument
4994 if (mount_cmd == Z_MNT_BOOT && validate_datasets(zlogp) != 0) { in vplat_bringup()
5007 resolve_lofs(zlogp, zonepath, sizeof (zonepath)); in vplat_bringup()
5010 if (make_one_dir(zlogp, zonepath, "/dev", DEFAULT_DIR_MODE, in vplat_bringup()
5016 if (mount_filesystems(zlogp, mount_cmd) != 0) { in vplat_bringup()
5024 if (vplat_get_iptype(zlogp, &iptype) < 0) { in vplat_bringup()
5025 zerror(zlogp, B_TRUE, "unable to determine ip-type"); in vplat_bringup()
5033 if (configure_shared_network_interfaces(zlogp) != 0) { in vplat_bringup()
5039 if (configure_exclusive_network_interfaces(zlogp, in vplat_bringup()
5056 lu_root_teardown(zlog_t *zlogp) in lu_root_teardown() argument
5061 zerror(zlogp, B_FALSE, "unable to determine zone root"); in lu_root_teardown()
5064 root_to_lu(zlogp, zroot, sizeof (zroot), B_FALSE); in lu_root_teardown()
5089 zerror(zlogp, B_TRUE, "unable to unmount '%s'", zroot); in lu_root_teardown()
5103 zerror(zlogp, B_TRUE, "cannot open mapfile"); in lu_root_teardown()
5108 zerror(zlogp, B_TRUE, "cannot lock mapfile"); in lu_root_teardown()
5110 zerror(zlogp, B_TRUE, "cannot delete map entry"); in lu_root_teardown()
5121 vplat_teardown(zlog_t *zlogp, boolean_t unmount_cmd, boolean_t rebooting) in vplat_teardown() argument
5139 zerror(zlogp, B_TRUE, "unable to open map file"); in vplat_teardown()
5144 zerror(zlogp, B_FALSE, "unable to find scratch zone"); in vplat_teardown()
5154 zerror(zlogp, B_TRUE, "unable to get zoneid"); in vplat_teardown()
5156 (void) lu_root_teardown(zlogp); in vplat_teardown()
5160 if (remove_datalink_pool(zlogp, zoneid) != 0) { in vplat_teardown()
5161 zerror(zlogp, B_FALSE, "unable clear datalink pool property"); in vplat_teardown()
5165 if (remove_datalink_protect(zlogp, zoneid) != 0) { in vplat_teardown()
5166 zerror(zlogp, B_FALSE, in vplat_teardown()
5179 zerror(zlogp, B_TRUE, "unable to shutdown zone"); in vplat_teardown()
5185 zerror(zlogp, B_FALSE, "unable to determine zone path"); in vplat_teardown()
5191 zerror(zlogp, B_FALSE, "unable to determine zone brand"); in vplat_teardown()
5202 zerror(zlogp, B_FALSE, "unable to determine branded zone's " in vplat_teardown()
5209 (do_subproc(zlogp, cmdbuf, NULL) != Z_OK)) { in vplat_teardown()
5210 zerror(zlogp, B_FALSE, "%s failed", cmdbuf); in vplat_teardown()
5219 if (vplat_get_iptype(zlogp, &iptype) < 0) { in vplat_teardown()
5220 zerror(zlogp, B_TRUE, "unable to determine " in vplat_teardown()
5233 if (unconfigure_shared_network_interfaces(zlogp, in vplat_teardown()
5235 zerror(zlogp, B_FALSE, "unable to unconfigure " in vplat_teardown()
5241 if (unconfigure_exclusive_network_interfaces(zlogp, in vplat_teardown()
5243 zerror(zlogp, B_FALSE, "unable to unconfigure " in vplat_teardown()
5249 zerror(zlogp, B_FALSE, "unable to notify " in vplat_teardown()
5257 if (!unmount_cmd && tcp_abort_connections(zlogp, zoneid) != 0) { in vplat_teardown()
5258 zerror(zlogp, B_TRUE, "unable to abort TCP connections"); in vplat_teardown()
5262 if (unmount_filesystems(zlogp, zoneid, unmount_cmd) != 0) { in vplat_teardown()
5263 zerror(zlogp, B_FALSE, in vplat_teardown()
5297 zerror(zlogp, B_FALSE, pool_err); in vplat_teardown()
5302 remove_mlps(zlogp, zoneid); in vplat_teardown()
5305 zerror(zlogp, B_TRUE, "unable to destroy zone"); in vplat_teardown()
5313 if (unmount_cmd && lu_root_teardown(zlogp) != 0) in vplat_teardown()