Print this page
OS-1572 Explicitly handle all possible enum values in switches
Reviewed by: Robert Mustacchi <rm@joyent.com>

*** 1530,1539 **** --- 1530,1540 ---- */ zerror(zlogp, B_FALSE, "zone is already ready"); rval = 0; break; case Z_BOOT: + case Z_FORCEBOOT: (void) strlcpy(boot_args, zargp->bootbuf, sizeof (boot_args)); eventstream_write(Z_EVT_ZONE_BOOTING); rval = zone_bootup(zlogp, zargp->bootbuf, zstate, debug);
*** 1555,1564 **** --- 1556,1566 ---- eventstream_write(Z_EVT_ZONE_HALTED); break; case Z_REBOOT: case Z_NOTE_UNINSTALLING: case Z_MOUNT: + case Z_FORCEMOUNT: case Z_UNMOUNT: if (kernelcall) /* Invalid; can't happen */ abort(); zerror(zlogp, B_FALSE, "%s operation is invalid " "for zones in state '%s'", z_cmd_name(cmd),
*** 1603,1612 **** --- 1605,1615 ---- eventstream_write(Z_EVT_ZONE_READIED); else eventstream_write(Z_EVT_ZONE_HALTED); break; case Z_BOOT: + case Z_FORCEBOOT: /* * We could have two clients racing to boot this * zone; the second client loses, but his request * doesn't fail, since the zone is now in the desired * state.
*** 1646,1655 **** --- 1649,1659 ---- } boot_args[0] = '\0'; break; case Z_NOTE_UNINSTALLING: case Z_MOUNT: + case Z_FORCEMOUNT: case Z_UNMOUNT: zerror(zlogp, B_FALSE, "%s operation is invalid " "for zones in state '%s'", z_cmd_name(cmd), zone_state_str(zstate)); rval = -1;