meta-virtualization.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH 0/3] small changes on criu and lxc
@ 2024-01-07 12:56 Xiangyu Chen
  2024-01-07 12:56 ` [meta-virtualization][PATCH 1/3] criu: add kernel configuration features Xiangyu Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Xiangyu Chen @ 2024-01-07 12:56 UTC (permalink / raw)
  To: meta-virtualization

From: Xiangyu Chen <xiangyu.chen@windriver.com>

Hi Bruce,

There are 3 small fix on criu and lxc package.

patch 1 and 2 related to criu, when using criu dump, it failed and report errors
due to missing sock diag features in kernel and cgroup not init correctly, so add
kernel configuration fragments to enable sock diag and add crgoup-lite to RDEPENDS.

patch 3 related to lxc ptest, some of test cases cannot fully clean the system environment
after exit, that cause lxc-test-unpriv in failure status, so adjust the lxc-test-unpriv
case order to first.

Thanks,

Br,
Xiangyu


Xiangyu Chen (3):
  criu: add kernel configuration features
  criu: add cgroup-lite to RDEPENDS
  lxc: adjust the lxc-test-unpriv running order

 recipes-containers/criu/criu_git.bb           |  2 +-
 recipes-containers/lxc/files/run-ptest        | 25 ++++++++++++++++++-
 recipes-kernel/linux/linux-yocto/criu.cfg     |  8 ++++++
 recipes-kernel/linux/linux-yocto/criu.scc     |  4 +++
 .../linux/linux-yocto_virtualization.inc      |  1 +
 5 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 recipes-kernel/linux/linux-yocto/criu.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto/criu.scc

-- 
2.34.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [meta-virtualization][PATCH 1/3] criu: add kernel configuration features
  2024-01-07 12:56 [meta-virtualization][PATCH 0/3] small changes on criu and lxc Xiangyu Chen
@ 2024-01-07 12:56 ` Xiangyu Chen
  2024-01-07 12:56 ` [meta-virtualization][PATCH 2/3] criu: add cgroup-lite to RDEPENDS Xiangyu Chen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Xiangyu Chen @ 2024-01-07 12:56 UTC (permalink / raw)
  To: meta-virtualization

From: Xiangyu Chen <xiangyu.chen@windriver.com>

criu needs to turn on sock diag features in kernel to do the system dump[1].

Ref:
[1] https://criu.org/Linux_kernel

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
 recipes-kernel/linux/linux-yocto/criu.cfg           | 8 ++++++++
 recipes-kernel/linux/linux-yocto/criu.scc           | 4 ++++
 recipes-kernel/linux/linux-yocto_virtualization.inc | 1 +
 3 files changed, 13 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto/criu.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto/criu.scc

diff --git a/recipes-kernel/linux/linux-yocto/criu.cfg b/recipes-kernel/linux/linux-yocto/criu.cfg
new file mode 100644
index 00000000..314addfa
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto/criu.cfg
@@ -0,0 +1,8 @@
+#Networking options options for sock-diag subsystem
+CONFIG_UNIX_DIAG=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_UDP_DIAG=y
+CONFIG_PACKET_DIAG=y
+CONFIG_NETLINK_DIAG=y
+CONFIG_NETFILTER_XT_MARK=y
+CONFIG_TUN=y
diff --git a/recipes-kernel/linux/linux-yocto/criu.scc b/recipes-kernel/linux/linux-yocto/criu.scc
new file mode 100644
index 00000000..87a88113
--- /dev/null
+++ b/recipes-kernel/linux/linux-yocto/criu.scc
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable Networking Features needed by criu."
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware criu.cfg
diff --git a/recipes-kernel/linux/linux-yocto_virtualization.inc b/recipes-kernel/linux/linux-yocto_virtualization.inc
index 84a7bd84..a37759ef 100644
--- a/recipes-kernel/linux/linux-yocto_virtualization.inc
+++ b/recipes-kernel/linux/linux-yocto_virtualization.inc
@@ -6,6 +6,7 @@ SRC_URI += "file://xt-checksum.scc \
 	    file://lxc.scc \
             file://docker.scc \
 	    file://cgroup-hugetlb.scc \
+	    file://criu.scc \
 	    "
 KERNEL_FEATURES:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'kvm', 'features/kvm/qemu-kvm-enable.scc', '', d)}"
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-virtualization][PATCH 2/3] criu: add cgroup-lite to RDEPENDS
  2024-01-07 12:56 [meta-virtualization][PATCH 0/3] small changes on criu and lxc Xiangyu Chen
  2024-01-07 12:56 ` [meta-virtualization][PATCH 1/3] criu: add kernel configuration features Xiangyu Chen
