Changed module-specific upgrade API, not backward compatible. The API has been simplified which means more has to be done by the programmer.
* In summary, a user registers an upgrade callback per module. The callback is called at startup if the module is added, has been removed or if the revision on file is different from the one in the system. * The register function has removed `from` and `rev` parameters: `upgrade_callback_register(h, cb, namespace, arg)` * The callback function has a new `op` parameter with possible values: `XML_FLAG_ADD`, `XML_FLAG_CHANGE` or `XML_FLAG_CHANGE`: `clicon_upgrade_cb(h, xn, ns, op, from, to, arg, cbret)`
This commit is contained in:
parent
e2b3cdb3f6
commit
8f1de15ad3
10 changed files with 257 additions and 185 deletions
|
|
@ -356,6 +356,7 @@ changelog_iterate(clicon_handle h,
|
|||
* @param[in] h Clicon handle
|
||||
* @param[in] xt Top-level XML tree to be updated (includes other ns as well)
|
||||
* @param[in] namespace Namespace of module (for info)
|
||||
* @param[in] op One of XML_FLAG_ADD, _DEL, _CHANGE
|
||||
* @param[in] from From revision on the form YYYYMMDD
|
||||
* @param[in] to To revision on the form YYYYMMDD (0 not in system)
|
||||
* @param[in] arg User argument given at rpc_callback_register()
|
||||
|
|
@ -367,12 +368,13 @@ changelog_iterate(clicon_handle h,
|
|||
*/
|
||||
int
|
||||
xml_changelog_upgrade(clicon_handle h,
|
||||
cxobj *xt,
|
||||
char *namespace,
|
||||
uint32_t from,
|
||||
uint32_t to,
|
||||
void *arg,
|
||||
cbuf *cbret)
|
||||
cxobj *xt,
|
||||
char *namespace,
|
||||
uint16_t op,
|
||||
uint32_t from,
|
||||
uint32_t to,
|
||||
void *arg,
|
||||
cbuf *cbret)
|
||||
{
|
||||
int retval = -1;
|
||||
cxobj *xchlog; /* changelog */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue