Feature: libcrmcommon: Require version info when applying CIB patches
Previously, if a CIB patch was missing source or target version numbers,
we treated the missing numbers as zero when checking whether applying
the patch would be allowed. Now, we treat missing version numbers as an
error and decide that applying the patch is not allowed.
This should not affect typical callers or users. When Pacemaker
generates a CIB patchset (using, for example, crm_diff or
xml_create_patchset()), it adds the version numbers automatically. So
version numbers should be present in a patchset they were removed
manually.
This commit adds a new pcmk__xml_patchset_versions() function.
Preserve the body of xml_patch_versions() because the new function
returns EINVAL in the case where we fail to parse version numbers as
integers.
The order of arguments changes. I think it's clearer to use "source" and
then "target". In v1 patchsets, we used "add"/"remove", but we can start
moving away from that.
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>