--- old/usr/src/lib/libbe/common/be_activate.c	2015-11-11 10:43:14.615750150 -0500
+++ new/usr/src/lib/libbe/common/be_activate.c	2015-11-11 10:43:14.623798060 -0500
@@ -25,6 +25,7 @@
 
 /*
  * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 #include <assert.h>
@@ -1390,30 +1391,16 @@
 	zfs_handle_t	*zhp = NULL;
 	zfs_handle_t	*z_zhp = NULL;
 	zoneList_t	zone_list = NULL;
-	zoneBrandList_t *brands = NULL;
 	boolean_t	be_mounted = B_FALSE;
 	int		zone_index = 0;
 	int		err = BE_SUCCESS;
 
-	/*
-	 * Get the supported zone brands so we can pass that
-	 * to z_get_nonglobal_zone_list_by_brand. Currently
-	 * only the ipkg and labeled brand zones are supported
-	 *
-	 */
-	if ((brands = be_get_supported_brandlist()) == NULL) {
-		be_print_err(gettext("be_promote_zone_ds: no supported "
-		    "brands\n"));
-		return (BE_SUCCESS);
-	}
-
 	if ((zhp = zfs_open(g_zfs, be_root_ds,
 	    ZFS_TYPE_FILESYSTEM)) == NULL) {
 		be_print_err(gettext("be_promote_zone_ds: Failed to open "
 		    "dataset (%s): %s\n"), be_root_ds,
 		    libzfs_error_description(g_zfs));
 		err = zfs_err_to_be_err(g_zfs);
-		z_free_brand_list(brands);
 		return (err);
 	}
 
@@ -1423,7 +1410,6 @@
 			be_print_err(gettext("be_promote_zone_ds: failed to "
 			    "mount the BE for zones procesing.\n"));
 			ZFS_CLOSE(zhp);
-			z_free_brand_list(brands);
 			return (err);
 		}
 		be_mounted = B_TRUE;
@@ -1435,20 +1421,30 @@
 	z_set_zone_root(temp_mntpt);
 
 	/*
-	 * Get all the zones based on the brands we're looking for. If no zones
-	 * are found that we're interested in unmount the BE and move on.
+	 * If no zones are found, unmount the BE and move on.
 	 */
-	if ((zone_list = z_get_nonglobal_zone_list_by_brand(brands)) == NULL) {
+	if ((zone_list = z_get_nonglobal_branded_zone_list()) == NULL) {
 		if (be_mounted)
 			(void) _be_unmount(be_name, 0);
 		ZFS_CLOSE(zhp);
-		z_free_brand_list(brands);
 		free(temp_mntpt);
 		return (BE_SUCCESS);
 	}
 	for (zone_index = 0; z_zlist_get_zonename(zone_list, zone_index)
 	    != NULL; zone_index++) {
 		char *zone_path = NULL;
+		boolean_t auto_create;
+
+		if (z_zlist_is_zone_auto_create_be(zone_list, zone_index,
+		    &auto_create) != 0) {
+			be_print_err(gettext("be_promote_zone_ds: "
+			    "Failed to get auto-create-be brand property\n"));
+			err = -1; // XXX
+			goto done;
+		}
+
+		if (!auto_create)
+			continue;
 
 		/* Skip zones that aren't at least installed */
 		if (z_zlist_get_current_state(zone_list, zone_index) <
@@ -1505,7 +1501,6 @@
 		(void) _be_unmount(be_name, 0);
 	ZFS_CLOSE(zhp);
 	free(temp_mntpt);
-	z_free_brand_list(brands);
 	z_free_zone_list(zone_list);
 	return (err);
 }
--- old/usr/src/lib/libbe/common/be_create.c	2015-11-11 10:43:14.823895843 -0500
+++ new/usr/src/lib/libbe/common/be_create.c	2015-11-11 10:43:14.829905845 -0500
@@ -23,6 +23,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2014 by Delphix. All rights reserved.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 /*
@@ -1618,7 +1619,6 @@
 	char		*zonepath_ds = NULL;
 	char		*mp = NULL;
 	zoneList_t	zlist = NULL;
-	zoneBrandList_t	*brands = NULL;
 	zfs_handle_t	*zhp = NULL;
 
 	/* If zones are not implemented, then get out. */
@@ -1626,20 +1626,12 @@
 		return (BE_SUCCESS);
 	}
 
-	/* Get list of supported brands */
-	if ((brands = be_get_supported_brandlist()) == NULL) {
-		be_print_err(gettext("be_destroy_zones: "
-		    "no supported brands\n"));
-		return (BE_SUCCESS);
-	}
-
 	/* Get handle to BE's root dataset */
 	if ((zhp = zfs_open(g_zfs, be_root_ds, ZFS_TYPE_FILESYSTEM)) ==
 	    NULL) {
 		be_print_err(gettext("be_destroy_zones: failed to "
 		    "open BE root dataset (%s): %s\n"), be_root_ds,
 		    libzfs_error_description(g_zfs));
-		z_free_brand_list(brands);
 		return (zfs_err_to_be_err(g_zfs));
 	}
 
@@ -1654,7 +1646,6 @@
 			    "mount the BE (%s) for zones processing.\n"),
 			    be_name);
 			ZFS_CLOSE(zhp);
-			z_free_brand_list(brands);
 			return (ret);
 		}
 	}
@@ -1663,11 +1654,9 @@
 	z_set_zone_root(mp);
 	free(mp);
 
-	/* Get list of supported zones. */
-	if ((zlist = z_get_nonglobal_zone_list_by_brand(brands)) == NULL) {
-		z_free_brand_list(brands);
+	/* Get list of zones. */
+	if ((zlist = z_get_nonglobal_branded_zone_list()) == NULL)
 		return (BE_SUCCESS);
-	}
 
 	/* Unmount the BE before destroying the zones in it. */
 	if (dd->force_unmount)
@@ -1680,6 +1669,17 @@
 
 	/* Iterate through the zones and destroy them. */
 	for (i = 0; (zonename = z_zlist_get_zonename(zlist, i)) != NULL; i++) {
+		boolean_t auto_create;
+
+		if (z_zlist_is_zone_auto_create_be(zlist, i, &auto_create) != 0) {
+			be_print_err(gettext("be_destroy_zones: failed to get "
+			    "auto-create-be brand property\n"));
+			ret = -1; // XXX
+			goto done;
+		}
+
+		if (!auto_create)
+			continue;
 
 		/* Skip zones that aren't at least installed */
 		if (z_zlist_get_current_state(zlist, i) < ZONE_STATE_INSTALLED)
@@ -1716,7 +1716,6 @@
 	}
 
 done:
-	z_free_brand_list(brands);
 	z_free_zone_list(zlist);
 
 	return (ret);
@@ -1908,7 +1907,6 @@
 	zfs_handle_t	*nbe_zhp = NULL;
 	zfs_handle_t	*z_zhp = NULL;
 	zoneList_t	zlist = NULL;
-	zoneBrandList_t	*brands = NULL;
 	boolean_t	mounted_here = B_FALSE;
 	char		*snap_name = NULL;
 
@@ -1917,13 +1915,6 @@
 		return (BE_SUCCESS);
 	}
 
