Print this page
3315 svccfg export -a drops values in PG "general"
Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>

*** 9079,9089 **** err = 1; if (err) { xmlFreeNode(n); ! export_pg(pg, eelts, 0); return; } /* Iterate through the properties & handle each. */ --- 9079,9089 ---- err = 1; if (err) { xmlFreeNode(n); ! export_pg(pg, eelts, SCE_ALL_VALUES); return; } /* Iterate through the properties & handle each. */
*** 9114,9124 **** } xmlFreeNode(m); } ! export_property(exp_prop, exp_str, &elts, 0); } if (ret == -1) scfdie(); (void) xmlAddChild(n, elts.stability); --- 9114,9124 ---- } xmlFreeNode(m); } ! export_property(exp_prop, exp_str, &elts, SCE_ALL_VALUES); } if (ret == -1) scfdie(); (void) xmlAddChild(n, elts.stability);
*** 9242,9252 **** err = 1; if (err) { xmlFreeNode(n); ! export_pg(pg, eelts, 0); return; } --- 9242,9252 ---- err = 1; if (err) { xmlFreeNode(n); ! export_pg(pg, eelts, SCE_ALL_VALUES); return; }
*** 9419,9429 **** } else if (strcmp(exp_str, SCF_PROPERTY_ENVIRONMENT) == 0) { if (env != NULL) continue; } ! export_property(exp_prop, exp_str, &elts, 0); } if (ret == -1) scfdie(); (void) xmlAddChild(n, elts.stability); --- 9419,9429 ---- } else if (strcmp(exp_str, SCF_PROPERTY_ENVIRONMENT) == 0) { if (env != NULL) continue; } ! export_property(exp_prop, exp_str, &elts, SCE_ALL_VALUES); } if (ret == -1) scfdie(); (void) xmlAddChild(n, elts.stability);
*** 9535,9545 **** } xmlFreeNode(s); } ! export_property(exp_prop, exp_str, &elts, 0); } if (ret == -1) scfdie(); if (elts.propvals != NULL || elts.properties != NULL) --- 9535,9545 ---- } xmlFreeNode(s); } ! export_property(exp_prop, exp_str, &elts, SCE_ALL_VALUES); } if (ret == -1) scfdie(); if (elts.propvals != NULL || elts.properties != NULL)
*** 9631,9641 **** if (ret == -1) scfdie(); if (err && env == NULL) { xmlFreeNode(n); ! export_pg(pg, elts, 0); return; } elts->method_context = n; } --- 9631,9641 ---- if (ret == -1) scfdie(); if (err && env == NULL) { xmlFreeNode(n); ! export_pg(pg, elts, SCE_ALL_VALUES); return; } elts->method_context = n; }
*** 9745,9755 **** } xmlFreeNode(s); } ! export_property(exp_prop, exp_str, &pgelts, 0); } if (ret == -1) scfdie(); (void) xmlAddChild(n, pgelts.stability); --- 9745,9755 ---- } xmlFreeNode(s); } ! export_property(exp_prop, exp_str, &pgelts, SCE_ALL_VALUES); } if (ret == -1) scfdie(); (void) xmlAddChild(n, pgelts.stability);
*** 9794,9804 **** scfdie(); 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); continue; } if (scf_property_get_name(exp_prop, exp_str, exp_str_sz) < 0) scfdie(); --- 9794,9805 ---- scfdie(); 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, ! SCE_ALL_VALUES); continue; } if (scf_property_get_name(exp_prop, exp_str, exp_str_sz) < 0) scfdie();
*** 9825,9835 **** warn(gettext("The value of %s is not a valid " "FMRI.\n"), fmri); } ! export_property(exp_prop, exp_str, &pgelts, 0); continue; case SCF_ERROR_CONSTRAINT_VIOLATED: if (g_verbose) { if (scf_property_to_fmri(exp_prop, fmri, --- 9826,9837 ---- warn(gettext("The value of %s is not a valid " "FMRI.\n"), fmri); } ! export_property(exp_prop, exp_str, &pgelts, ! SCE_ALL_VALUES); continue; case SCF_ERROR_CONSTRAINT_VIOLATED: if (g_verbose) { if (scf_property_to_fmri(exp_prop, fmri,
*** 9838,9848 **** warn(gettext("The value of %s does not specify " "a service or an instance.\n"), fmri); } ! export_property(exp_prop, exp_str, &pgelts, 0); continue; case SCF_ERROR_NOT_FOUND: if (g_verbose) { if (scf_property_to_fmri(exp_prop, fmri, --- 9840,9851 ---- warn(gettext("The value of %s does not specify " "a service or an instance.\n"), fmri); } ! export_property(exp_prop, exp_str, &pgelts, ! SCE_ALL_VALUES); continue; case SCF_ERROR_NOT_FOUND: if (g_verbose) { if (scf_property_to_fmri(exp_prop, fmri,
*** 9851,9861 **** warn(gettext("The entity specified by %s does " "not exist.\n"), fmri); } ! export_property(exp_prop, exp_str, &pgelts, 0); continue; default: #ifndef NDEBUG (void) fprintf(stderr, "%s:%d: %s() failed with " --- 9854,9865 ---- warn(gettext("The entity specified by %s does " "not exist.\n"), fmri); } ! export_property(exp_prop, exp_str, &pgelts, ! SCE_ALL_VALUES); continue; default: #ifndef NDEBUG (void) fprintf(stderr, "%s:%d: %s() failed with "
*** 9870,9880 **** scfdie(); warn(gettext("Entity %s is missing dependency property " "group %s.\n"), fmri, exp_str); ! export_property(exp_prop, NULL, &pgelts, 0); continue; } if (scf_pg_get_type(opg, type, max_scf_pg_type_len + 1) < 0) scfdie(); --- 9874,9885 ---- scfdie(); warn(gettext("Entity %s is missing dependency property " "group %s.\n"), fmri, exp_str); ! export_property(exp_prop, NULL, &pgelts, ! SCE_ALL_VALUES); continue; } if (scf_pg_get_type(opg, type, max_scf_pg_type_len + 1) < 0) scfdie();
*** 9884,9901 **** scfdie(); warn(gettext("Property group %s is not of " "expected type %s.\n"), fmri, SCF_GROUP_DEPENDENCY); ! export_property(exp_prop, NULL, &pgelts, 0); continue; } n = export_dependent(opg, exp_str, fmri); ! if (n == NULL) ! export_property(exp_prop, exp_str, &pgelts, 0); ! else { if (eelts->dependents == NULL) eelts->dependents = n; else (void) xmlAddSibling(eelts->dependents, n); --- 9889,9908 ---- scfdie(); warn(gettext("Property group %s is not of " "expected type %s.\n"), fmri, SCF_GROUP_DEPENDENCY); ! 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, ! SCE_ALL_VALUES); ! } else { if (eelts->dependents == NULL) eelts->dependents = n; else (void) xmlAddSibling(eelts->dependents, n);
*** 10015,10030 **** scfdie(); 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); 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); return; } if (strncmp(exp_str, SCF_PG_TM_MAN_PREFIX, mansz) == 0) { child = export_tm_manpage(pg); --- 10022,10037 ---- scfdie(); 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, 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, SCE_ALL_VALUES); return; } if (strncmp(exp_str, SCF_PG_TM_MAN_PREFIX, mansz) == 0) { child = export_tm_manpage(pg);
*** 10034,10044 **** if (child != NULL) { make_node(&telts->documentation, "documentation"); (void) xmlAddChild(telts->documentation, child); } else { ! export_pg(pg, elts, 0); } } /* * Process parameter and paramval elements --- 10041,10051 ---- if (child != NULL) { make_node(&telts->documentation, "documentation"); (void) xmlAddChild(telts->documentation, child); } else { ! export_pg(pg, elts, SCE_ALL_VALUES); } } /* * Process parameter and paramval elements
*** 10187,10197 **** if (err == 1) { for (i = 0; i < URI_SCHEME_NUM; ++i) xmlFree(type[i]); free(type); ! export_pg(pg, elts, 0); return; } else { for (i = 0; i < URI_SCHEME_NUM; ++i) if (type[i] != NULL) { --- 10194,10204 ---- if (err == 1) { for (i = 0; i < URI_SCHEME_NUM; ++i) xmlFree(type[i]); free(type); ! export_pg(pg, elts, SCE_ALL_VALUES); return; } else { for (i = 0; i < URI_SCHEME_NUM; ++i) if (type[i] != NULL) {
*** 10263,10273 **** } xmlFreeNode(rnode); } ! export_property(exp_prop, exp_str, &pgelts, 0); } if (ret == -1) scfdie(); if (pgelts.propvals != NULL || pgelts.properties != NULL) --- 10270,10280 ---- } xmlFreeNode(rnode); } ! export_property(exp_prop, exp_str, &pgelts, SCE_ALL_VALUES); } if (ret == -1) scfdie(); if (pgelts.propvals != NULL || pgelts.properties != NULL)