From 43c328da8048150ded2d24aed6b10096ff75ceff Mon Sep 17 00:00:00 2001 From: yezengruan Date: Tue, 10 May 2022 20:15:17 +0800 Subject: [PATCH] update some inconsistent patches Signed-off-by: yezengruan --- ...t-skip-the-test4-if-the-testcase-is-.patch | 42 +++----------- libvirt.spec | 11 +++- ...dle-kernel-without-device-mapper-sup.patch | 55 +++++++++++++------ ...-vhostuser-socket-path-in-domblklist.patch | 33 +++++++++++ 4 files changed, 87 insertions(+), 54 deletions(-) rename Handle-kernel-without-device-mapper-support.patch => virdevmapper-Handle-kernel-without-device-mapper-sup.patch (34%) create mode 100644 virsh-Display-vhostuser-socket-path-in-domblklist.patch diff --git a/libvirt-tests-commandtest-skip-the-test4-if-the-testcase-is-.patch b/libvirt-tests-commandtest-skip-the-test4-if-the-testcase-is-.patch index 4e56639..002849f 100644 --- a/libvirt-tests-commandtest-skip-the-test4-if-the-testcase-is-.patch +++ b/libvirt-tests-commandtest-skip-the-test4-if-the-testcase-is-.patch @@ -1,4 +1,4 @@ -From df5d95b8db5ec8a79dee223338a72a9f8897a538 Mon Sep 17 00:00:00 2001 +From 0b6e5773058e85b8e5e6ce83d3b275726e6883f2 Mon Sep 17 00:00:00 2001 From: AlexChen Date: Wed, 16 Sep 2020 15:53:57 +0800 Subject: [PATCH] tests/commandtest: skip the test4 if the testcase is run in @@ -10,11 +10,11 @@ the compilation to hung. So, skip it. Signed-off-by: AlexChen --- - tests/commandtest.c | 23 ++++++++++++++++++----- - 1 file changed, 18 insertions(+), 5 deletions(-) + tests/commandtest.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/commandtest.c b/tests/commandtest.c -index d5092b7dd0..2cc27c64a1 100644 +index d5092b7dd0..ce492e31f7 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -259,6 +259,7 @@ static int test4(const void *unused G_GNUC_UNUSED) @@ -25,7 +25,7 @@ index d5092b7dd0..2cc27c64a1 100644 if (!pidfile) goto cleanup; -@@ -275,9 +276,14 @@ static int test4(const void *unused G_GNUC_UNUSED) +@@ -275,9 +276,13 @@ static int test4(const void *unused G_GNUC_UNUSED) printf("cannot read pidfile\n"); goto cleanup; } @@ -34,40 +34,14 @@ index d5092b7dd0..2cc27c64a1 100644 - + while (kill(pid, 0) != -1) { + if (count++ >= 600) { -+ printf("check time exceeds 60s, it may be in container env, " -+ "skip this testcase!!!\n"); ++ printf("check time exceeds 60s, it may be in container env, skip this testcase!!!\n"); + break; + } -+ g_usleep(100*1000); /* 100ms */ ++ g_usleep(100*1000); /* 100 */ + } ret = checkoutput("test4", NULL); cleanup: -@@ -734,6 +740,7 @@ static int test18(const void *unused G_GNUC_UNUSED) - char *pidfile = virPidFileBuildPath(abs_builddir, "commandhelper"); - pid_t pid; - int ret = -1; -+ int count = 0; - - if (!pidfile) - goto cleanup; -@@ -760,8 +767,14 @@ static int test18(const void *unused G_GNUC_UNUSED) - goto cleanup; - } - -- while (kill(pid, SIGINT) != -1) -- g_usleep(100*1000); -+ while (kill(pid, SIGINT) != -1) { -+ if (count++ >= 600) { -+ printf("check time exceeds 60s, it may be in container env, " -+ "skip this testcase!!!\n"); -+ break; -+ } -+ g_usleep(100*1000); /* 100ms */ -+ } - - ret = 0; - -- -2.23.0 +2.27.0 diff --git a/libvirt.spec b/libvirt.spec index 6e8d3c5..d4551e0 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -101,7 +101,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.2.0 -Release: 37 +Release: 38 License: LGPLv2+ URL: https://libvirt.org/ @@ -181,7 +181,7 @@ Patch0068: cpu_map-Add-Cooperlake-x86-CPU-model.patch Patch0069: cpu_map-Add-pschange-mc-no-bit-in-IA32_ARCH_CAPABILI.patch Patch0070: cpu_map-Distribute-x86_Cooperlake.xml.patch Patch0071: Don-t-cache-device-mapper-major.patch -Patch0072: Handle-kernel-without-device-mapper-support.patch +Patch0072: virdevmapper-Handle-kernel-without-device-mapper-sup.patch Patch0073: virDevMapperGetTargets-Don-t-ignore-EBADF.patch Patch0074: conf-domain_conf-pin-the-retry_interval-and-retry_ti.patch Patch0075: storage_driver-Unlock-object-on-ACL-fail-in-storageP.patch @@ -246,6 +246,7 @@ Patch0133: qemu-command-Use-JSON-for-QAPIfied-object-directly.patch Patch0134: tests-qemuxml2argv-Validate-generation-of-JSON-props.patch Patch0135: qemu-capabilities-Enable-detection-of-QEMU_CAPS_OBJE.patch Patch0136: apparmor-Permit-new-capabilities-required-by-libvirt.patch +Patch0137: virsh-Display-vhostuser-socket-path-in-domblklist.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -1980,6 +1981,10 @@ exit 0 %changelog +* Tue May 10 2022 yezengruan - 6.2.0-38 +- update some inconsistent patches +- virsh: Display vhostuser socket path in domblklist + * Wed Apr 27 2022 yezengruan - 6.2.0-37 - update the format of changelog @@ -2045,7 +2050,7 @@ exit 0 * Sat Feb 12 2022 imxcc - 6.2.0-31 - hotpatch: virsh support autoload mode -* Fri Jan 29 2022 imxcc - 6.2.0-30 +* Sat Jan 29 2022 imxcc - 6.2.0-30 - Revert "tests: disabale storage tests" * Fri Jan 14 2022 imxcc - 6.2.0-29 diff --git a/Handle-kernel-without-device-mapper-support.patch b/virdevmapper-Handle-kernel-without-device-mapper-sup.patch similarity index 34% rename from Handle-kernel-without-device-mapper-support.patch rename to virdevmapper-Handle-kernel-without-device-mapper-sup.patch index 6762ee5..6d4f9e5 100644 --- a/Handle-kernel-without-device-mapper-support.patch +++ b/virdevmapper-Handle-kernel-without-device-mapper-sup.patch @@ -1,17 +1,37 @@ -From 3c12ed40d06ffe2f2c871667f31925f8727162a4 Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 31 Aug 2021 08:31:06 -0400 -Subject: [PATCH] Handle kernel without device-mapper support +From 98581cc016224a13c4245346a1c501af511b3437 Mon Sep 17 00:00:00 2001 +From: Michal Privoznik +Date: Tue, 18 Aug 2020 11:04:24 +0200 +Subject: [PATCH] virdevmapper: Handle kernel without device-mapper support +In one of my latest patch (v6.6.0~30) I was trying to remove +libdevmapper use in favor of our own implementation. However, the +code did not take into account that device mapper can be not +compiled into the kernel (e.g. be a separate module that's not +loaded) in which case /proc/devices won't have the device-mapper +major number and thus virDevMapperGetTargets() and/or +virIsDevMapperDevice() fails. + +However, such failure is safe to ignore, because if device mapper +is missing then there can't be any multipath devices and thus we +don't need to allow the deps in CGroups, nor create them in the +domain private namespace, etc. + +Fixes: 22494556542c676d1b9e7f1c1f2ea13ac17e1e3e +Reported-by: Andrea Bolognani +Reported-by: Christian Ehrhardt +Signed-off-by: Michal Privoznik +Reviewed-by: Peter Krempa +Reviewed-by: Christian Ehrhardt +Tested-by: Christian Ehrhardt --- - src/util/virdevmapper.c | 19 ++++++++++++++++++- - 1 file changed, 18 insertions(+), 1 deletion(-) + src/util/virdevmapper.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c -index 2b9e689..158c9d4 100644 +index b43dbefa9a..a81e2edee4 100644 --- a/src/util/virdevmapper.c +++ b/src/util/virdevmapper.c -@@ -53,6 +53,9 @@ virDevMapperGetMajor(unsigned int *major) +@@ -54,6 +54,9 @@ virDevMapperGetMajor(unsigned int *major) VIR_AUTOSTRINGLIST lines = NULL; size_t i; @@ -21,14 +41,14 @@ index 2b9e689..158c9d4 100644 if (virFileReadAll(PROC_DEVICES, BUF_SIZE, &buf) < 0) return -1; -@@ -124,8 +127,13 @@ virDMOpen(void) +@@ -126,8 +129,13 @@ virDMOpen(void) memset(&dm, 0, sizeof(dm)); - if ((controlFD = open(CONTROL_PATH, O_RDWR)) < 0) + if ((controlFD = open(CONTROL_PATH, O_RDWR)) < 0) { + if (errno == ENOENT) -+ return -2; ++ return -2; + + virReportSystemError(errno, _("Unable to open %s"), CONTROL_PATH); return -1; @@ -36,16 +56,17 @@ index 2b9e689..158c9d4 100644 if (!virDMIoctl(controlFD, DM_VERSION, &dm, &tmp)) { virReportSystemError(errno, "%s", -@@ -299,7 +307,16 @@ virDevMapperGetTargets(const char *path, +@@ -300,8 +308,16 @@ virDevMapperGetTargets(const char *path, + * consist of devices or yet another targets. If that's the * case, we have to stop recursion somewhere. */ - if ((controlFD = virDMOpen()) < 0) +- if ((controlFD = virDMOpen()) < 0) + if ((controlFD = virDMOpen()) < 0) { + if (controlFD == -2) { -+ /* The CONTROL_PATH doesn't exist. Probably the -+ * module isn't loaded, yet. Don't error out, just -+ * exit. */ -+ return 0; ++ /* The CONTROL_PATH doesn't exist. Probably the ++ * module isn't loaded, yet. Don't error out, just ++ * exit. */ ++ return 0; + } + return -1; @@ -54,5 +75,5 @@ index 2b9e689..158c9d4 100644 return virDevMapperGetTargetsImpl(controlFD, path, devPaths, ttl); } -- -2.18.2 +2.27.0 diff --git a/virsh-Display-vhostuser-socket-path-in-domblklist.patch b/virsh-Display-vhostuser-socket-path-in-domblklist.patch new file mode 100644 index 0000000..ca6324c --- /dev/null +++ b/virsh-Display-vhostuser-socket-path-in-domblklist.patch @@ -0,0 +1,33 @@ +From d5de781c93c695ed92fa181764f9f0cfbb508074 Mon Sep 17 00:00:00 2001 +From: dinglimin +Date: Mon, 13 Dec 2021 11:18:09 +0800 +Subject: [PATCH] virsh: Display vhostuser socket path in domblklist + +The domblklist command is designed to show a brief information about the +blocks of a domain. One piece of information that is shows is "Target +"and "Source". Before the modification, the Vhost disk of SPDK is +displayed as "-". After the modification, the socket associated with it +can be displayed. + +Signed-off-by: dinglimin +--- + tools/virsh-domain-monitor.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c +index 9b8c69fa9d..74ff369597 100644 +--- a/tools/virsh-domain-monitor.c ++++ b/tools/virsh-domain-monitor.c +@@ -665,7 +665,8 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd) + "|./source/@dev" + "|./source/@dir" + "|./source/@name" +- "|./source/@volume)", ctxt); ++ "|./source/@volume" ++ "|./source/@path)", ctxt); + } + + if (details) { +-- +2.27.0 + -- Gitee