@ 2024-01-07 12:56 ` Xiangyu Chen
  2024-01-07 12:56 ` [meta-virtualization][PATCH 3/3] lxc: adjust the lxc-test-unpriv running order Xiangyu Chen
  2024-01-15 21:49 ` [meta-virtualization][PATCH 0/3] small changes on criu and lxc Bruce Ashfield
  3 siblings, 0 replies; 5+ messages in thread
From: Xiangyu Chen @ 2024-01-07 12:56 UTC (permalink / raw)
  To: meta-virtualization

From: Xiangyu Chen <xiangyu.chen@windriver.com>

criu needs cgroup-lite to init the cgroup configurations during system start.

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
 recipes-containers/criu/criu_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-containers/criu/criu_git.bb b/recipes-containers/criu/criu_git.bb
index bda0aa2a..0ff5850e 100644
--- a/recipes-containers/criu/criu_git.bb
+++ b/recipes-containers/criu/criu_git.bb
@@ -27,7 +27,7 @@ SRC_URI = "git://github.com/checkpoint-restore/criu.git;branch=master;protocol=h
 COMPATIBLE_HOST = "(x86_64|arm|aarch64).*-linux"
 
 DEPENDS += "libnl libcap protobuf-c-native protobuf-c util-linux-native libbsd libnet"
-RDEPENDS:${PN} = "bash"
+RDEPENDS:${PN} = "bash cgroup-lite"
 
 S = "${WORKDIR}/git"
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [meta-virtualization][PATCH 3/3] lxc: adjust the lxc-test-unpriv running order
  2024-01-07 12:56 [meta-virtualization][PATCH 0/3] small changes on criu and lxc Xiangyu Chen
  2024-01-07 12:56 ` [meta-virtualization][PATCH 1/3] criu: add kernel configuration features Xiangyu Chen
  2024-01-07 12:56 ` [meta-virtualization][PATCH 2/3] criu: add cgroup-lite to RDEPENDS Xiangyu Chen
@ 2024-01-07 12:56 ` Xiangyu Chen
  2024-01-15 21:49 ` [meta-virtualization][PATCH 0/3] small changes on criu and lxc Bruce Ashfield
  3 siblings, 0 replies; 5+ messages in thread
From: Xiangyu Chen @ 2024-01-07 12:56 UTC (permalink / raw)
  To: meta-virtualization

From: Xiangyu Chen <xiangyu.chen@windriver.com>

Some of lxc test cases can not full clean the system environment, that cause
lxc-test-unpriv cannot execute successfully.

Since those code in lxc are using for tests, so just adjust the cases order.

Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
---
 recipes-containers/lxc/files/run-ptest | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/recipes-containers/lxc/files/run-ptest b/recipes-containers/lxc/files/run-ptest
index 2e5af3c3..196adb04 100644
--- a/recipes-containers/lxc/files/run-ptest
+++ b/recipes-containers/lxc/files/run-ptest
@@ -16,6 +16,10 @@ blacklist="$blacklist lxc-test-get_item"
 blacklist="$blacklist lxc-test-shutdowntest"
 blacklist="$blacklist lxc-test-state-server"
 
+# Tests in firstrunlist will be run first
+firstrunlist=""
+firstrunlist="$firstrunlist lxc-test-unpriv"
+
 passed=0
 failed=0
 skipped=0
@@ -26,11 +30,29 @@ rm -f logs/*
 
 echo "### Starting LXC ptest ###"
 
+for test in $firstrunlist
+do
+	./tests/$test >logs/$(basename $test).log 2>&1
+	if [ $? -eq 0 ]
+	then
+		echo "PASS: $(basename $test)"
+		passed=$((passed+1))
+	else
+		echo "FAIL: $(basename $test)"
+		failed=$((failed+1))
+	fi
+done
+
 for test in ./tests/*
 do
     if [[ ! $blacklist = *$(basename $test)*  ]]
     then
-	$test >logs/$(basename $test).log 2>&1
+	if [[ ! $firstrunlist = *$(basename $test)* ]]
+	then
+		$test >logs/$(basename $test).log 2>&1
+	else
+		continue;
+	fi
     else
 	echo "SKIPPED: $(basename $test)"
 	skipped=$((skipped+1))
@@ -47,6 +69,7 @@ do
     fi
 done
 
+
 echo ""
 echo "Results:"
 echo "    PASSED = $passed"
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [meta-virtualization][PATCH 0/3] small changes on criu and lxc
  2024-01-07 12:56 [meta-virtualization][PATCH 0/3] small changes on criu and lxc Xiangyu Chen
                   ` (2 preceding siblings ...)
  2024-01-07 12:56 ` [meta-virtualization][PATCH 3/3] lxc: adjust the lxc-test-unpriv running order Xiangyu Chen
@ 2024-01-15 21:49 ` Bruce Ashfield
  3 siblings, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2024-01-15 21:49 UTC (permalink / raw)
  To: Xiangyu Chen; +Cc: meta-virtualization

