Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swmodd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCM
swmodd
Commits
3ebdf288
Commit
3ebdf288
authored
3 years ago
by
Suvendhu Hansa
Browse files
Options
Downloads
Patches
Plain Diff
optimization of du_list method
parent
82b3c2cb
Branches
Branches containing commit
No related tags found
1 merge request
!25
optimization of du_list method
Pipeline
#37208
passed
3 years ago
Stage: static_code_analysis
Stage: api_test
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/swmod.c
+0
-2
0 additions, 2 deletions
src/swmod.c
src/swmod_lxc.c
+6
-0
6 additions, 0 deletions
src/swmod_lxc.c
src/swmod_opkg.c
+16
-1
16 additions, 1 deletion
src/swmod_opkg.c
with
22 additions
and
3 deletions
src/swmod.c
+
0
−
2
View file @
3ebdf288
...
...
@@ -553,8 +553,6 @@ swmod_du_list(struct ubus_context *ctx, struct ubus_object *obj,
void
*
a
;
unsigned
int
eid
=
get_eid_from_blob
(
msg
);
synchronize_deployment_units_with_map_du_file
();
memset
(
&
bb
,
0
,
sizeof
(
struct
blob_buf
));
blob_buf_init
(
&
bb
,
0
);
...
...
This diff is collapsed.
Click to expand it.
src/swmod_lxc.c
+
6
−
0
View file @
3ebdf288
...
...
@@ -675,6 +675,12 @@ int swmod_lxc_install_update_remove_package(const char *package_path, int cid, i
sscanf
(
g_lxc_buff
,
"pkg_name=%63s pkg_version=%63s"
,
package_name
,
package_version
);
}
char
root
[
512
];
snprintf
(
root
,
512
,
"%s/%s/rootfs"
,
lxcpath
,
ct
->
name
);
PRINT_DEBUG
(
"Reading from container[%s] path[%s]"
,
ct
->
name
,
root
);
populate_opkg_deployment_unit
(
cid
+
2
,
root
,
ct
->
name
);
FREE
(
g_lxc_buff
);
err
=
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/swmod_opkg.c
+
16
−
1
View file @
3ebdf288
...
...
@@ -60,6 +60,11 @@ static int swmod_host_system_install_package(const char *package_path)
pclose
(
log
);
}
if
(
err
==
0
)
{
/* du unit installed, now update the du list */
PRINT_DEBUG
(
"Populate du for eid 1
\n
"
);
populate_opkg_deployment_unit
(
1
,
NULL
,
NULL
);
}
return
err
;
}
...
...
@@ -88,6 +93,11 @@ static int swmod_host_system_update_package(const char *package_path)
package_version
[
len
-
3
]
=
'\0'
;
}
if
(
err
==
0
)
{
/* du unit updated, now update the du list */
PRINT_DEBUG
(
"Populate du for eid 1
\n
"
);
populate_opkg_deployment_unit
(
1
,
NULL
,
NULL
);
}
return
err
;
}
...
...
@@ -110,6 +120,11 @@ int swmod_host_system_remove_package(const char *pname)
pclose
(
log
);
}
if
(
err
==
0
)
{
/* du unit removed, now update the du list */
PRINT_DEBUG
(
"Populate du for eid 1
\n
"
);
populate_opkg_deployment_unit
(
1
,
NULL
,
NULL
);
}
return
err
;
}
...
...
@@ -220,7 +235,7 @@ int swmod_remove_package(const char *pname, int eid)
bool
is_opkg_service
(
const
char
*
opkg_info
,
char
*
pkg_name
)
{
/* Get Config from package_name.list */
bool
service
=
tru
e
;
bool
service
=
fals
e
;
char
pkg_path
[
128
]
=
{
0
};
snprintf
(
pkg_path
,
sizeof
(
pkg_path
),
"%s/%s.list"
,
opkg_info
,
pkg_name
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment