Move rumpuser_sp_fini() after the kernel has completed shuwdown
(and especially, after filesystems have been unmounted). This way, rump.halt returns once the rump kernel is really out of the game, which avoids races issues in test scripts using a rump kernel. OK pooka@
This commit is contained in:
parent
597cd7831b
commit
21b1dbeb44
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: rump.c,v 1.226 2011/01/28 19:21:29 pooka Exp $ */
|
/* $NetBSD: rump.c,v 1.227 2011/01/30 16:31:42 bouyer Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.226 2011/01/28 19:21:29 pooka Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.227 2011/01/30 16:31:42 bouyer Exp $");
|
||||||
|
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
#define ELFSIZE ARCH_ELFSIZE
|
#define ELFSIZE ARCH_ELFSIZE
|
||||||
|
@ -536,7 +536,6 @@ cpu_reboot(int howto, char *bootstr)
|
||||||
finiarg = curproc->p_vmspace->vm_map.pmap;
|
finiarg = curproc->p_vmspace->vm_map.pmap;
|
||||||
else
|
else
|
||||||
finiarg = NULL;
|
finiarg = NULL;
|
||||||
rumpuser_sp_fini(finiarg);
|
|
||||||
|
|
||||||
/* dump means we really take the dive here */
|
/* dump means we really take the dive here */
|
||||||
if ((howto & RB_DUMP) || panicstr) {
|
if ((howto & RB_DUMP) || panicstr) {
|
||||||
|
@ -552,6 +551,7 @@ cpu_reboot(int howto, char *bootstr)
|
||||||
/* your wish is my command */
|
/* your wish is my command */
|
||||||
if (howto & RB_HALT) {
|
if (howto & RB_HALT) {
|
||||||
printf("rump kernel halted\n");
|
printf("rump kernel halted\n");
|
||||||
|
rumpuser_sp_fini(finiarg);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
uint64_t sec = 5, nsec = 0;
|
uint64_t sec = 5, nsec = 0;
|
||||||
int error;
|
int error;
|
||||||
|
@ -563,6 +563,7 @@ cpu_reboot(int howto, char *bootstr)
|
||||||
/* this function is __dead, we must exit */
|
/* this function is __dead, we must exit */
|
||||||
out:
|
out:
|
||||||
printf("halted\n");
|
printf("halted\n");
|
||||||
|
rumpuser_sp_fini(finiarg);
|
||||||
rumpuser_exit(ruhow);
|
rumpuser_exit(ruhow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue