Last ACL/XML refactors for now#4149
Open
nrwahl2 wants to merge 29 commits into
Open
Conversation
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>
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
force-pushed
the
nrwahl2-acls_first
branch
from
July 14, 2026 21:31
ee342b8 to
78a4936
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.