On Thu, Nov 19, 2009 at 11:12:48PM -0800, Dan Price wrote:
> On Thu 19 Nov 2009 at 09:16PM, Edward Pilatowicz wrote:
> > hey all,
> >
> > i need a review for the following bugfix:
> >
> > http://cr.opensolaris.org/~edp/onnv-zmount3/
> > 6901952 zoneadm fails with "unable to determine default brand"
>
> In the comment:
>
> zones -> zone's.
>

done.

> Is "default brand" actually a meaningful concept inside of a zone?  That
> is to say, why aren't all calls to this routine guarded by:
>
>         if (strcmp(zone_name, "global") == 0)
>                 return (zonecfg_default_brand(brandname, rp_sz));
>
> As is the case in zone_get_brand()?  Maybe it doesn't matter...
>

the "default brand" is currently only used within the global zone.  it's
generally useful if we want to lookup zone configuration options that
are not associated with any particular zone.  currently this is only
used when setting up scratch zones.  (since in that case we're going to
be running an image in sync with the global zone, and hence we don't
want to use a brand configuration that won't work with bits that aren't
in sync with the global zone.)

we could remove calls to this interface from within non-global zones,
but i think it's much better/easier just to make the interface work
within a zone and say that within a zone "default" is the current zones
brand.  otherwise we'll just end up with more bugs like this one where
someone adds a call to the interface, does some testing (but doesn't hit
the case where the interface is called within a zone), and then ends up
with broken code.

the current failure is caused by the fact that i added a call to this
inteface in the beginning of zoneadm.  in the global zone we need to
know the default_brand in a few different places, and since the default
brand will never change over the life of the zoneadm invocation, it
seemed easiest to initialize a global once with this value.

ed
_______________________________________________
zones-discuss mailing list
zones-discuss@opensolaris.org

Reply via email to