Re: [PATCH 2/2] virtlo(g|ck)d: Fix exec-restart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/10/21 9:37 AM, Peter Krempa wrote:
Commit 94e45d1042e broke exec-restart of virtlogd and virtlockd as the
code waiting for the daemon shutdown closed the daemons before
exec-restarting.

This reminds me of an odd issue we encountered three years ago, fixed by Daniel

https://listman.redhat.com/archives/libvir-list/2018-March/msg00298.html

I tested your patches but notice locks are still lost on re-exec.

qemu.conf:
lock_manager = "lockd"

qemu-lockd.conf:
file_lockspace_dir = "/var/lib/libvirt/lockspace"

/var/lib/libvirt/lockspace is nothing special, xfs on a local disk. After starting a VM

# ls /var/lib/libvirt/lockspace/
a89872e150e6b9e4cbd59ef2bd289bc6cd0a8fa6fbf533c41957f77a90381e9c
# lslocks | grep lockd
virtlockd 95009 POSIX WRITE 0 0 0 /var/lib/libvirt/lockspace/a89872e150e6b9e4cbd59ef2bd289bc6cd0a8fa6fbf533c41957f77a90381e9c
virtlockd       95009  POSIX   5B WRITE 0          0          0 /run/virtlockd.pid
# systemctl reload virtlockd
# ls /var/lib/libvirt/lockspace/
a89872e150e6b9e4cbd59ef2bd289bc6cd0a8fa6fbf533c41957f77a90381e9c
# lslocks | grep lockd
#

Regards,
Jim


Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1912243
Fixes: 94e45d1042e
Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
  src/locking/lock_daemon.c | 2 +-
  src/logging/log_daemon.c  | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 04038d2668..ffde2017ac 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -336,7 +336,7 @@ virLockDaemonExecRestartHandler(virNetDaemonPtr dmn,
                                  void *opaque G_GNUC_UNUSED)
  {
      execRestart = true;
-    virNetDaemonQuit(dmn);
+    virNetDaemonQuitExecRestart(dmn);
  }

  static int
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index aa76dcd329..e81de50899 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -283,7 +283,7 @@ virLogDaemonExecRestartHandler(virNetDaemonPtr dmn,
                                 void *opaque G_GNUC_UNUSED)
  {
      execRestart = true;
-    virNetDaemonQuit(dmn);
+    virNetDaemonQuitExecRestart(dmn);
  }

  static int





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux