Commit Graph

13 Commits

Author SHA1 Message Date
Stéphane Graber
ab35147cde
lua: fix crash on missing blkio
Closes: #403

Signed-off-by: Dwight Engen
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-26 00:11:55 -05:00
PiXy
ed70d07839 added container:attach() into the Lua API 2014-11-07 11:04:42 +02:00
Dwight Engen
8585f20444 lua: add cmd_get_config_item to API
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-11-05 12:31:48 -05:00
Dwight Engen
2752ecec32 lxc-top: show kernel memory being used if available
- Also removed duplicate stats_clear lua function

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-11-04 06:37:11 -06:00
Dwight Engen
891f838ba8 lua: fix stats collection using get_cgroup_item
Previously, the lua stats collection was building its own paths to the
cgroup files, which could be wrong depending on what --with-cgroup-pattern
was passed to configure. Fix it to use the get_cgroup_item api so it
always finds the files.

Remove cgroup_path_get since it is not used anymore.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-11-04 06:37:10 -06:00
Dwight Engen
80ee22284b add [gs]et_cgroup_item to lua api
fix up api test to run and add test for new [gs]et_cgroup_item

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-11-04 06:37:08 -06:00
Dwight Engen
330da5fa32 lua: fix stats gathering
- remove lxc subdir in cgroup paths (done in commit b98f7d6e)
- remove extraneous debug printfs
- remove extra call to stats_clear

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-05 19:58:55 -04:00
Natanael Copa
c25c2970a6 lua: implement dirname in C rather than depend on external executable
Instead of popen and run external executable dirname we implement a
dirname in C in the core module.

We also remove the unused basename function.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-05 19:58:28 -04:00
Natanael Copa
44a80d675f lua: prepare for Lua 5.2
Adjust code for Lua 5.2 and keep compatibility with Lua 5.1.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-05 19:57:34 -04:00
Natanael Copa
2698b46924 lua: fix a bug in the parsing of /proc/mounts
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-09-05 19:57:08 -04:00
Serge Hallyn
c66e9b01f0 lua: update license
As with other files, update to be LGPL since these are part
of the lxc library.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2013-09-03 09:07:56 -05:00
Dwight Engen
83c98d825e Update Lua API
Add [gs]et_config_path from API to Lua binding. Add additional optional
parameter to container_new(). Add tests for these new Lua API bindings.
Commit 2a59a681 changed the meaning of lxc_path_get() in the binding,
causing lua script breakage. Reinstate original behavior of
lxc_path_get() and rename it to lxc_default_config_path_get() to make
its intent clearer.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-02-11 17:37:10 -05:00
Dwight Engen
f080ffd7d6 add lua binding for the lxc API
The lua binding is based closely on the python binding. Also included are
a test program for excercising the binding, and an lxc-top utility for
showing statistics on running containers.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2013-01-28 18:04:08 -05:00