-	/* Get list of supported brands */
-	if ((brands = be_get_supported_brandlist()) == NULL) {
-		be_print_err(gettext("be_copy_zones: "
-		    "no supported brands\n"));
-		return (BE_SUCCESS);
-	}
-
 	/* Get handle to origin BE's root dataset */
 	if ((obe_zhp = zfs_open(g_zfs, obe_root_ds, ZFS_TYPE_FILESYSTEM))
 	    == NULL) {
@@ -1971,8 +1962,8 @@
 
 	z_set_zone_root(temp_mntpt);
 
-	/* Get list of supported zones. */
-	if ((zlist = z_get_nonglobal_zone_list_by_brand(brands)) == NULL) {
+	/* Get list of zones. */
+	if ((zlist = z_get_nonglobal_branded_zone_list()) == NULL) {
 		ret = BE_SUCCESS;
 		goto done;
 	}
@@ -1982,6 +1973,16 @@
 		be_fs_list_data_t	fld = { 0 };
 		char			zonepath_ds[MAXPATHLEN];
 		char			*ds = NULL;
+		boolean_t		auto_create;
+
+		if (z_zlist_is_zone_auto_create_be(zlist, i, &auto_create) != 0) {
+			be_print_err(gettext("be_copy_zones: failed to get "
+			    "auto-create-be brand property\n"));
+			ret = -1; // XXX
+		}
+
+		if (!auto_create)
+			continue;
 
 		/* Get zonepath of zone */
 		zonepath = z_zlist_get_zonepath(zlist, i);
@@ -2249,8 +2250,6 @@
 
 done:
 	free(snap_name);
-	if (brands != NULL)
-		z_free_brand_list(brands);
 	if (zlist != NULL)
 		z_free_zone_list(zlist);
 
--- old/usr/src/lib/libbe/common/be_mount.c	2015-11-11 10:43:15.095855683 -0500
+++ new/usr/src/lib/libbe/common/be_mount.c	2015-11-11 10:43:15.100544106 -0500
@@ -25,6 +25,7 @@
 /*
  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  * Copyright 2015 EveryCity Ltd.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 /*
@@ -2342,29 +2343,30 @@
 static int
 be_mount_zones(zfs_handle_t *be_zhp, be_mount_data_t *md)
 {
-	zoneBrandList_t	*brands = NULL;
 	zoneList_t	zlst = NULL;
 	char		*zonename = NULL;
 	char		*zonepath = NULL;
 	char		*zonepath_ds = NULL;
 	int		k;
 	int		ret = BE_SUCCESS;
+	boolean_t	auto_create;
 
 	z_set_zone_root(md->altroot);
 
-	if ((brands = be_get_supported_brandlist()) == NULL) {
-		be_print_err(gettext("be_mount_zones: "
-		    "no supported brands\n"));
+	zlst = z_get_nonglobal_branded_zone_list();
+	if (zlst == NULL)
 		return (BE_SUCCESS);
-	}
-
-	zlst = z_get_nonglobal_zone_list_by_brand(brands);
-	if (zlst == NULL) {
-		z_free_brand_list(brands);
-		return (BE_SUCCESS);
-	}
 
 	for (k = 0; (zonename = z_zlist_get_zonename(zlst, k)) != NULL; k++) {
+		if (z_zlist_is_zone_auto_create_be(zlst, k, &auto_create) != 0) {
+			be_print_err(gettext("be_mount_zones: failed to"
+			    " get auto-create-be brand property\n"));
+			goto done;
+		}
+
+		if (!auto_create)
+			continue;
+
 		if (z_zlist_get_current_state(zlst, k) ==
 		    ZONE_STATE_INSTALLED) {
 			zonepath = z_zlist_get_zonepath(zlst, k);
@@ -2417,7 +2419,6 @@
 	}
 
 done:
-	z_free_brand_list(brands);
 	z_free_zone_list(zlst);
 	/*
 	 * libinstzones caches mnttab and uses cached version for resolving lofs
@@ -2448,7 +2449,6 @@
 static int
 be_unmount_zones(be_unmount_data_t *ud)
 {
-	zoneBrandList_t		*brands = NULL;
 	zoneList_t		zlst = NULL;
 	char			*zonename = NULL;
 	char			*zonepath = NULL;
@@ -2456,22 +2456,24 @@
 	char			*zonepath_ds = NULL;
 	int			k;
 	int			ret = BE_SUCCESS;
+	boolean_t		auto_create;
 
 	z_set_zone_root(ud->altroot);
 
-	if ((brands = be_get_supported_brandlist()) == NULL) {
-		be_print_err(gettext("be_unmount_zones: "
-		    "no supported brands\n"));
+	zlst = z_get_nonglobal_branded_zone_list();
+	if (zlst == NULL)
 		return (BE_SUCCESS);
-	}
-
-	zlst = z_get_nonglobal_zone_list_by_brand(brands);
-	if (zlst == NULL) {
-		z_free_brand_list(brands);
-		return (BE_SUCCESS);
-	}
 
 	for (k = 0; (zonename = z_zlist_get_zonename(zlst, k)) != NULL; k++) {
+		if (z_zlist_is_zone_auto_create_be(zlst, k, &auto_create) != 0) {
+			be_print_err(gettext("be_unmount_zones: failed to"
+			    " get auto-create-be brand property\n"));
+			goto done;
+		}
+
+		if (!auto_create)
+			continue;
+
 		if (z_zlist_get_current_state(zlst, k) ==
 		    ZONE_STATE_INSTALLED) {
 			zonepath = z_zlist_get_zonepath(zlst, k);
@@ -2515,7 +2517,6 @@
 	}
 
 done:
-	z_free_brand_list(brands);
 	z_free_zone_list(zlst);
 	return (ret);
 }
--- old/usr/src/lib/libbe/common/be_zones.c	2015-11-11 10:43:15.364296088 -0500
+++ new/usr/src/lib/libbe/common/be_zones.c	2015-11-11 10:43:15.369282804 -0500
@@ -25,6 +25,7 @@
 
 /*
  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 /*
@@ -309,25 +310,6 @@
 }
 
 /*
- * Function:	be_get_supported_brandlist
- * Desciption:	This functions retuns a list of supported brands in
- *		a zoneBrandList_t object.
- * Parameters:
- *		None
- * Returns:
- *		Failure - NULL if no supported brands found.
- *		Success - pointer to zoneBrandList structure.
- * Scope:
- *		Semi-private (library wide use only)
- */
-zoneBrandList_t *
-be_get_supported_brandlist(void)
-{
-	return (z_make_brand_list(BE_ZONE_SUPPORTED_BRANDS,
-	    BE_ZONE_SUPPORTED_BRANDS_DELIM));
-}
-
-/*
  * Function:	be_zone_get_parent_uuid
  * Description:	This function gets the parentbe property of a zone root
  *		dataset, parsed it into internal uuid format, and returns
--- old/usr/src/lib/libbe/common/libbe_priv.h	2015-11-11 10:43:15.519001292 -0500
+++ new/usr/src/lib/libbe/common/libbe_priv.h	2015-11-11 10:43:15.523869022 -0500
@@ -73,8 +73,6 @@
 
 #define	BE_ZONE_PARENTBE_PROPERTY	"org.opensolaris.libbe:parentbe"
 #define	BE_ZONE_ACTIVE_PROPERTY		"org.opensolaris.libbe:active"
-#define	BE_ZONE_SUPPORTED_BRANDS	"ipkg labeled"
-#define	BE_ZONE_SUPPORTED_BRANDS_DELIM	" "
 
 /* Maximum length for the BE name. */
 #define	BE_NAME_MAX_LEN		64
@@ -207,7 +205,6 @@
 int be_find_active_zone_root(zfs_handle_t *, char *, char *, int);
 int be_find_mounted_zone_root(char *, char *, char *, int);
 boolean_t be_zone_supported(char *);
-zoneBrandList_t *be_get_supported_brandlist(void);
 int be_zone_get_parent_uuid(const char *, uuid_t *);
 int be_zone_set_parent_uuid(char *, uuid_t);
 boolean_t be_zone_compare_uuids(char *);
--- old/usr/src/lib/libbrand/common/libbrand.c	2015-11-11 10:43:15.666939613 -0500
+++ new/usr/src/lib/libbrand/common/libbrand.c	2015-11-11 10:43:15.671640404 -0500
@@ -23,6 +23,7 @@
  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 #include <assert.h>
@@ -85,6 +86,7 @@
 
 #define	DTD_ATTR_ALLOWEXCL	((const xmlChar *) "allow-exclusive-ip")
 #define	DTD_ATTR_ARCH		((const xmlChar *) "arch")
+#define	DTD_ATTR_AUTO_CREATE_BE	((const xmlChar *) "auto-create-be")
 #define	DTD_ATTR_DIRECTORY	((const xmlChar *) "directory")
 #define	DTD_ATTR_IPTYPE		((const xmlChar *) "ip-type")
 #define	DTD_ATTR_MATCH		((const xmlChar *) "match")
@@ -99,6 +101,7 @@
 #define	DTD_ATTR_TYPE		((const xmlChar *) "type")
 
 #define	DTD_ENTITY_TRUE		"true"
+#define	DTD_ENTITY_FALSE	"false"
 
 static volatile boolean_t	libbrand_initialized = B_FALSE;
 static char			i_curr_arch[MAXNAMELEN];
@@ -753,6 +756,34 @@
 
 	return (ret);
 }
+
+boolean_t
+brand_auto_create_be(brand_handle_t bh)
+{
+	struct brand_handle	*bhp = (struct brand_handle *)bh;
+	xmlNodePtr		node;
+	xmlChar			*auto_create_be;
+	boolean_t		ret;
+
+	assert(bhp != NULL);
+
+	if ((node = xmlDocGetRootElement(bhp->bh_platform)) == NULL)
+		return (B_FALSE);
+
+	auto_create_be = xmlGetProp(node, DTD_ATTR_AUTO_CREATE_BE);
+	if (auto_create_be == NULL)
+		return (B_FALSE);
+
+	/* Note: only return B_FALSE if it's "false" */
+	if (strcmp((char *)auto_create_be, DTD_ENTITY_FALSE) == 0)
+		ret = B_FALSE;
+	else
+		ret = B_TRUE;
+
+	xmlFree(auto_create_be);
+
+	return (ret);
+}
 
 /*
  * Iterate over brand privileges
--- old/usr/src/lib/libbrand/common/libbrand.h	2015-11-11 10:43:15.850328456 -0500
+++ new/usr/src/lib/libbrand/common/libbrand.h	2015-11-11 10:43:15.855137216 -0500
@@ -23,6 +23,7 @@
  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 #ifndef	_LIBBRAND_H
@@ -46,6 +47,7 @@
 extern void brand_close(brand_handle_t);
 
 extern boolean_t brand_allow_exclusive_ip(brand_handle_t);
+extern boolean_t brand_auto_create_be(brand_handle_t);
 
 extern int brand_get_attach(brand_handle_t, const char *, const char *,
     char *, size_t);
--- old/usr/src/lib/libbrand/common/mapfile-vers	2015-11-11 10:43:15.997436606 -0500
+++ new/usr/src/lib/libbrand/common/mapfile-vers	2015-11-11 10:43:16.002407059 -0500
@@ -43,6 +43,7 @@
 SYMBOL_VERSION SUNWprivate {
     global:
 	brand_allow_exclusive_ip;
+	brand_auto_create_be;
 	brand_close;
 	brand_config_iter_privilege;
 	brand_get_attach;
--- old/usr/src/lib/libinstzones/Makefile.com	2015-11-11 10:43:16.148279466 -0500
+++ new/usr/src/lib/libinstzones/Makefile.com	2015-11-11 10:43:16.152988150 -0500
@@ -23,6 +23,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+#
 
 LIBRARY=	libinstzones.a
 VERS=		.1
@@ -61,7 +63,7 @@
 
 DYNFLAGS += $(ZLAZYLOAD)
 
-LDLIBS +=	-lc -lcontract -lzonecfg
+LDLIBS +=	-lc -lcontract -lzonecfg -lbrand
 
 CFLAGS +=	$(CCVERBOSE)
 CPPFLAGS +=	-I$(SRCDIR)
--- old/usr/src/lib/libinstzones/common/mapfile-vers	2015-11-11 10:43:16.304808181 -0500
+++ new/usr/src/lib/libinstzones/common/mapfile-vers	2015-11-11 10:43:16.310470130 -0500
@@ -21,6 +21,7 @@
 
 #
 # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
 #
 
 #
@@ -52,6 +53,7 @@
 	z_free_brand_list;
 	z_free_zone_list;
 	z_get_nonglobal_zone_list;
+	z_get_nonglobal_branded_zone_list;
 	z_get_nonglobal_zone_list_by_brand;
 	z_get_zonename;
 	z_global_only;
@@ -81,6 +83,7 @@
 	z_zlist_get_scratch;
 	z_zlist_get_zonename;
 	z_zlist_get_zonepath;
+	z_zlist_is_zone_auto_create_be;
 	z_zlist_is_zone_runnable;
 	z_zlist_restore_zone_state;
 	z_zone_exec;
--- old/usr/src/lib/libinstzones/common/zones.c	2015-11-11 10:43:16.457758222 -0500
+++ new/usr/src/lib/libinstzones/common/zones.c	2015-11-11 10:43:16.462565447 -0500
@@ -21,6 +21,7 @@
 
 /*
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 
@@ -37,6 +38,8 @@
  *  z_free_zone_list - free contents of zoneList_t object
  *  z_get_nonglobal_zone_list - return zoneList_t object describing all
  *	non-global native zones
+ *  z_get_nonglobal_branded_zone_list - return zoneList_t object describing
+ *      all branded non-global zones
  *  z_get_nonglobal_zone_list_by_brand - return zoneList_t object describing
  *      all non-global zones matching the list of zone brands passed in.
  *  z_free_brand_list - free contents of a zoneBrandList_t object
@@ -430,20 +433,9 @@
 	return (head);
 }
 
-/*
- * Name:	z_get_nonglobal_zone_list_by_brand
- * Description: return zoneList_t object describing all non-global
- *              zones matching the list of brands passed in.
- * Arguments:	brands - The list of zone brands to look for.
- * Returns:	zoneList_t
- *			== NULL - error, list could not be generated
- *			!= NULL - success, list returned
- * NOTE:    	Any zoneList_t returned is placed in new storage for the
- *		calling function. The caller must use 'z_free_zone_list' to
- *		dispose of the storage once the list is no longer needed.
- */
-zoneList_t
-z_get_nonglobal_zone_list_by_brand(zoneBrandList_t *brands)
+static zoneList_t
+i_get_nonglobal_branded_zone_list(boolean_t (*include)(struct zoneent *,
+    void *), void *arg)
 {
 	FILE		*zoneIndexFP;
 	int		numzones = 0;
@@ -480,9 +472,9 @@
 		}
 
 		/*
-		 * skip any zones with brands not on the brand list
+		 * skip any zones the filter function doesn't like
 		 */
-		if (!z_is_zone_brand_in_list(ze->zone_name, brands)) {
+		if (include != NULL && !include(ze, arg)) {
 			free(ze);
 			continue;
 		}
@@ -566,6 +558,48 @@
 }
 
 /*
+ * Name:	z_get_nonglobal_branded_zone_list
+ * Description: return zoneList_t object describing all non-global
+ * Returns:	zoneList_t
+ *			== NULL - error, list could not be generated
+ *			!= NULL - success, list returned
+ * NOTE:    	Any zoneList_t returned is placed in new storage for the
+ *		calling function. The caller must use 'z_free_zone_list' to
+ *		dispose of the storage once the list is no longer needed.
+ */
+zoneList_t
+z_get_nonglobal_branded_zone_list(void)
+{
+	return (i_get_nonglobal_branded_zone_list(NULL, NULL));
+}
+
+static boolean_t
+X(struct zoneent *ze, void *arg)
+{
+	zoneBrandList_t *brands = arg;
+
+	return (z_is_zone_brand_in_list(ze->zone_name, brands));
+}
+
+/*
+ * Name:	z_get_nonglobal_zone_list_by_brand
+ * Description: return zoneList_t object describing all non-global
+ *              zones matching the list of brands passed in.
+ * Arguments:	brands - The list of zone brands to look for.
+ * Returns:	zoneList_t
+ *			== NULL - error, list could not be generated
+ *			!= NULL - success, list returned
+ * NOTE:    	Any zoneList_t returned is placed in new storage for the
+ *		calling function. The caller must use 'z_free_zone_list' to
+ *		dispose of the storage once the list is no longer needed.
+ */
+zoneList_t
+z_get_nonglobal_zone_list_by_brand(zoneBrandList_t *brands)
+{
+	return (i_get_nonglobal_branded_zone_list(X, brands));
+}
+
+/*
  * Name:	z_get_zonename
  * Description:	return the name of the current zone
  * Arguments:	void
@@ -1894,6 +1928,27 @@
 	return (a_zlst[i]._zlPath);
 }
 
+int
+z_zlist_is_zone_auto_create_be(zoneList_t zlst, int idx, boolean_t *ret)
+{
+	char brandname[MAXNAMELEN];
+	brand_handle_t bh;
+
+	if (zone_get_brand(z_zlist_get_zonename(zlst, idx), brandname,
+	    sizeof (brandname)) != Z_OK)
+		return (-1);
+
+	bh = brand_open(brandname);
+	if (bh == NULL)
+		return (-1);
+
+	*ret = brand_auto_create_be(bh);
+
+	brand_close(bh);
+
+	return (0);
+}
+
 boolean_t
 z_zlist_is_zone_runnable(zoneList_t a_zlst, int a_zoneIndex)
 {
--- old/usr/src/lib/libinstzones/hdrs/instzones_api.h	2015-11-11 10:43:16.685636621 -0500
+++ new/usr/src/lib/libinstzones/hdrs/instzones_api.h	2015-11-11 10:43:16.690794435 -0500
@@ -21,6 +21,7 @@
 
 /*
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  */
 
 #ifndef _INSTZONES_API_H
@@ -91,6 +92,8 @@
 
 extern boolean_t	z_zones_are_implemented(void);
 extern void		z_set_zone_root(const char *zroot);
+extern int		z_zlist_is_zone_auto_create_be(zoneList_t, int,
+				boolean_t *);
 extern boolean_t	z_zlist_is_zone_runnable(zoneList_t a_zoneList,
 				int a_zoneIndex);
 extern boolean_t	z_zlist_restore_zone_state(zoneList_t a_zoneList,
@@ -112,6 +115,7 @@
 				char *a_userAdminFilename);
 extern void		z_free_zone_list(zoneList_t a_zoneList);
 extern zoneList_t	z_get_nonglobal_zone_list(void);
+extern zoneList_t	z_get_nonglobal_branded_zone_list(void);
 extern zoneList_t	z_get_nonglobal_zone_list_by_brand(zoneBrandList_t *);
 extern void		z_free_brand_list(zoneBrandList_t *a_brandList);
 extern zoneBrandList_t	*z_make_brand_list(const char *brandList,
