Commit Graph

27 Commits

Author SHA1 Message Date
Erik Sjölund
64fbacabbe python: reset pointer after asprintf failure
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2025-06-05 07:14:21 +02:00
Sebastian Gsänger
b4b290888b Fix python call to libcrun_get_verbosity
Fixes erroneous call with an unused argument to a 0-argument function.
Current call fails with GCC 15.1:
```
python/crun_python.c: In function 'get_verbosity':
python/crun_python.c:461:27: error: too many arguments to function 'libcrun_get_verbosity'; expected 0, have 1
  461 |   return PyLong_FromLong (libcrun_get_verbosity (verbosity));
      |                           ^~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~
In file included from /home/user/.cache/yay/crun-krun/src/crun/src/libcrun/container.h:24:
/home/user/.cache/yay/crun-krun/src/crun/src/libcrun/error.h:109:20: note: declared here
  109 | LIBCRUN_PUBLIC int libcrun_get_verbosity ();
      |                    ^~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Sebastian Gsänger <8004308+sgsaenger@users.noreply.github.com>
2025-05-09 01:36:48 +02:00
Sascha Grunert
19b9893076 Add --log-level option
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-08-21 12:02:34 +02:00
Giuseppe Scrivano
7918dca188 container: split create and run options
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-03-01 11:00:27 +01:00
Simon Hirscher
3df8f0c837 Add force_no_cgroup & no_pivot arguments to make_context() Python function
Signed-off-by: Simon Hirscher <git@simonhirscher.de>
2024-02-05 10:18:47 +01:00
Simon Hirscher
b883e6c6bf Make function arguments valid Python identifiers
Signed-off-by: Simon Hirscher <git@simonhirscher.de>
2024-02-05 10:18:42 +01:00
Simon Hirscher
e0027bc660 Add no_new_keyring argument to make_context() Python function
Signed-off-by: Simon Hirscher <git@simonhirscher.de>
2024-02-05 10:18:28 +01:00
Erik Sjölund
3a50988c0c use just enough arg_unused to silence -Wunused-parameter
Remove "arg_unused" where not needed.
Add "args_unused" to be able to use the gcc option
-Werror=unused-parameter when building crun with the
configure flags:

--with-libkrun
--with-mono
--with-python-bindings
--with-wasmedge
--with-wasmer
--with-wasmtime

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-08-14 07:41:01 +02:00
Rubicon Rowe
e0677141f7 python: fix create() referencing container_run()
Signed-off-by: Rubicon Rowe <l1589002388@gmail.com>
2023-03-08 19:41:42 +08:00
Mattéo Delabre
270961fbd6 python: Fix argument type in container_delete
In `container_delete`, the type used for the `force` boolean should be
`b` (a single unsigned byte) instead of `n` (the size of `size_t`).
This incorrect type can cause the neighboring `id` argument to be
overwritten with a NULL value, which makes the container deletion fail.

Signed-off-by: Mattéo Delabre <git.matteo@delab.re>
2022-10-07 11:12:51 -04:00
Mattéo Delabre
1c681c15cd python: Fix argument parsing in make_context
The number of arguments in the format string passed to
`PyArg_ParseTupleAndKeywords` did not match the number of entries in
`kwlist`, resulting in an error when trying to pass non-mandatory
arguments such as `detach`.

Signed-off-by: Mattéo Delabre <git.matteo@delab.re>
2022-10-05 22:40:23 -04:00
Giuseppe Scrivano
88e87109ec python: unset LIBCRUN_RUN_OPTIONS_PREFORK for run
do not create a new process for each run.

Closes: https://github.com/containers/crun/issues/948

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-11 20:30:49 +02:00
Giuseppe Scrivano
2f5be742a2 python: fix build
commit 21a8dafae7 introduced the
regression.

Closes: https://github.com/containers/crun/issues/854

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-01-18 17:13:39 +01:00
Giuseppe Scrivano
21a8dafae7 libcrun: let libcrun_container_kill* accept a string
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-23 10:23:46 +01:00
Qi Feng
51dc99eea3 fix error handling of asprintf 2020-07-31 00:46:08 +08:00
Giuseppe Scrivano
ebc0546899 python: sync with libcrun
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-15 11:42:54 +02:00
Giuseppe Scrivano
34a0ff3cc9 license: change license to gplv2+ and lgpl2.1+
change the license to GPLv2+ and for libcrun to LGPLv2.1+.

Closes: https://github.com/containers/crun/issues/256

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-26 08:04:51 +01:00
Giuseppe Scrivano
8cf80df516 container: do not fork on create
do not fork the current process on create, this prevents creating
additional processes to wait for.

It solves a race when the OCI runtime caller has SUBREAPER set, such
as Buildah.  When the initial process exited, the container process
cannot be directly waited for as there are other processes to reap
first.

Closes: https://github.com/containers/crun/issues/215

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-12-17 18:04:10 +01:00
Giuseppe Scrivano
1c9ffac294 python: fix build errors
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2019-05-31 10:14:24 +02:00
Giuseppe Scrivano
75f183b946 src: fix issues reported by coverity
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2019-03-25 11:11:19 +01:00
Giuseppe Scrivano
57a02dfbc8 src: update copyright years
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2019-01-01 21:29:59 +01:00
Giuseppe Scrivano
8337ad9706 libcrun: rename stderr to errfile
stderr is defined as a macro in musl libc.

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2018-06-13 20:10:49 +02:00
Giuseppe Scrivano
93e9f372e8 python: propagate exit codes
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2018-03-20 15:06:22 +01:00
Giuseppe Scrivano
de6338eaab python: use Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2018-03-15 19:54:53 +01:00
Giuseppe Scrivano
b56b92e8f7 python: expose detach
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2018-03-15 19:54:53 +01:00
Giuseppe Scrivano
319f391420 python: use prefork for run
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2018-03-15 19:54:53 +01:00
Giuseppe Scrivano
a2b5faf88a python: add Python bindings
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2018-03-14 22:29:16 +01:00