!140 Update some inconsistent patches

From: @yezengruan 
Reviewed-by: @kevinzhu1 
Signed-off-by: @kevinzhu1
This commit is contained in:
openeuler-ci-bot 2022-05-11 09:13:58 +00:00 committed by Gitee
commit 44e37dab60
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 128 additions and 95 deletions

View File

@ -1,58 +0,0 @@
From 3c12ed40d06ffe2f2c871667f31925f8727162a4 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Tue, 31 Aug 2021 08:31:06 -0400
Subject: [PATCH] Handle kernel without device-mapper support
---
src/util/virdevmapper.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c
index 2b9e689..158c9d4 100644
--- a/src/util/virdevmapper.c
+++ b/src/util/virdevmapper.c
@@ -53,6 +53,9 @@ virDevMapperGetMajor(unsigned int *major)
VIR_AUTOSTRINGLIST lines = NULL;
size_t i;
+ if (!virFileExists(CONTROL_PATH))
+ return -2;
+
if (virFileReadAll(PROC_DEVICES, BUF_SIZE, &buf) < 0)
return -1;
@@ -124,8 +127,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;
+
+ virReportSystemError(errno, _("Unable to open %s"), CONTROL_PATH);
return -1;
+ }
if (!virDMIoctl(controlFD, DM_VERSION, &dm, &tmp)) {
virReportSystemError(errno, "%s",
@@ -299,7 +307,16 @@ virDevMapperGetTargets(const char *path,
* case, we have to stop recursion somewhere. */
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;
+ }
+
return -1;
+ }
return virDevMapperGetTargetsImpl(controlFD, path, devPaths, ttl);
}
--
2.18.2

View File

@ -1,4 +1,4 @@
From df5d95b8db5ec8a79dee223338a72a9f8897a538 Mon Sep 17 00:00:00 2001 From 0b6e5773058e85b8e5e6ce83d3b275726e6883f2 Mon Sep 17 00:00:00 2001
From: AlexChen <alex.chen@huawei.com> From: AlexChen <alex.chen@huawei.com>
Date: Wed, 16 Sep 2020 15:53:57 +0800 Date: Wed, 16 Sep 2020 15:53:57 +0800
Subject: [PATCH] tests/commandtest: skip the test4 if the testcase is run in 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 <alex.chen@huawei.com> Signed-off-by: AlexChen <alex.chen@huawei.com>
--- ---
tests/commandtest.c | 23 ++++++++++++++++++----- tests/commandtest.c | 11 ++++++++---
1 file changed, 18 insertions(+), 5 deletions(-) 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tests/commandtest.c b/tests/commandtest.c diff --git a/tests/commandtest.c b/tests/commandtest.c
index d5092b7dd0..2cc27c64a1 100644 index d5092b7dd0..ce492e31f7 100644
--- a/tests/commandtest.c --- a/tests/commandtest.c
+++ b/tests/commandtest.c +++ b/tests/commandtest.c
@@ -259,6 +259,7 @@ static int test4(const void *unused G_GNUC_UNUSED) @@ -259,6 +259,7 @@ static int test4(const void *unused G_GNUC_UNUSED)
@ -25,7 +25,7 @@ index d5092b7dd0..2cc27c64a1 100644
if (!pidfile) if (!pidfile)
goto cleanup; 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"); printf("cannot read pidfile\n");
goto cleanup; goto cleanup;
} }
@ -34,40 +34,14 @@ index d5092b7dd0..2cc27c64a1 100644
- -
+ while (kill(pid, 0) != -1) { + while (kill(pid, 0) != -1) {
+ if (count++ >= 600) { + if (count++ >= 600) {
+ printf("check time exceeds 60s, it may be in container env, " + printf("check time exceeds 60s, it may be in container env, skip this testcase!!!\n");
+ "skip this testcase!!!\n");
+ break; + break;
+ } + }
+ g_usleep(100*1000); /* 100ms */ + g_usleep(100*1000); /* 100 */
+ } + }
ret = checkoutput("test4", NULL); ret = checkoutput("test4", NULL);
cleanup: 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

View File

