Fri Feb 19 16:59:18 IST 2007 Mark McLoughlin <markmc@redhat.com>

* qemud/qemud.c: don't shutdown guest and networks on
        SIGHUP
This commit is contained in:
Mark McLoughlin 2007-02-19 17:00:05 +00:00
parent 272639aaac
commit 96b89415a3
2 changed files with 43 additions and 40 deletions

View File

@ -1,3 +1,8 @@
Fri Feb 19 16:59:18 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/qemud.c: don't shutdown guest and networks on
SIGHUP
Fri Feb 19 16:58:53 IST 2007 Mark McLoughlin <markmc@redhat.com> Fri Feb 19 16:58:53 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/qemud.c: handle SIGQUIT. * qemud/qemud.c: handle SIGQUIT.

View File

@ -81,50 +81,11 @@ static int qemudDispatchSignal(struct qemud_server *server)
return -1; return -1;
} }
qemudLog(QEMUD_INFO, "Received signal %d; shuting down guests and "
"networks and purging config", sigc);
/* shutdown active VMs */
vm = server->activevms;
while (vm) {
struct qemud_vm *next = vm->next;
qemudShutdownVMDaemon(server, vm);
vm = next;
}
/* free inactive VMs */
vm = server->inactivevms;
while (vm) {
struct qemud_vm *next = vm->next;
qemudFreeVM(vm);
vm = next;
}
server->inactivevms = NULL;
server->ninactivevms = 0;
/* shutdown active networks */
network = server->activenetworks;
while (network) {
struct qemud_network *next = network->next;
qemudShutdownNetworkDaemon(server, network);
network = next;
}
/* free inactive networks */
network = server->inactivenetworks;
while (network) {
struct qemud_network *next = network->next;
qemudFreeNetwork(network);
network = next;
}
server->inactivenetworks = NULL;
server->ninactivenetworks = 0;
ret = 0; ret = 0;
switch (sigc) { switch (sigc) {
case SIGHUP: case SIGHUP:
qemudLog(QEMUD_INFO, "Reloading configuration"); qemudLog(QEMUD_INFO, "Reloading configuration on SIGHUP");
ret = qemudScanConfigs(server); ret = qemudScanConfigs(server);
break; break;
@ -132,6 +93,43 @@ static int qemudDispatchSignal(struct qemud_server *server)
case SIGQUIT: case SIGQUIT:
case SIGTERM: case SIGTERM:
qemudLog(QEMUD_WARN, "Shutting down on signal %d", sigc); qemudLog(QEMUD_WARN, "Shutting down on signal %d", sigc);
/* shutdown active VMs */
vm = server->activevms;
while (vm) {
struct qemud_vm *next = vm->next;
qemudShutdownVMDaemon(server, vm);
vm = next;
}
/* free inactive VMs */
vm = server->inactivevms;
while (vm) {
struct qemud_vm *next = vm->next;
qemudFreeVM(vm);
vm = next;
}
server->inactivevms = NULL;
server->ninactivevms = 0;
/* shutdown active networks */
network = server->activenetworks;
while (network) {
struct qemud_network *next = network->next;
qemudShutdownNetworkDaemon(server, network);
network = next;
}
/* free inactive networks */
network = server->inactivenetworks;
while (network) {
struct qemud_network *next = network->next;
qemudFreeNetwork(network);
network = next;
}
server->inactivenetworks = NULL;
server->ninactivenetworks = 0;
server->shutdown = 1; server->shutdown = 1;
break; break;