In message: [meta-virtualization][PATCH 0/3] small changes on criu and lxc
on 07/01/2024 Xiangyu Chen wrote:

> From: Xiangyu Chen <xiangyu.chen@windriver.com>
> 
> Hi Bruce,
> 
> There are 3 small fix on criu and lxc package.
> 
> patch 1 and 2 related to criu, when using criu dump, it failed and report errors
> due to missing sock diag features in kernel and cgroup not init correctly, so add
> kernel configuration fragments to enable sock diag and add crgoup-lite to RDEPENDS.
> 
> patch 3 related to lxc ptest, some of test cases cannot fully clean the system environment
> after exit, that cause lxc-test-unpriv in failure status, so adjust the lxc-test-unpriv
> case order to first.

Everything looks reasonable to me, and is now staged on master-next.

Bruce

> 
> Thanks,
> 
> Br,
> Xiangyu
> 
> 
> Xiangyu Chen (3):
>   criu: add kernel configuration features
>   criu: add cgroup-lite to RDEPENDS
>   lxc: adjust the lxc-test-unpriv running order
> 
>  recipes-containers/criu/criu_git.bb           |  2 +-
>  recipes-containers/lxc/files/run-ptest        | 25 ++++++++++++++++++-
>  recipes-kernel/linux/linux-yocto/criu.cfg     |  8 ++++++
>  recipes-kernel/linux/linux-yocto/criu.scc     |  4 +++
>  .../linux/linux-yocto_virtualization.inc      |  1 +
>  5 files changed, 38 insertions(+), 2 deletions(-)
>  create mode 100644 recipes-kernel/linux/linux-yocto/criu.cfg
>  create mode 100644 recipes-kernel/linux/linux-yocto/criu.scc
> 
> -- 
> 2.34.1
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#8526): https://lists.yoctoproject.org/g/meta-virtualization/message/8526
> Mute This Topic: https://lists.yoctoproject.org/mt/103576948/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] 5+ messages in thread

end of thread, other threads:[~2024-01-15 21:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-07 12:56 [meta-virtualization][PATCH 0/3] small changes on criu and lxc Xiangyu Chen
2024-01-07 12:56 ` [meta-virtualization][PATCH 1/3] criu: add kernel configuration features Xiangyu Chen
2024-01-07 12:56 ` [meta-virtualization][PATCH 2/3] criu: add cgroup-lite to RDEPENDS Xiangyu Chen
2024-01-07 12:56 ` [meta-virtualization][PATCH 3/3] lxc: adjust the lxc-test-unpriv running order Xiangyu Chen
2024-01-15 21:49 ` [meta-virtualization][PATCH 0/3] small changes on criu and lxc Bruce Ashfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).