mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
daemon: Fix regression of libvirtd reloading support
This is introduced by commit df0b57a95a
, which forgot to
add signal handler for SIGHUP.
A simple reproduce method:
1) Create a domain XML under /etc/libvirt/qemu
2) % kill -SIGHUP $(pidof libvirtd)
3) % virsh list --all (the new created domain XML is not listed)
This commit is contained in:
parent
2a48b59dec
commit
9e093f0b4c
@ -1102,6 +1102,17 @@ static void daemonShutdownHandler(virNetServerPtr srv,
|
||||
virNetServerQuit(srv);
|
||||
}
|
||||
|
||||
static void daemonReloadHandler(virNetServerPtr srv ATTRIBUTE_UNUSED,
|
||||
siginfo_t *sig ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
VIR_INFO("Reloading configuration on SIGHUP");
|
||||
virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
|
||||
VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL);
|
||||
if (virStateReload() < 0)
|
||||
VIR_WARN("Error while reloading drivers");
|
||||
}
|
||||
|
||||
static int daemonSetupSignals(virNetServerPtr srv)
|
||||
{
|
||||
if (virNetServerAddSignalHandler(srv, SIGINT, daemonShutdownHandler, NULL) < 0)
|
||||
@ -1110,6 +1121,8 @@ static int daemonSetupSignals(virNetServerPtr srv)
|
||||
return -1;
|
||||
if (virNetServerAddSignalHandler(srv, SIGTERM, daemonShutdownHandler, NULL) < 0)
|
||||
return -1;
|
||||
if (virNetServerAddSignalHandler(srv, SIGHUP, daemonReloadHandler, NULL) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user