@ -101,7 +101,7 @@
Summary: Library providing a simple virtualization API Summary: Library providing a simple virtualization API
Name: libvirt Name: libvirt
Version: 6.2.0 Version: 6.2.0
Release: 37 Release: 38
License: LGPLv2+ License: LGPLv2+
URL: https://libvirt.org/ 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 Patch0069: cpu_map-Add-pschange-mc-no-bit-in-IA32_ARCH_CAPABILI.patch
Patch0070: cpu_map-Distribute-x86_Cooperlake.xml.patch Patch0070: cpu_map-Distribute-x86_Cooperlake.xml.patch
Patch0071: Don-t-cache-device-mapper-major.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 Patch0073: virDevMapperGetTargets-Don-t-ignore-EBADF.patch
Patch0074: conf-domain_conf-pin-the-retry_interval-and-retry_ti.patch Patch0074: conf-domain_conf-pin-the-retry_interval-and-retry_ti.patch
Patch0075: storage_driver-Unlock-object-on-ACL-fail-in-storageP.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 Patch0134: tests-qemuxml2argv-Validate-generation-of-JSON-props.patch
Patch0135: qemu-capabilities-Enable-detection-of-QEMU_CAPS_OBJE.patch Patch0135: qemu-capabilities-Enable-detection-of-QEMU_CAPS_OBJE.patch
Patch0136: apparmor-Permit-new-capabilities-required-by-libvirt.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 = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -1980,6 +1981,10 @@ exit 0
%changelog %changelog
* Tue May 10 2022 yezengruan <yezengruan@huawei.com> - 6.2.0-38
- update some inconsistent patches
- virsh: Display vhostuser socket path in domblklist
* Wed Apr 27 2022 yezengruan <yezengruan@huawei.com> - 6.2.0-37 * Wed Apr 27 2022 yezengruan <yezengruan@huawei.com> - 6.2.0-37
- update the format of changelog - update the format of changelog
@ -2045,7 +2050,7 @@ exit 0
* Sat Feb 12 2022 imxcc <xingchaochao@huawei.com> - 6.2.0-31 * Sat Feb 12 2022 imxcc <xingchaochao@huawei.com> - 6.2.0-31
- hotpatch: virsh support autoload mode - hotpatch: virsh support autoload mode
* Fri Jan 29 2022 imxcc <xingchaochao@huawei.com> - 6.2.0-30 * Sat Jan 29 2022 imxcc <xingchaochao@huawei.com> - 6.2.0-30
- Revert "tests: disabale storage tests" - Revert "tests: disabale storage tests"
* Fri Jan 14 2022 imxcc <xingchaochao@huawei.com> - 6.2.0-29 * Fri Jan 14 2022 imxcc <xingchaochao@huawei.com> - 6.2.0-29

View File

@ -0,0 +1,79 @@
From 98581cc016224a13c4245346a1c501af511b3437 Mon Sep 17 00:00:00 2001
From: Michal Privoznik <mprivozn@redhat.com>
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 <abologna@redhat.com>
Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
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 b43dbefa9a..a81e2edee4 100644
--- a/src/util/virdevmapper.c
+++ b/src/util/virdevmapper.c
@@ -54,6 +54,9 @@ virDevMapperGetMajor(unsigned int *major)
VIR_AUTOSTRINGLIST lines = NULL;
size_t i;
+ if (!virFileExists(CONTROL_PATH))
+ return -2;
+
if (virFileReadAll(PROC_DEVICES, BUF_SIZE, &buf) < 0)
return -1;
@@ -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;
+
+ virReportSystemError(errno, _("Unable to open %s"), CONTROL_PATH);
return -1;
+ }
if (!virDMIoctl(controlFD, DM_VERSION, &dm, &tmp)) {
virReportSystemError(errno, "%s",
@@ -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 == -2) {
+ /* The CONTROL_PATH doesn't exist. Probably the
+ * module isn't loaded, yet. Don't error out, just
+ * exit. */
+ return 0;
+ }
+
return -1;
+ }
return virDevMapperGetTargetsImpl(controlFD, path, devPaths, ttl);
}
--
2.27.0

View File

@ -0,0 +1,33 @@
From d5de781c93c695ed92fa181764f9f0cfbb508074 Mon Sep 17 00:00:00 2001
From: dinglimin <dinglimin@cmss.chinamobile.com>
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 <dinglimin@cmss.chinamobile.com>
---
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