#include <crm_internal.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <errno.h>
#include <math.h>
#include <sys/stat.h>
#include <crm/msg_xml.h>
#include <crm/common/xml.h>
Go to the source code of this file.
|
void | xml_log (int priority, const char *fmt,...) G_GNUC_PRINTF(2 |
|
const char * | xml_latest_schema (void) |
|
void | crm_schema_init (void) |
|
void | crm_schema_cleanup (void) |
|
gboolean | validate_xml_verbose (xmlNode *xml_blob) |
|
gboolean | validate_xml (xmlNode *xml_blob, const char *validation, gboolean to_logs) |
|
const char * | get_schema_name (int version) |
|
int | get_schema_version (const char *name) |
|
int | update_validation (xmlNode **xml_blob, int *best, int max, gboolean transform, gboolean to_logs) |
| Try update CIB XML to the highest pacemaker's standard if feasible. More...
|
|
gboolean | cli_config_update (xmlNode **xml, int *best_version, gboolean to_logs) |
|
gboolean cli_config_update |
( |
xmlNode ** |
xml, |
|
|
int * |
best_version, |
|
|
gboolean |
to_logs |
|
) |
| |
void crm_schema_cleanup |
( |
void |
| ) |
|
void crm_schema_init |
( |
void |
| ) |
|
const char* get_schema_name |
( |
int |
version | ) |
|
int get_schema_version |
( |
const char * |
name | ) |
|
int update_validation |
( |
xmlNode ** |
xml_blob, |
|
|
int * |
best, |
|
|
int |
max, |
|
|
gboolean |
transform, |
|
|
gboolean |
to_logs |
|
) |
| |
Try update CIB XML to the highest pacemaker's standard if feasible.
"Update" means either actively employ XSLT-based transformation(s) (if intermediate product to transform valid per its declared schema version, transformation available, proceeded successfully with a result valid per expectated newer schema version), or just try to bump the marked validating schema until all gradually rising schema versions attested or the first such attempt subsequently fails to validate. Which of the two styles will be used depends on transform
parameter (positive/negative, respectively).
- Parameters
-
| in/out] | xml_blob XML tree representing CIB, may be swapped with an "updated" one |
[out] | best | The highest configuration version (per its index in the global schemas table) it was possible to reach during the update steps while ensuring the validity of the result; if no validation success was observed against possibly multiple schemas, the value is less or equal the result of get_schema_version applied on the input xml_blob value (unless that function maps it to -1, then 0 would be used instead) |
[in] | max | When transform is positive, this allows to set upper boundary schema (per its index in the global schemas table) beyond which its forbidden to update by the means of XSLT transformation |
[in] | transform | Whether to employ XSLT-based transformation so as allow overcoming possible incompatibilities between major schema versions (see above) |
[in] | to_logs | If true, output notable progress info to internal log streams; if false, to stderr |
- Returns
pcmk_ok
if no non-recoverable error encountered (up to caller to evaluate if the update satisfies the requirements per returned best
value), negative value carrying the reason otherwise
Definition at line 710 of file schemas.c.
gboolean validate_xml |
( |
xmlNode * |
xml_blob, |
|
|
const char * |
validation, |
|
|
gboolean |
to_logs |
|
) |
| |
gboolean validate_xml_verbose |
( |
xmlNode * |
xml_blob | ) |
|
const char* xml_latest_schema |
( |
void |
| ) |
|
void void xml_log |
( |
int |
priority, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |