代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From cc842aa3030697b1a454e15ccfb2a201e57d5602 Mon Sep 17 00:00:00 2001
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 15 Jun 2020 12:53:48 +0200
Subject: [PATCH 3/6] leaseshelper: Report more errors
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some functions or code paths that may fail don't report error
(e.g. when acquiring PID file fails) leading to a silent quit
of the leaseshelper. This makes it super hard for us and users
to debug what is happening. Fortunately, dnsmasq captures both
stdout and stderr so we can write an error message there.
cherry pick from: 9ed345ac1a035c8cf1de37431de638f4bac41de3
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
src/network/leaseshelper.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c
index 86c847d..2b5fc0f 100644
--- a/src/network/leaseshelper.c
+++ b/src/network/leaseshelper.c
@@ -131,8 +131,10 @@ main(int argc, char **argv)
* events for expired leases. So, libvirtd sets another env var for this
* purpose */
if (!interface &&
- !(interface = getenv("VIR_BRIDGE_NAME")))
- goto cleanup;
+ !(interface = getenv("VIR_BRIDGE_NAME"))) {
+ fprintf(stderr, _("interface not set\n"));
+ exit(EXIT_FAILURE);
+ }
ip = argv[3];
mac = argv[2];
@@ -160,13 +162,21 @@ main(int argc, char **argv)
pid_file = g_strdup(RUNSTATEDIR "/leaseshelper.pid");
/* Try to claim the pidfile, exiting if we can't */
- if ((pid_file_fd = virPidFileAcquirePath(pid_file, true, getpid())) < 0)
+ if ((pid_file_fd = virPidFileAcquirePath(pid_file, true, getpid())) < 0) {
+ fprintf(stderr,
+ _("Unable to acquire PID file: %s\n errno=%d"),
+ pid_file, errno);
goto cleanup;
+ }
/* Since interfaces can be hot plugged, we need to make sure that the
* corresponding custom lease file exists. If not, 'touch' it */
- if (virFileTouch(custom_lease_file, 0644) < 0)
+ if (virFileTouch(custom_lease_file, 0644) < 0) {
+ fprintf(stderr,
+ _("Unable to create: %s\n errno=%d"),
+ custom_lease_file, errno);
goto cleanup;
+ }
switch ((enum virLeaseActionFlags) action) {
case VIR_LEASE_ACTION_ADD:
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。