summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2011-02-16 15:50:35 -0800
committerJerry Jelinek <jerry.jelinek@joyent.com>2011-02-16 15:50:35 -0800
commit2f1b2b0ef09d980f100beecdb6d9208edd3c973c (patch)
treed75db25957e7e7ebac8e757c553ec267a6c63e84 /usr/src/cmd
parent2e90f839a513a397c7bc8eb94b3b7e0139120cb4 (diff)
downloadillumos-joyent-2f1b2b0ef09d980f100beecdb6d9208edd3c973c.tar.gz
OS-223 zone's should create vnics as needed instead of requiring them to be set up in advance
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/zoneadm/zoneadm.c5
-rw-r--r--usr/src/cmd/zoneadmd/vplat.c6
-rw-r--r--usr/src/cmd/zoneadmd/zoneadmd.c20
3 files changed, 16 insertions, 15 deletions
diff --git a/usr/src/cmd/zoneadm/zoneadm.c b/usr/src/cmd/zoneadm/zoneadm.c
index 342cabb0f3..80e7528929 100644
--- a/usr/src/cmd/zoneadm/zoneadm.c
+++ b/usr/src/cmd/zoneadm/zoneadm.c
@@ -2598,11 +2598,6 @@ verify_handle(int cmd_num, zone_dochandle_t handle, char *argv[])
dladm_close(dh);
}
if (status != DLADM_STATUS_OK) {
- (void) fprintf(stderr,
- gettext("WARNING: skipping network "
- "interface '%s': %s\n"),
- nwiftab.zone_nwif_physical,
- dladm_status2str(status, errmsg));
break;
}
dl_owner_zid = ALL_ZONES;
diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c
index 628e82b4ba..c9edf5e276 100644
--- a/usr/src/cmd/zoneadmd/vplat.c
+++ b/usr/src/cmd/zoneadmd/vplat.c
@@ -2184,13 +2184,7 @@ configure_one_interface(zlog_t *zlogp, zoneid_t zone_id,
if (ioctl(s, SIOCLIFADDIF, (caddr_t)&lifr) < 0) {
/*
* Here, we know that the interface can't be brought up.
- * A similar warning message was already printed out to
- * the console by zoneadm(1M) so instead we log the
- * message to syslog and continue.
*/
- zerror(&logsys, B_TRUE, "WARNING: skipping network interface "
- "'%s' which may not be present/plumbed in the "
- "global zone.", lifr.lifr_name);
(void) close(s);
return (Z_OK);
}
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c
index 9a28e6c3f5..ae1306849e 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.c
+++ b/usr/src/cmd/zoneadmd/zoneadmd.c
@@ -741,14 +741,20 @@ mount_early_fs(void *data, const char *spec, const char *dir,
/*
* env variable name format
- * _ZONECFG;{resource name};{identifying attr. name};{property name}
+ * _ZONECFG_{resource name}_{identifying attr. name}_{property name}
+ * Any dashes (-) in the property names are replaced with underscore (_).
*/
static void
set_zonecfg_env(char *phys, char *name, char *val)
{
+ char *p;
char nm[MAXNAMELEN];
- (void) snprintf(nm, sizeof (nm), "_ZONECFG;net;%s;%s", phys, name);
+ (void) snprintf(nm, sizeof (nm), "_ZONECFG_net_%s_%s", phys, name);
+
+ p = nm;
+ while ((p = strchr(p, '-')) != NULL)
+ *p++ = '_';
(void) setenv(nm, val, 1);
}
@@ -765,10 +771,12 @@ setup_subproc_env()
int res;
zone_dochandle_t handle;
struct zone_nwiftab ntab;
+ char net_resources[MAXNAMELEN * 2];
if ((handle = zonecfg_init_handle()) == NULL)
exit(Z_NOMEM);
+ net_resources[0] = '\0';
if ((res = zonecfg_get_handle(zone_name, handle)) != Z_OK)
goto done;
@@ -781,8 +789,10 @@ setup_subproc_env()
phys = ntab.zone_nwif_physical;
- set_zonecfg_env(phys, "physical",
- ntab.zone_nwif_physical);
+ (void) strlcat(net_resources, phys, sizeof (net_resources));
+ (void) strlcat(net_resources, " ", sizeof (net_resources));
+
+ set_zonecfg_env(phys, "physical", phys);
set_zonecfg_env(phys, "address", ntab.zone_nwif_address);
set_zonecfg_env(phys, "allowed-address",
@@ -798,6 +808,8 @@ setup_subproc_env()
np->zone_nwif_attr_value);
}
+ (void) setenv("_ZONECFG_net_resources", net_resources, 1);
+
(void) zonecfg_endnwifent(handle);
res = Z_OK;