* [meta-virtualization][master-next][PATCH] lxc: fix compilation error for ARM/ARM64
@ 2022-08-25 13:17 Chen Qi
2022-08-26 2:51 ` Bruce Ashfield
0 siblings, 1 reply; 2+ messages in thread
From: Chen Qi @ 2022-08-25 13:17 UTC (permalink / raw)
To: meta-virtualization
There's compilation error when building lxc for ARM/ARM64 BSPs.
The error message is as below:
| ../git/src/lxc/cgroups/cgfsng.c:1234:111: error: incompatible
type for argument 10 of 'sd_bus_call_method_asyncv'
The 10th argument is of type va_list but NULL is supplied, thus causing
compilation error.
So we use sd_bus_call_method_async to replace the asyncv one to
solve this issue.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
...method_async-to-replace-the-asyncv-o.patch | 49 +++++++++++++++++++
recipes-containers/lxc/lxc_git.bb | 1 +
2 files changed, 50 insertions(+)
create mode 100644 recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch
diff --git a/recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch b/recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch
new file mode 100644
index 0000000..ef87a0c
--- /dev/null
+++ b/recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch
@@ -0,0 +1,49 @@
+From b0abedf60b40adf0f2fb3cf9dfee4bc601f7b39f Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Thu, 25 Aug 2022 05:45:53 -0700
+Subject: [PATCH] use sd_bus_call_method_async to replace the asyncv one
+
+The sd_bus_call_method_asyncv's 10th parameter is of type
+va_list and supplying NULL when invoking it causes compilation
+error. Just replace it with the async one.
+
+Upstream-Status: Submitted [https://github.com/lxc/lxc/pull/4187]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 4 ++--
+ src/lxc/cgroups/cgfsng.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 21955a050..f8bdcf4e8 100644
+--- a/meson.build
++++ b/meson.build
+@@ -295,9 +295,9 @@ if not want_sd_bus.disabled()
+ has_sd_bus = false
+ endif
+
+- if not cc.has_function('sd_bus_call_method_asyncv', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd)
++ if not cc.has_function('sd_bus_call_method_async', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd)
+ if not sd_bus_optional
+- error('libsystemd misses required sd_bus_call_method_asyncv function')
++ error('libsystemd misses required sd_bus_call_method_async function')
+ endif
+
+ has_sd_bus = false
+diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
+index 8a3615893..d90e5385e 100644
+--- a/src/lxc/cgroups/cgfsng.c
++++ b/src/lxc/cgroups/cgfsng.c
+@@ -1232,7 +1232,7 @@ static int unpriv_systemd_create_scope(struct cgroup_ops *ops, struct lxc_conf *
+ if (r < 0)
+ return log_error(SYSTEMD_SCOPE_FAILED, "Failed to connect to user bus: %s", strerror(-r));
+
+- r = sd_bus_call_method_asyncv(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL, NULL);
++ r = sd_bus_call_method_async(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL);
+ if (r < 0)
+ return log_error(SYSTEMD_SCOPE_FAILED, "Failed to subscribe to signals: %s", strerror(-r));
+
+--
+2.37.1
+
diff --git a/recipes-containers/lxc/lxc_git.bb b/recipes-containers/lxc/lxc_git.bb
index bcc1795..9cabe05 100644
--- a/recipes-containers/lxc/lxc_git.bb
+++ b/recipes-containers/lxc/lxc_git.bb
@@ -44,6 +44,7 @@ SRC_URI = "git://github.com/lxc/lxc.git;branch=master;protocol=https \
file://templates-use-curl-instead-of-wget.patch \
file://0001-download-don-t-try-compatbility-index.patch \
file://tests-our-init-is-not-busybox.patch \
+ file://0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch \
file://dnsmasq.conf \
file://lxc-net \
"
--
2.37.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [meta-virtualization][master-next][PATCH] lxc: fix compilation error for ARM/ARM64
2022-08-25 13:17 [meta-virtualization][master-next][PATCH] lxc: fix compilation error for ARM/ARM64 Chen Qi
@ 2022-08-26 2:51 ` Bruce Ashfield
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2022-08-26 2:51 UTC (permalink / raw)
To: Chen Qi; +Cc: meta-virtualization
Thanks for the fixup!
Queued to master-next
Bruce
In message: [meta-virtualization][master-next][PATCH] lxc: fix compilation error for ARM/ARM64
on 25/08/2022 Chen Qi wrote:
> There's compilation error when building lxc for ARM/ARM64 BSPs.
> The error message is as below:
>
> | ../git/src/lxc/cgroups/cgfsng.c:1234:111: error: incompatible
> type for argument 10 of 'sd_bus_call_method_asyncv'
>
> The 10th argument is of type va_list but NULL is supplied, thus causing
> compilation error.
>
> So we use sd_bus_call_method_async to replace the asyncv one to
> solve this issue.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
> ...method_async-to-replace-the-asyncv-o.patch | 49 +++++++++++++++++++
> recipes-containers/lxc/lxc_git.bb | 1 +
> 2 files changed, 50 insertions(+)
> create mode 100644 recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch
>
> diff --git a/recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch b/recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch
> new file mode 100644
> index 0000000..ef87a0c
> --- /dev/null
> +++ b/recipes-containers/lxc/files/0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch
> @@ -0,0 +1,49 @@
> +From b0abedf60b40adf0f2fb3cf9dfee4bc601f7b39f Mon Sep 17 00:00:00 2001
> +From: Chen Qi <Qi.Chen@windriver.com>
> +Date: Thu, 25 Aug 2022 05:45:53 -0700
> +Subject: [PATCH] use sd_bus_call_method_async to replace the asyncv one
> +
> +The sd_bus_call_method_asyncv's 10th parameter is of type
> +va_list and supplying NULL when invoking it causes compilation
> +error. Just replace it with the async one.
> +
> +Upstream-Status: Submitted [https://github.com/lxc/lxc/pull/4187]
> +
> +Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> +---
> + meson.build | 4 ++--
> + src/lxc/cgroups/cgfsng.c | 2 +-
> + 2 files changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/meson.build b/meson.build
> +index 21955a050..f8bdcf4e8 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -295,9 +295,9 @@ if not want_sd_bus.disabled()
> + has_sd_bus = false
> + endif
> +
> +- if not cc.has_function('sd_bus_call_method_asyncv', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd)
> ++ if not cc.has_function('sd_bus_call_method_async', prefix: '#include <systemd/sd-bus.h>', dependencies: libsystemd)
> + if not sd_bus_optional
> +- error('libsystemd misses required sd_bus_call_method_asyncv function')
> ++ error('libsystemd misses required sd_bus_call_method_async function')
> + endif
> +
> + has_sd_bus = false
> +diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
> +index 8a3615893..d90e5385e 100644
> +--- a/src/lxc/cgroups/cgfsng.c
> ++++ b/src/lxc/cgroups/cgfsng.c
> +@@ -1232,7 +1232,7 @@ static int unpriv_systemd_create_scope(struct cgroup_ops *ops, struct lxc_conf *
> + if (r < 0)
> + return log_error(SYSTEMD_SCOPE_FAILED, "Failed to connect to user bus: %s", strerror(-r));
> +
> +- r = sd_bus_call_method_asyncv(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL, NULL);
> ++ r = sd_bus_call_method_async(bus, NULL, DESTINATION, PATH, INTERFACE, "Subscribe", NULL, NULL, NULL);
> + if (r < 0)
> + return log_error(SYSTEMD_SCOPE_FAILED, "Failed to subscribe to signals: %s", strerror(-r));
> +
> +--
> +2.37.1
> +
> diff --git a/recipes-containers/lxc/lxc_git.bb b/recipes-containers/lxc/lxc_git.bb
> index bcc1795..9cabe05 100644
> --- a/recipes-containers/lxc/lxc_git.bb
> +++ b/recipes-containers/lxc/lxc_git.bb
> @@ -44,6 +44,7 @@ SRC_URI = "git://github.com/lxc/lxc.git;branch=master;protocol=https \
> file://templates-use-curl-instead-of-wget.patch \
> file://0001-download-don-t-try-compatbility-index.patch \
> file://tests-our-init-is-not-busybox.patch \
> + file://0001-use-sd_bus_call_method_async-to-replace-the-asyncv-o.patch \
> file://dnsmasq.conf \
> file://lxc-net \
> "
> --
> 2.37.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#7562): https://lists.yoctoproject.org/g/meta-virtualization/message/7562
> Mute This Topic: https://lists.yoctoproject.org/mt/93247732/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-26 2:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25 13:17 [meta-virtualization][master-next][PATCH] lxc: fix compilation error for ARM/ARM64 Chen Qi
2022-08-26 2:51 ` Bruce Ashfield
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.