changeset 13907:2adac9f6b5e6

3315 svccfg export -a drops values in PG "general" Reviewed by: Eric Schrock <eric.schrock@delphix.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Keith M Wesolowski <wesolows@foobazco.org>
date Thu, 20 Dec 2012 02:04:26 +0000
parents 1da8bb09d310
children 3e3d92153ccf
files usr/src/cmd/svc/svccfg/svccfg_libscf.c
diffstat 1 files changed, 28 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/svc/svccfg/svccfg_libscf.c	Fri Dec 21 09:19:07 2012 -0800
+++ b/usr/src/cmd/svc/svccfg/svccfg_libscf.c	Thu Dec 20 02:04:26 2012 +0000
@@ -9081,7 +9081,7 @@
 	if (err) {
 		xmlFreeNode(n);
 
-		export_pg(pg, eelts, 0);
+		export_pg(pg, eelts, SCE_ALL_VALUES);
 
 		return;
 	}
@@ -9116,7 +9116,7 @@
 			xmlFreeNode(m);
 		}
 
-		export_property(exp_prop, exp_str, &elts, 0);
+		export_property(exp_prop, exp_str, &elts, SCE_ALL_VALUES);
 	}
 	if (ret == -1)
 		scfdie();
@@ -9244,7 +9244,7 @@
 	if (err) {
 		xmlFreeNode(n);
 
-		export_pg(pg, eelts, 0);
+		export_pg(pg, eelts, SCE_ALL_VALUES);
 
 		return;
 	}
@@ -9421,7 +9421,7 @@
 				continue;
 		}
 
-		export_property(exp_prop, exp_str, &elts, 0);
+		export_property(exp_prop, exp_str, &elts, SCE_ALL_VALUES);
 	}
 	if (ret == -1)
 		scfdie();
@@ -9537,7 +9537,7 @@
 			xmlFreeNode(s);
 		}
 
-		export_property(exp_prop, exp_str, &elts, 0);
+		export_property(exp_prop, exp_str, &elts, SCE_ALL_VALUES);
 	}
 	if (ret == -1)
 		scfdie();
@@ -9633,7 +9633,7 @@
 
 	if (err && env == NULL) {
 		xmlFreeNode(n);
-		export_pg(pg, elts, 0);
+		export_pg(pg, elts, SCE_ALL_VALUES);
 		return;
 	}
 
@@ -9747,7 +9747,7 @@
 			xmlFreeNode(s);
 		}
 
-		export_property(exp_prop, exp_str, &pgelts, 0);
+		export_property(exp_prop, exp_str, &pgelts, SCE_ALL_VALUES);
 	}
 	if (ret == -1)
 		scfdie();
@@ -9796,7 +9796,8 @@
 		if ((ty != SCF_TYPE_ASTRING &&
 		    prop_check_type(exp_prop, SCF_TYPE_FMRI) != 0) ||
 		    prop_get_val(exp_prop, exp_val) != 0) {
-			export_property(exp_prop, NULL, &pgelts, 0);
+			export_property(exp_prop, NULL, &pgelts,
+			    SCE_ALL_VALUES);
 			continue;
 		}
 
@@ -9827,7 +9828,8 @@
 				    "FMRI.\n"), fmri);
 			}
 
-			export_property(exp_prop, exp_str, &pgelts, 0);
+			export_property(exp_prop, exp_str, &pgelts,
+			    SCE_ALL_VALUES);
 			continue;
 
 		case SCF_ERROR_CONSTRAINT_VIOLATED:
@@ -9840,7 +9842,8 @@
 				    "a service or an instance.\n"), fmri);
 			}
 
-			export_property(exp_prop, exp_str, &pgelts, 0);
+			export_property(exp_prop, exp_str, &pgelts,
+			    SCE_ALL_VALUES);
 			continue;
 
 		case SCF_ERROR_NOT_FOUND:
@@ -9853,7 +9856,8 @@
 				    "not exist.\n"), fmri);
 			}
 
-			export_property(exp_prop, exp_str, &pgelts, 0);
+			export_property(exp_prop, exp_str, &pgelts,
+			    SCE_ALL_VALUES);
 			continue;
 
 		default:
@@ -9872,7 +9876,8 @@
 			warn(gettext("Entity %s is missing dependency property "
 			    "group %s.\n"), fmri, exp_str);
 
-			export_property(exp_prop, NULL, &pgelts, 0);
+			export_property(exp_prop, NULL, &pgelts,
+			    SCE_ALL_VALUES);
 			continue;
 		}
 
@@ -9886,14 +9891,16 @@
 			warn(gettext("Property group %s is not of "
 			    "expected type %s.\n"), fmri, SCF_GROUP_DEPENDENCY);
 
-			export_property(exp_prop, NULL, &pgelts, 0);
+			export_property(exp_prop, NULL, &pgelts,
+			    SCE_ALL_VALUES);
 			continue;
 		}
 
 		n = export_dependent(opg, exp_str, fmri);
-		if (n == NULL)
-			export_property(exp_prop, exp_str, &pgelts, 0);
-		else {
+		if (n == NULL) {
+			export_property(exp_prop, exp_str, &pgelts,
+			    SCE_ALL_VALUES);
+		} else {
 			if (eelts->dependents == NULL)
 				eelts->dependents = n;
 			else
@@ -10017,12 +10024,12 @@
 	if (strcmp(exp_str, SCF_PG_TM_COMMON_NAME) == 0) {
 		telts->common_name = export_tm_loctext(pg, "common_name");
 		if (telts->common_name == NULL)
-			export_pg(pg, elts, 0);
+			export_pg(pg, elts, SCE_ALL_VALUES);
 		return;
 	} else if (strcmp(exp_str, SCF_PG_TM_DESCRIPTION) == 0) {
 		telts->description = export_tm_loctext(pg, "description");
 		if (telts->description == NULL)
-			export_pg(pg, elts, 0);
+			export_pg(pg, elts, SCE_ALL_VALUES);
 		return;
 	}
 
@@ -10036,7 +10043,7 @@
 		make_node(&telts->documentation, "documentation");
 		(void) xmlAddChild(telts->documentation, child);
 	} else {
-		export_pg(pg, elts, 0);
+		export_pg(pg, elts, SCE_ALL_VALUES);
 	}
 }
 
@@ -10189,7 +10196,7 @@
 			xmlFree(type[i]);
 		free(type);
 
-		export_pg(pg, elts, 0);
+		export_pg(pg, elts, SCE_ALL_VALUES);
 
 		return;
 	} else {
@@ -10265,7 +10272,7 @@
 			xmlFreeNode(rnode);
 		}
 
-		export_property(exp_prop, exp_str, &pgelts, 0);
+		export_property(exp_prop, exp_str, &pgelts, SCE_ALL_VALUES);
 	}
 	if (ret == -1)
 		scfdie();