diff options
author | sl108498 <none@none> | 2006-12-14 15:46:12 -0800 |
---|---|---|
committer | sl108498 <none@none> | 2006-12-14 15:46:12 -0800 |
commit | c1c0ebd597fd6db650197255bc1248c9f60afad8 (patch) | |
tree | 506d32f0a6e810933d277fae2b2741c032abe105 | |
parent | 16bd72582c60c40e83c55713078d05a462655a73 (diff) | |
download | illumos-joyent-c1c0ebd597fd6db650197255bc1248c9f60afad8.tar.gz |
6354498 rctl_local_replace_cb needs to remove new value when deletion fails
6504130 pool service not enabled when zone with tmp pool not booted before reboot
6504424 halting zones in parallel can fail, unable to unconfigure network interfaces
-rw-r--r-- | usr/src/cmd/zoneadmd/vplat.c | 10 | ||||
-rw-r--r-- | usr/src/lib/libpool/Makefile.com | 2 | ||||
-rw-r--r-- | usr/src/lib/libpool/common/pool.c | 27 | ||||
-rw-r--r-- | usr/src/uts/common/os/rctl.c | 15 |
4 files changed, 48 insertions, 6 deletions
diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c index 513921e5e2..26fd72ba64 100644 --- a/usr/src/cmd/zoneadmd/vplat.c +++ b/usr/src/cmd/zoneadmd/vplat.c @@ -1768,9 +1768,15 @@ unconfigure_network_interfaces(zlog_t *zlogp, zoneid_t zone_id) (void) strncpy(lifrl.lifr_name, lifrp->lifr_name, sizeof (lifrl.lifr_name)); if (ioctl(s, SIOCGLIFZONE, (caddr_t)&lifrl) < 0) { + if (errno == ENXIO) + /* + * Interface may have been removed by admin or + * another zone halting. + */ + continue; zerror(zlogp, B_TRUE, - "%s: could not determine zone interface belongs to", - lifrl.lifr_name); + "%s: could not determine the zone to which this " + "interface is bound", lifrl.lifr_name); ret_code = -1; continue; } diff --git a/usr/src/lib/libpool/Makefile.com b/usr/src/lib/libpool/Makefile.com index 0431dc906e..2468ac3cb2 100644 --- a/usr/src/lib/libpool/Makefile.com +++ b/usr/src/lib/libpool/Makefile.com @@ -44,7 +44,7 @@ include ../../Makefile.lib DYNFLAGS += -lxml2 LIBS = $(DYNLIB) $(LINTLIB) -LDLIBS += -lnvpair -lexacct -lc +LDLIBS += -lscf -lnvpair -lexacct -lc SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libpool/common/pool.c b/usr/src/lib/libpool/common/pool.c index 6fbd7b34d3..31e725e439 100644 --- a/usr/src/lib/libpool/common/pool.c +++ b/usr/src/lib/libpool/common/pool.c @@ -39,6 +39,7 @@ #include <errno.h> #include <ctype.h> #include <libintl.h> +#include <libscf.h> #include <pool.h> #include <signal.h> @@ -721,6 +722,7 @@ pool_set_status(int state) if (old_state != state) { int fd; pool_status_t status; + char *fmri; /* * Changing the status of pools is performed by enabling @@ -732,11 +734,12 @@ pool_set_status(int state) * synchronous using the library API as yet, so we use * the -s option provided by svcadm. */ - if (getenv("SMF_FMRI") == NULL) { + fmri = getenv("SMF_FMRI"); + if (fmri == NULL) { FILE *p; char *cmd; - if (state) { + if (state != 0) { cmd = "/usr/sbin/svcadm enable -s " \ SMF_SVC_INSTANCE; } else { @@ -755,6 +758,26 @@ pool_set_status(int state) return (PO_FAIL); } + /* + * If pools are being enabled/disabled by another smf service, + * enable the smf service instance. This must be done + * asynchronously as one service cannot synchronously + * enable/disable another. + */ + if (strcmp(fmri, SMF_SVC_INSTANCE) != 0) { + int res; + + if (state != 0) + res = smf_enable_instance(SMF_SVC_INSTANCE, 0); + else + res = smf_disable_instance(SMF_SVC_INSTANCE, 0); + + if (res != 0) { + (void) close(fd); + pool_seterror(POE_SYSTEM); + return (PO_FAIL); + } + } status.ps_io_state = state; if (ioctl(fd, POOL_STATUS, &status) < 0) { diff --git a/usr/src/uts/common/os/rctl.c b/usr/src/uts/common/os/rctl.c index c0479005ea..026d6b13ed 100644 --- a/usr/src/uts/common/os/rctl.c +++ b/usr/src/uts/common/os/rctl.c @@ -1693,6 +1693,17 @@ rctl_local_replace_cb(rctl_hndl_t hndl, struct proc *p, rctl_entity_p_t *e, rctl_t *rctl, rctl_val_t *oval, rctl_val_t *nval) { int ret; + rctl_val_t *tmp; + + /* Verify that old will be delete-able */ + tmp = rctl_val_list_find(&rctl->rc_values, oval); + if (tmp == NULL) + return (ESRCH); + /* + * Caller should verify that value being deleted is not the + * system value. + */ + ASSERT(tmp->rcv_privilege != RCPRIV_SYSTEM); /* * rctl_local_insert_cb() does the job of flagging an error @@ -1706,7 +1717,9 @@ rctl_local_replace_cb(rctl_hndl_t hndl, struct proc *p, rctl_entity_p_t *e, if (ret = rctl_local_insert_cb(hndl, p, e, rctl, NULL, nval)) return (ret); - return (rctl_local_delete_cb(hndl, p, e, rctl, NULL, oval)); + ret = rctl_local_delete_cb(hndl, p, e, rctl, NULL, oval); + ASSERT(ret == 0); + return (0); } /* |