Lines Matching refs:zent

422 zone_print(zone_entry_t *zent, boolean_t verbose, boolean_t parsable)  in zone_print()  argument
428 if (zent->zname[0] == '\0') in zone_print()
431 if (zent->ziptype == ZS_EXCLUSIVE) in zone_print()
447 (void) printf("%s\n", zent->zname); in zone_print()
450 if (zent->zid == ZONE_ID_UNDEFINED) in zone_print()
453 (void) printf("%lu", zent->zid); in zone_print()
454 (void) printf(":%s:%s:", zent->zname, zent->zstate_str); in zone_print()
455 cp = zent->zroot; in zone_print()
460 (void) printf("%s:%s:%s:%s\n", cp, zent->zuuid, zent->zbrand, in zone_print()
464 if (zent->zstate_str != NULL) { in zone_print()
465 if (zent->zid == ZONE_ID_UNDEFINED) in zone_print()
468 (void) printf("%*lu", ZONEID_WIDTH, zent->zid); in zone_print()
469 (void) printf(" %-16s %-10s %-30s %-8s %-6s\n", zent->zname, in zone_print()
470 zent->zstate_str, zent->zroot, zent->zbrand, ip_type_str); in zone_print()
475 lookup_zone_info(const char *zone_name, zoneid_t zid, zone_entry_t *zent) in lookup_zone_info() argument
482 (void) strlcpy(zent->zname, zone_name, sizeof (zent->zname)); in lookup_zone_info()
483 (void) strlcpy(zent->zroot, "???", sizeof (zent->zroot)); in lookup_zone_info()
484 (void) strlcpy(zent->zbrand, "???", sizeof (zent->zbrand)); in lookup_zone_info()
485 zent->zstate_str = "???"; in lookup_zone_info()
487 zent->zid = zid; in lookup_zone_info()
491 uuid_unparse(uuid, zent->zuuid); in lookup_zone_info()
493 zent->zuuid[0] = '\0'; in lookup_zone_info()
502 if (is_system_labeled() && zent->zid != ZONE_ID_UNDEFINED) { in lookup_zone_info()
503 if (zone_getattr(zent->zid, ZONE_ATTR_ROOT, zent->zroot, in lookup_zone_info()
504 sizeof (zent->zroot)) == -1) { in lookup_zone_info()
505 zperror2(zent->zname, in lookup_zone_info()
509 cp = zent->zroot + strlen(zent->zroot) - 5; in lookup_zone_info()
510 if (cp > zent->zroot && strcmp(cp, "/root") == 0) in lookup_zone_info()
513 if ((err = zone_get_zonepath(zent->zname, root, in lookup_zone_info()
516 zperror2(zent->zname, in lookup_zone_info()
520 (void) strlcpy(zent->zroot, root, sizeof (zent->zroot)); in lookup_zone_info()
523 if ((err = zone_get_state(zent->zname, &zent->zstate_num)) != Z_OK) { in lookup_zone_info()
525 zperror2(zent->zname, gettext("could not get state")); in lookup_zone_info()
528 zent->zstate_str = zone_state_str(zent->zstate_num); in lookup_zone_info()
539 (void) strlcpy(zent->zbrand, default_brand, in lookup_zone_info()
540 sizeof (zent->zbrand)); in lookup_zone_info()
541 } else if (zone_get_brand(zent->zname, zent->zbrand, in lookup_zone_info()
542 sizeof (zent->zbrand)) != Z_OK) { in lookup_zone_info()
543 zperror2(zent->zname, gettext("could not get brand name")); in lookup_zone_info()
552 zent->ziptype = ZS_SHARED; in lookup_zone_info()
566 if (zent->zstate_num == ZONE_STATE_RUNNING && in lookup_zone_info()
573 zent->ziptype = ZS_EXCLUSIVE; in lookup_zone_info()
575 zent->ziptype = ZS_SHARED; in lookup_zone_info()
581 zperror2(zent->zname, gettext("could not init handle")); in lookup_zone_info()
584 if ((err = zonecfg_get_handle(zent->zname, handle)) != Z_OK) { in lookup_zone_info()
585 zperror2(zent->zname, gettext("could not get handle")); in lookup_zone_info()
590 if ((err = zonecfg_get_iptype(handle, &zent->ziptype)) != Z_OK) { in lookup_zone_info()
591 zperror2(zent->zname, gettext("could not get ip-type")); in lookup_zone_info()
719 zone_entry_t zent; in zone_print_list() local
752 if (lookup_zone_info(name, ZONE_ID_UNDEFINED, &zent) != Z_OK) { in zone_print_list()
757 if (zent.zstate_num >= min_state) in zone_print_list()
758 zone_print(&zent, verbose, parsable); in zone_print_list()
1369 zone_entry_t *zentp, zent; in list_func() local
1418 fake_up_local_zone(zone_id, &zent); in list_func()
1420 zone_print(&zent, verbose, parsable); in list_func()
1455 fake_up_local_zone(zone_id, &zent); in list_func()
1462 assert(strcmp(zent.zname, target_zone) == 0); in list_func()
1463 zone_print(&zent, verbose, parsable); in list_func()
1469 &zent) == Z_OK) { in list_func()
1470 zone_print(&zent, verbose, parsable); in list_func()
1619 zone_entry_t *zent; in sanity_check() local
1690 zent = lookup_running_zone(zone); in sanity_check()
1692 zent = NULL; in sanity_check()
1696 zent = lookup_running_zone(kernzone); in sanity_check()
1698 zent = NULL; in sanity_check()
1706 if (zent == NULL) { in sanity_check()
1713 if (unsafe_when_running && zent != NULL) { in sanity_check()
1715 if ((err = zone_get_state(zent->zname, in sanity_check()
1716 &zent->zstate_num)) != Z_OK) { in sanity_check()
1718 zperror2(zent->zname, in sanity_check()
1721 zent->zstate_str = "ready/running"; in sanity_check()
1723 zent->zstate_str = in sanity_check()
1724 zone_state_str(zent->zstate_num); in sanity_check()
1727 cmd_to_str(cmd_num), zent->zstate_str); in sanity_check()
3552 zone_entry_t *zent; in clone_func() local
3629 zent = lookup_running_zone(source_zone); in clone_func()
3630 if (zent != NULL) { in clone_func()
3632 if ((err = zone_get_state(zent->zname, in clone_func()
3633 &zent->zstate_num)) != Z_OK) { in clone_func()
3635 zperror2(zent->zname, gettext("could not get " in clone_func()
3638 zent->zstate_str = "ready/running"; in clone_func()
3640 zent->zstate_str = in clone_func()
3641 zone_state_str(zent->zstate_num); in clone_func()
3644 cmd_to_str(CMD_CLONE), zent->zstate_str); in clone_func()