Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export libyang API "lyd_check_mandatory_tree" for Management framework (CVL) #5714

Merged
merged 3 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/libyang/patch/libyang_mgmt_framework.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/tree_data.c b/src/tree_data.c
index 04653a46..65dca211 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -842,7 +842,7 @@ error:
return ret;
}

-int
+API int
lyd_check_mandatory_tree(struct lyd_node *root, struct ly_ctx *ctx, const struct lys_module **modules, int mod_count,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this go to upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this patch is just to export lyd_check_mandatory_tree() as API so that CVL can validate mandatory YANG nodes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good to upstream with reason of use. Though no harm in making it an API in our code till then.

int options)
{
1 change: 1 addition & 0 deletions src/libyang/patch/series
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
libyang.patch
libyang_mgmt_framework.patch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the Future, are we planning to put all patches related to a framework in this single file?,
If not, I feel it is better to have a file name based on the patch, for example, "API_lyd_check_mandatory_tree.patch"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are not expecting many changes for libyang library, we have kept a single patch file for libyang changes related to management framework. Please suggest if current filename should be changed to any other generic name e.g. libyang_extension.patch or libyang_ext.patch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ext is not good, libyang_mgmt_framework.patch is fine, but if we had to add in this file in the future then we need to break it down into multiple patches with description.
That will be inline with other sonic repos, how we maintain patches. That will also help if some patches are accepted by upstream and we have to remove them in the future.

swig.patch