Skip to content

Last ACL/XML refactors for now#4149

Open
nrwahl2 wants to merge 29 commits into
ClusterLabs:mainfrom
nrwahl2:nrwahl2-acls_first
Open

Last ACL/XML refactors for now#4149
nrwahl2 wants to merge 29 commits into
ClusterLabs:mainfrom
nrwahl2:nrwahl2-acls_first

Conversation

@nrwahl2

@nrwahl2 nrwahl2 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Last batch from #4013. There's more work to do on the ACL and XML code, but this is as far as I made it when I was writing all these commits a few months ago.

nrwahl2 added 11 commits July 14, 2026 10:35
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
To replace pcmk_acl_required().

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
It's in utils.c, not acl.c.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
@nrwahl2
nrwahl2 requested a review from clumens July 14, 2026 18:22
nrwahl2 added 18 commits July 14, 2026 14:30
I really doubt that any performance savings we may be getting are enough
to justify the readability cost of (a) defining and testing this
function and (b) calling it before each call to pcmk__xml_escape().

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Nothing uses this yet.

Also assert on NULL fn in other XML foreach functions.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
It only has one caller, and its checks (non-NULL argument and tracking
flag set) will always pass in that caller. So we end up with two lines
of code, which are straightforward to pull into mark_child_created().

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
We'll use it in an upcoming commit that splits XML
change-tracking/committing into a separate file.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
We'll use it in an upcoming commit that splits XML
change-tracking/committing into a separate file.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
I wanted to call it xml_change.c. This code is much more about
calculating and committing changes than about tracking them. However, we
already have patchset{,_display}.c, which deals with XML changes in its
own way. I'm trying to introduce as little confusion as possible. I went
with tracking based on the flag name pcmk__xf_tracking.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
It takes up more space and is slightly less efficient than the
corresponding series of pcmk__xe_set() calls. I don't see an advantage
for readability or performance, so we might as well drop it.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
It's the same as pcmk__output_xml_create_parent() when is_list is true,
and it's the same as pcmk__output_create_xml_node() when is_list is
false.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
I don't think the variadic argument helps readability much. It avoids
the need to store the result in an xmlNode * variable in the caller,
which can save a line. But it requires an extra line for the NULL
terminator, and it requires indenting each line much farther, which is
one reason we have so many temp variables.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
I don't think the variadic argument helps readability much. It avoids
the need to store the result in an xmlNode * variable in the caller,
which can save a line. But it requires an extra line for the NULL
terminator, and it requires indenting each line much farther, which is
one reason we have so many temp variables.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Use pcmk__xe_set_int() instead.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Nothing calls it anymore.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
@nrwahl2
nrwahl2 force-pushed the nrwahl2-acls_first branch from ee342b8 to 78a4936 Compare July 14, 2026 21:31
@nrwahl2 nrwahl2 added the needs attention PRs that someone needs to look at label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs attention PRs that someone needs to look at

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant