summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2022-04-25 13:19:49 +0300
committerToomas Soome <tsoome@me.com>2022-05-03 00:30:50 +0300
commit2a22bccab8733d6de38ab1e1fbe8c810122a4427 (patch)
tree048ef4a3fddfcaebaf12ce218939d30b0fe293c2
parente0994bd28f025d3d74315f7479562b6be19773c3 (diff)
downloadillumos-joyent-2a22bccab8733d6de38ab1e1fbe8c810122a4427.tar.gz
14657 zoneadmd: remove warning gags and add ctf support
Reviewed by: Jason King <jason.brian.king+illumos@gmail.com> Reviewed by: Juraj Lutter <juraj@lutter.sk> Approved by: Robert Mustacchi <rm@fingolfin.org>
-rw-r--r--usr/src/cmd/zoneadmd/Makefile6
-rw-r--r--usr/src/cmd/zoneadmd/vplat.c20
-rw-r--r--usr/src/cmd/zoneadmd/zoneadmd.c6
3 files changed, 18 insertions, 14 deletions
diff --git a/usr/src/cmd/zoneadmd/Makefile b/usr/src/cmd/zoneadmd/Makefile
index 04b3ab3078..e75453fe56 100644
--- a/usr/src/cmd/zoneadmd/Makefile
+++ b/usr/src/cmd/zoneadmd/Makefile
@@ -29,6 +29,7 @@
PROG= zoneadmd
include ../Makefile.cmd
+include ../Makefile.ctf
ROOTCMDDIR= $(ROOTLIB)/zones
@@ -38,9 +39,6 @@ POFILE=zoneadmd_all.po
POFILES= $(OBJS:%.o=%.po)
CFLAGS += $(CCVERBOSE)
-CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += $(CNOWARN_UNINIT)
LDLIBS += -lsocket -lzonecfg -lnsl -ldevinfo -ldevice -lnvpair \
-lgen -lbsm -lcontract -lzfs -luuid -lbrand -ldladm -ltsnet -ltsol \
@@ -66,8 +64,6 @@ $(POFILE): $(POFILES)
clean:
$(RM) $(OBJS)
-lint: lint_SRCS
-
check:
$(CSTYLE) -p -P $(SRCS:%=%)
diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c
index 47b2954327..cbba769f94 100644
--- a/usr/src/cmd/zoneadmd/vplat.c
+++ b/usr/src/cmd/zoneadmd/vplat.c
@@ -1142,6 +1142,9 @@ mount_one_dev(zlog_t *zlogp, char *devpath, zone_mnt_t mount_cmd)
case ZS_EXCLUSIVE:
curr_iptype = "exclusive";
break;
+ default:
+ zerror(zlogp, B_FALSE, "bad ip-type");
+ goto cleanup;
}
if (brand_platform_iter_devices(bh, zone_name,
@@ -1161,12 +1164,12 @@ mount_one_dev(zlog_t *zlogp, char *devpath, zone_mnt_t mount_cmd)
zerror(zlogp, B_FALSE, "can't initialize zone handle");
goto cleanup;
}
- if (err = zonecfg_get_handle(zone_name, handle)) {
+ if ((err = zonecfg_get_handle(zone_name, handle)) != 0) {
zerror(zlogp, B_FALSE, "can't get handle for zone "
"%s: %s", zone_name, zonecfg_strerror(err));
goto cleanup;
}
- if (err = zonecfg_setdevent(handle)) {
+ if ((err = zonecfg_setdevent(handle)) != 0) {
zerror(zlogp, B_FALSE, "%s: %s", zone_name,
zonecfg_strerror(err));
goto cleanup;
@@ -3290,6 +3293,10 @@ get_privset(zlog_t *zlogp, priv_set_t *privs, zone_mnt_t mount_cmd)
case ZS_EXCLUSIVE:
curr_iptype = "exclusive";
break;
+ default:
+ zerror(zlogp, B_FALSE, "bad ip-type");
+ zonecfg_fini_handle(handle);
+ return (-1);
}
if (zonecfg_default_privset(privs, curr_iptype) == Z_OK) {
@@ -4839,13 +4846,10 @@ vplat_create(zlog_t *zlogp, zone_mnt_t mount_cmd)
zerror(zlogp, B_TRUE, "unable to determine ip-type");
return (-1);
}
- switch (iptype) {
- case ZS_SHARED:
- flags = 0;
- break;
- case ZS_EXCLUSIVE:
+ if (iptype == ZS_EXCLUSIVE) {
flags = ZCF_NET_EXCL;
- break;
+ } else {
+ flags = 0;
}
if ((privs = priv_allocset()) == NULL) {
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c
index 4bc7d86582..b1c2d2bbf5 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.c
+++ b/usr/src/cmd/zoneadmd/zoneadmd.c
@@ -1205,7 +1205,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
zone_cmd_t cmd;
zone_cmd_arg_t *zargp;
- boolean_t kernelcall;
+ boolean_t kernelcall = B_FALSE;
int rval = -1;
uint64_t uniqid;
@@ -1490,6 +1490,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
zerror(zlogp, B_FALSE, "zone is already ready");
rval = 0;
break;
+ case Z_FORCEBOOT:
case Z_BOOT:
(void) strlcpy(boot_args, zargp->bootbuf,
sizeof (boot_args));
@@ -1515,6 +1516,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
case Z_SHUTDOWN:
case Z_REBOOT:
case Z_NOTE_UNINSTALLING:
+ case Z_FORCEMOUNT:
case Z_MOUNT:
case Z_UNMOUNT:
if (kernelcall) /* Invalid; can't happen */
@@ -1562,6 +1564,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
else
eventstream_write(Z_EVT_ZONE_HALTED);
break;
+ case Z_FORCEBOOT:
case Z_BOOT:
/*
* We could have two clients racing to boot this
@@ -1609,6 +1612,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp,
}
break;
case Z_NOTE_UNINSTALLING:
+ case Z_FORCEMOUNT:
case Z_MOUNT:
case Z_UNMOUNT:
zerror(zlogp, B_FALSE, "%s operation is invalid "