Print this page
OS-192 zone_create() warning on headnode

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/zoneadmd/vplat.c
          +++ new/usr/src/cmd/zoneadmd/vplat.c
↓ open down ↓ 4745 lines elided ↑ open up ↑
4746 4746                  goto out;
4747 4747  
4748 4748          if ((res = setup_zone_secflags(handle, zlogp, zoneid)) != Z_OK)
4749 4749                  goto out;
4750 4750  
4751 4751  out:
4752 4752          zonecfg_fini_handle(handle);
4753 4753          return (res);
4754 4754  }
4755 4755  
     4756 +/*
     4757 + * The zone_did is a persistent debug ID.  Each zone should have a unique ID
     4758 + * in the kernel.  This is used for things like DTrace which want to monitor
     4759 + * zones across reboots.  They can't use the zoneid since that changes on
     4760 + * each boot.
     4761 + */
4756 4762  zoneid_t
4757      -vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd)
     4763 +vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd, zoneid_t zone_did)
4758 4764  {
4759 4765          zoneid_t rval = -1;
4760 4766          priv_set_t *privs;
4761 4767          char rootpath[MAXPATHLEN];
4762 4768          char *rctlbuf = NULL;
4763 4769          size_t rctlbufsz = 0;
4764 4770          char *zfsbuf = NULL;
4765 4771          size_t zfsbufsz = 0;
4766 4772          zoneid_t zoneid = -1;
4767 4773          int xerr;
↓ open down ↓ 120 lines elided ↑ open up ↑
4888 4894                          /* This is just an arbitrary name; note "." usage */
4889 4895                          (void) snprintf(kernzone, sizeof (kernzone),
4890 4896                              "SUNWlu.%08lX%08lX", random(), random());
4891 4897                  }
4892 4898                  kzone = kernzone;
4893 4899          }
4894 4900  
4895 4901          xerr = 0;
4896 4902          if ((zoneid = zone_create(kzone, rootpath, privs, rctlbuf,
4897 4903              rctlbufsz, zfsbuf, zfsbufsz, &xerr, match, doi, zlabel,
4898      -            flags)) == -1) {
     4904 +            flags, zone_did)) == -1) {
4899 4905                  if (xerr == ZE_AREMOUNTS) {
4900 4906                          if (zonecfg_find_mounts(rootpath, NULL, NULL) < 1) {
4901 4907                                  zerror(zlogp, B_FALSE,
4902 4908                                      "An unknown file-system is mounted on "
4903 4909                                      "a subdirectory of %s", rootpath);
4904 4910                          } else {
4905 4911  
4906 4912                                  zerror(zlogp, B_FALSE,
4907 4913                                      "These file-systems are mounted on "
4908 4914                                      "subdirectories of %s:", rootpath);
↓ open down ↓ 512 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX