Lines Matching defs:zent
414 zone_print(zone_entry_t *zent, boolean_t verbose, boolean_t parsable)
420 if (zent->zname[0] == '\0')
423 if (zent->ziptype == ZS_EXCLUSIVE)
439 (void) printf("%s\n", zent->zname);
442 if (zent->zid == ZONE_ID_UNDEFINED)
445 (void) printf("%lu", zent->zid);
446 (void) printf(":%s:%s:", zent->zname, zent->zstate_str);
447 cp = zent->zroot;
452 (void) printf("%s:%s:%s:%s\n", cp, zent->zuuid, zent->zbrand,
456 if (zent->zstate_str != NULL) {
457 if (zent->zid == ZONE_ID_UNDEFINED)
460 (void) printf("%*lu", ZONEID_WIDTH, zent->zid);
461 (void) printf(" %-16s %-10s %-30s %-8s %-6s\n", zent->zname,
462 zent->zstate_str, zent->zroot, zent->zbrand, ip_type_str);
467 lookup_zone_info(const char *zone_name, zoneid_t zid, zone_entry_t *zent)
474 (void) strlcpy(zent->zname, zone_name, sizeof (zent->zname));
475 (void) strlcpy(zent->zroot, "???", sizeof (zent->zroot));
476 (void) strlcpy(zent->zbrand, "???", sizeof (zent->zbrand));
477 zent->zstate_str = "???";
479 zent->zid = zid;
483 uuid_unparse(uuid, zent->zuuid);
485 zent->zuuid[0] = '\0';
494 if (is_system_labeled() && zent->zid != ZONE_ID_UNDEFINED) {
495 if (zone_getattr(zent->zid, ZONE_ATTR_ROOT, zent->zroot,
496 sizeof (zent->zroot)) == -1) {
497 zperror2(zent->zname,
501 cp = zent->zroot + strlen(zent->zroot) - 5;
502 if (cp > zent->zroot && strcmp(cp, "/root") == 0)
505 if ((err = zone_get_zonepath(zent->zname, root,
508 zperror2(zent->zname,
512 (void) strlcpy(zent->zroot, root, sizeof (zent->zroot));
515 if ((err = zone_get_state(zent->zname, &zent->zstate_num)) != Z_OK) {
517 zperror2(zent->zname, gettext("could not get state"));
520 zent->zstate_str = zone_state_str(zent->zstate_num);
531 (void) strlcpy(zent->zbrand, default_brand,
532 sizeof (zent->zbrand));
533 } else if (zone_get_brand(zent->zname, zent->zbrand,
534 sizeof (zent->zbrand)) != Z_OK) {
535 zperror2(zent->zname, gettext("could not get brand name"));
544 zent->ziptype = ZS_SHARED;
558 if (zent->zstate_num == ZONE_STATE_RUNNING &&
565 zent->ziptype = ZS_EXCLUSIVE;
567 zent->ziptype = ZS_SHARED;
573 zperror2(zent->zname, gettext("could not init handle"));
576 if ((err = zonecfg_get_handle(zent->zname, handle)) != Z_OK) {
577 zperror2(zent->zname, gettext("could not get handle"));
582 if ((err = zonecfg_get_iptype(handle, &zent->ziptype)) != Z_OK) {
583 zperror2(zent->zname, gettext("could not get ip-type"));
711 zone_entry_t zent;
744 if (lookup_zone_info(name, ZONE_ID_UNDEFINED, &zent) != Z_OK) {
749 if (zent.zstate_num >= min_state)
750 zone_print(&zent, verbose, parsable);
1338 zone_entry_t *zentp, zent;
1387 fake_up_local_zone(zone_id, &zent);
1389 zone_print(&zent, verbose, parsable);
1424 fake_up_local_zone(zone_id, &zent);
1431 assert(strcmp(zent.zname, target_zone) == 0);
1432 zone_print(&zent, verbose, parsable);
1438 &zent) == Z_OK) {
1439 zone_print(&zent, verbose, parsable);
1587 zone_entry_t *zent;
1654 zent = lookup_running_zone(zone);
1656 zent = NULL;
1660 zent = lookup_running_zone(kernzone);
1662 zent = NULL;
1670 if (zent == NULL) {
1677 if (unsafe_when_running && zent != NULL) {
1679 if ((err = zone_get_state(zent->zname,
1680 &zent->zstate_num)) != Z_OK) {
1682 zperror2(zent->zname,
1685 zent->zstate_str = "ready/running";
1687 zent->zstate_str =
1688 zone_state_str(zent->zstate_num);
1691 cmd_to_str(cmd_num), zent->zstate_str);
3447 zone_entry_t *zent;
3524 zent = lookup_running_zone(source_zone);
3525 if (zent != NULL) {
3527 if ((err = zone_get_state(zent->zname,
3528 &zent->zstate_num)) != Z_OK) {
3530 zperror2(zent->zname, gettext("could not get "
3533 zent->zstate_str = "ready/running";
3535 zent->zstate_str =
3536 zone_state_str(zent->zstate_num);
3539 cmd_to_str(CMD_CLONE), zent->zstate_str);