Skip to contentSkip to conversation

small changes on criu and lxc

PATCH In review Xiangyu Chen 2 participants 5 messages Jan 7, 2024 – Jan 15, 2024

lore
Share & tools
lore
#0 lore raw

cover small changes on criu and lxc

From: Xiangyu Chen <[email protected]>

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
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 criu: add kernel configuration features

From: Xiangyu Chen <[email protected]>

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

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

---
 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
recipes-kernel/linux/linux-yocto/criu.cfg new file +8 -0
new file mode 100644
index 00000000..314addfa
@@ -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
recipes-kernel/linux/linux-yocto/criu.scc new file +4 -0
new file mode 100644
index 00000000..87a88113
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Enable Networking Features needed by criu."
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware criu.cfg
recipes-kernel/linux/linux-yocto_virtualization.inc +1 -0
index 84a7bd84..a37759ef 100644
@@ -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)}"
 
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/3 criu: add cgroup-lite to RDEPENDS

In reply to Xiangyu Chen

From: Xiangyu Chen <[email protected]>

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

---
 recipes-containers/criu/criu_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/criu/criu_git.bb +1 -1
index bda0aa2a..0ff5850e 100644
@@ -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"
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/3 lxc: adjust the lxc-test-unpriv running order

In reply to Xiangyu Chen

From: Xiangyu Chen <[email protected]>

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.

---
 recipes-containers/lxc/files/run-ptest | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
recipes-containers/lxc/files/run-ptest +24 -1
index 2e5af3c3..196adb04 100644
@@ -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"
Signature · 1 line
2.34.1
#4 lore raw
In reply to Xiangyu Chen

In message: [meta-virtualization][PATCH 0/3] small changes on criu and lxc

Quoted 6 lines · on 07/01/2024 Xiangyu Chen wrote:

From: Xiangyu Chen <[email protected]>

Hi Bruce,

There are 3 small fix on criu and lxc package.

Quoted 7 lines

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

Quoted 34 lines

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
Signature · 11 lines
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: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-