[OmniOS-discuss] r151020 zone clone failure

Dan McDonald danmcd at omniti.com
Fri Nov 11 21:06:15 UTC 2016


> On Nov 11, 2016, at 3:45 PM, Michael Talbott <mtalbott at lji.org> wrote:
> 
> That seems to have done the trick. Many thanks.

Oh cool!

Below is the patch.  I merged something in from Joyent without considering consequences.  I'm having them look at the fix to make sure I don't shoot LX in the foot, but my test rig's LX zones are behaving normally.  And worse, the Joyent change in question was brought up in the illumos developer list as I was deep in pushing 020 out the door, so I didn't see it.

When this fix hits the repos, it'll require only one package update, but it's a reboot-your-box update.

Sorry for this again,
Dan

diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c
index 0a728000..1fb8275 100644
--- a/usr/src/cmd/zoneadmd/zoneadmd.c
+++ b/usr/src/cmd/zoneadmd/zoneadmd.c
@@ -554,9 +554,16 @@ static int
 zone_ready(zlog_t *zlogp, zone_mnt_t mount_cmd, int zstate)
 {
        int err;
+       boolean_t do_prestate;
 
-       if (!ALT_MOUNT(mount_cmd) &&
-           brand_prestatechg(zlogp, zstate, Z_READY) != 0)
+       /*
+        * LX zones don't like prestate/poststate being done on non-booting
+        * mount commands.  Other zones may, so be picky about when/when-not
+        * to invoke pre/post state change.
+        */
+       do_prestate = (strcmp(brand_name, "lx") != 0 || !ALT_MOUNT(mount_cmd));
+
+       if (do_prestate && brand_prestatechg(zlogp, zstate, Z_READY) != 0)
                return (-1);
 
        if ((err = zonecfg_create_snapshot(zone_name)) != Z_OK) {
@@ -580,8 +587,7 @@ zone_ready(zlog_t *zlogp, zone_mnt_t mount_cmd, int zstate)
                goto bad;
        }
 
-       if (!ALT_MOUNT(mount_cmd) &&
-           brand_poststatechg(zlogp, zstate, Z_READY) != 0)
+       if (do_prestate && brand_poststatechg(zlogp, zstate, Z_READY) != 0)
                goto bad;
 
        return (0);



More information about the OmniOS-discuss mailing list