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

@@ -1530,10 +1530,11 @@
                          */
                         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,10 +1556,11 @@
                         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,10 +1605,11 @@
                                 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,10 +1649,11 @@
                         }
                         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;