--- a/usr/src/lib/libbe/be_zones.c Tue Dec 16 19:41:15 2008 +0800
+++ b/usr/src/lib/libbe/be_zones.c Tue Dec 16 10:10:38 2008 -0800
@@ -241,8 +241,10 @@
/*
* Function: be_zone_supported
* Description: This function will determine if a zone is supported
- * based on its zonepath dataset. If the zonepath dataset
- * is not under any global BE root dataset, it is supported.
+ * based on its zonepath dataset. The zonepath dataset
+ * must:
+ * - not be under any global BE root dataset.
+ * - have a root container dataset underneath it.
*
* Parameters:
* zonepath_ds - name of dataset of the zonepath of the
@@ -256,6 +258,7 @@
boolean_t
be_zone_supported(char *zonepath_ds)
{
+ char zone_container_ds[MAXPATHLEN];
int ret = 0;
/*
@@ -274,6 +277,22 @@
return (B_FALSE);
}
+ /*
+ * Make sure the zonepath has a zone root container dataset
+ * underneath it.
+ */
+ be_make_container_ds(zonepath_ds, zone_container_ds,
+ sizeof (zone_container_ds));
+
+ if (!zfs_dataset_exists(g_zfs, zone_container_ds,
+ ZFS_TYPE_FILESYSTEM)) {
+ be_print_err(gettext("be_zone_supported: "
+ "zonepath dataset (%s) does not have a zone root container "
+ "dataset, zone is not supported, skipping ...\n"),
+ zonepath_ds);
+ return (B_FALSE);
+ }
+
return (B_TRUE);
}