Sean, This looks good (+1). My only question is about binding. The document states:
Binding is
Thanks, John On 06/17/10 05:24 PM, Liane Praza wrote:
Template Version: @(#)sac_nextcase 1.70 03/30/10 SMI This information is Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 1. Introduction 1.1. Project/Component Working Name: Relaxed Type Requirements for SMF Profiles 1.2. Name of Document Author/Supplier: Author: Sean Wilcox 1.3 Date of This Document: 17 June, 2010 4. Technical Description Sean Wilcox 06/17/2010 1. Summary smf(5)/Greenline (PSARC 2002/547) provides the service_bundle(4) XML DTD. The required types for profiles can be relaxed in the property elements when those elements already exist in the repository via an imported manifest. 2. Details When a property group or property already has a type in the service/ instance, it can be taken from what is in the repository when applying a profile that would update that property group or property. Which means that the type should be implied for these elements. In order to keep the DTD validation for profiles that would like to use this relaxed requirement on elements, it is necessary to define the elements with implied types. Using Condidtional DTD Entities to create the different DTD elements within the DTD simplifies maintenance of the DTD for smf manifests and profiles given that there is so much shared data. With this method a profile writer that wants to take advantage of the relaxed elements and still be able to validate against the DTD with xml tools can simply add the following two elements to their profile : <!ENTITY % profile "INCLUDE"> <!ENTITY % manifest "IGNORE"> This will switch default values added to the DTD so that the relaxed elements will be used. 3. Interface Table service_bundle.dtd.1 Committed Binding is 5. Additional Materials man page diffs : --- smf5.orig Fri Jun 4 10:01:54 2010 +++ smf5.new Mon Jun 14 14:45:55 2010 @@ -439,11 +439,17 @@ Profiles can also contain configuration values for properties in services and instances. Tem- plate elements cannot be defined in a profile. + Profiles can use a relaxed set of elements from + the DTD described in service_bundle(4). To use + these the DOCTYPE entry should have the following + definitions added : +<!ENTITY % profile "INCLUDE"> +<!ENTITY % manifest "IGNORE"> Service bundles can be imported or exported from a reposi- tory using the svccfg(1M) command. See service_bundle(4) for a description of the service bundle file format with guide- lines for authoring service bundles. --- svccfg1m.orig Fri Jun 4 10:12:19 2010 +++ svccfg1m.new Mon Jun 14 14:45:09 2010 @@ -161,11 +161,28 @@ modified in the SMF repository. Not-yet-existent proper- ties and property groups will be created. The type of the pre-existing property groups will not be changed by the profile. Existing properties (as distinguished from property groups) can have their type changed by the pro- - file. Nonexistent services and instances are ignored. + file. + + If the type attribute of a property or property group + is unspecified an attempt will be made to determine the + type from existing type settings or from the service + template. If a type cannot be determined a warning will + be presented and the service will be skipped so + inconsistent data will not be introduced into a service + and instance. Nonexistent services and instances are + ignored. + + In order to use the relaxed element definitions in a + profile the following definitions need to be added to + the DOCTYPE entry : + +<!ENTITY % profile "INCLUDE"> +<!ENTITY % manifest "IGNORE"> + Services and instances modified by the profile will be refreshed. If -n is specified, the profile is processed and no changes are applied to the SMF repository. Any syntax error found will be reported on stderr and an exit code of 1 will be returned. See smf(5) for a service_bundle.dtd.1 diffs : A series of service bundles may be composed via the xi:include tag. smf(5) tools enforce that all bundles be of the same type. --> + +<!-- + These entities are used for the property, propval and property_group + elements, that require type attributes for manifest, while for profiles + the type attributes are only implied. +--> + +<!ENTITY % profile "IGNORE"> +<!ENTITY % manifest "INCLUDE"> + <!ELEMENT xi:include (xi:fallback) > <!ATTLIST xi:include href CDATA #REQUIRED @@ -194,10 +203,11 @@ override These values should replace values already in the repository. --> +<![%profile;[ <!ELEMENT property ( count_list | integer_list | opaque_list | host_list | hostname_list | net_address_v4_list | net_address_v6_list | time_list | astring_list | ustring_list | boolean_list | fmri_list | uri_list )?> @@ -204,12 +214,28 @@ <!ATTLIST property name CDATA #REQUIRED type ( count | integer | opaque | host | hostname | net_address_v4 | net_address_v6 | time | + astring | ustring | boolean | fmri | uri ) #IMPLIED + override ( true | false ) "false"> +]]> + +<![%manifest;[ +<!ELEMENT property + ( count_list | integer_list | opaque_list | host_list | hostname_list | + net_address_v4_list | net_address_v6_list | time_list | + astring_list | ustring_list | boolean_list | fmri_list | + uri_list )?> + +<!ATTLIST property + name CDATA #REQUIRED + type ( count | integer | opaque | host | hostname | + net_address_v4 | net_address_v6 | time | astring | ustring | boolean | fmri | uri ) #REQUIRED override ( true | false ) "false"> +]]> <!-- propval This element is for a singly valued property within a property @@ -226,19 +252,33 @@ override This value should replace any values already in the repository. --> +<![%profile;[ <!ELEMENT propval EMPTY> <!ATTLIST propval name CDATA #REQUIRED type ( count | integer | opaque | host | hostname | net_address_v4 | net_address_v6 | time | astring | + ustring | boolean | fmri | uri ) #IMPLIED + value CDATA #REQUIRED + override ( true | false ) "false"> +]]> + +<![%manifest;[ +<!ELEMENT propval EMPTY> + +<!ATTLIST propval + name CDATA #REQUIRED + type ( count | integer | opaque | host | hostname | + net_address_v4 | net_address_v6 | time | astring | ustring | boolean | fmri | uri ) #REQUIRED value CDATA #REQUIRED override ( true | false ) "false"> +]]> <!-- property_group This element is for a set of related properties on a service or @@ -258,17 +298,29 @@ namespace conventions. delete If in the repository, this property group should be removed. --> +<![%profile;[ <!ELEMENT property_group ( stability?, ( propval | property )* )> <!ATTLIST property_group name CDATA #REQUIRED + type CDATA #IMPLIED + delete ( true | false ) "false"> +]]> + +<![%manifest;[ +<!ELEMENT property_group + ( stability?, ( propval | property )* )> + +<!ATTLIST property_group + name CDATA #REQUIRED type CDATA #REQUIRED delete ( true | false ) "false"> +]]> <!-- service_fmri This element defines a reference to a service FMRI (for either a 6. Resources and Schedule 6.4. Steering Committee requested information 6.4.1. Consolidation C-team Name: ON 6.5. ARC review type: Automatic 6.6. ARC Exposure: open
_______________________________________________ opensolaris-arc mailing list opensolaris-arc@opensolaris.org