1153 curr_iptype = "shared";
1154 break;
1155 case ZS_EXCLUSIVE:
1156 curr_iptype = "exclusive";
1157 break;
1158 }
1159
1160 if (brand_platform_iter_devices(bh, zone_name,
1161 mount_one_dev_device_cb, prof, curr_iptype) != 0) {
1162 zerror(zlogp, B_TRUE, "failed to add standard device");
1163 goto cleanup;
1164 }
1165
1166 if (brand_platform_iter_link(bh,
1167 mount_one_dev_symlink_cb, prof) != 0) {
1168 zerror(zlogp, B_TRUE, "failed to add standard symlink");
1169 goto cleanup;
1170 }
1171
1172 /* Add user-specified devices and directories */
1173 if (err = zonecfg_setdevent(snap_hndl)) {
1174 zerror(zlogp, B_FALSE, "%s: %s", zone_name,
1175 zonecfg_strerror(err));
1176 goto cleanup;
1177 }
1178 while (zonecfg_getdevent(snap_hndl, &ztab) == Z_OK) {
1179 if (di_prof_add_dev(prof, ztab.zone_dev_match)) {
1180 zerror(zlogp, B_TRUE, "failed to add "
1181 "user-specified device");
1182 goto cleanup;
1183 }
1184 }
1185 (void) zonecfg_enddevent(snap_hndl);
1186
1187 /* Send profile to kernel */
1188 if (di_prof_commit(prof)) {
1189 zerror(zlogp, B_TRUE, "failed to commit profile");
1190 goto cleanup;
1191 }
1192
1193 retval = 0;
|
1153 curr_iptype = "shared";
1154 break;
1155 case ZS_EXCLUSIVE:
1156 curr_iptype = "exclusive";
1157 break;
1158 }
1159
1160 if (brand_platform_iter_devices(bh, zone_name,
1161 mount_one_dev_device_cb, prof, curr_iptype) != 0) {
1162 zerror(zlogp, B_TRUE, "failed to add standard device");
1163 goto cleanup;
1164 }
1165
1166 if (brand_platform_iter_link(bh,
1167 mount_one_dev_symlink_cb, prof) != 0) {
1168 zerror(zlogp, B_TRUE, "failed to add standard symlink");
1169 goto cleanup;
1170 }
1171
1172 /* Add user-specified devices and directories */
1173 if ((err = zonecfg_setdevent(snap_hndl)) != 0) {
1174 zerror(zlogp, B_FALSE, "%s: %s", zone_name,
1175 zonecfg_strerror(err));
1176 goto cleanup;
1177 }
1178 while (zonecfg_getdevent(snap_hndl, &ztab) == Z_OK) {
1179 if (di_prof_add_dev(prof, ztab.zone_dev_match)) {
1180 zerror(zlogp, B_TRUE, "failed to add "
1181 "user-specified device");
1182 goto cleanup;
1183 }
1184 }
1185 (void) zonecfg_enddevent(snap_hndl);
1186
1187 /* Send profile to kernel */
1188 if (di_prof_commit(prof)) {
1189 zerror(zlogp, B_TRUE, "failed to commit profile");
1190 goto cleanup;
1191 }
1192
1193 retval = 0;
|