[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/10] linux-user: implement reboot syscall
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH 05/10] linux-user: implement reboot syscall |
Date: |
Thu, 27 Oct 2011 15:02:51 +0300 |
From: Alexander Graf <address@hidden>
For OBS, we're running a full cross-guest inside of a VM. When a build
is done there, we reboot the guest as shutdown mechanism.
Unfortunately, reboot is not implemented in linux-user. So this mechanism
fails, spilling unpretty warnings. This patch implements sys_reboot()
emulation.
Signed-off-by: Alexander Graf <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6159571..9f5da36 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -248,6 +248,8 @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned
int, len,
#define __NR_sys_sched_setaffinity __NR_sched_setaffinity
_syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
unsigned long *, user_mask_ptr);
+_syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd,
+ void *, arg);
static bitmask_transtbl fcntl_flags_tbl[] = {
{ TARGET_O_ACCMODE, TARGET_O_WRONLY, O_ACCMODE, O_WRONLY, },
@@ -5872,7 +5874,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
break;
#endif
case TARGET_NR_reboot:
- goto unimplemented;
+ if (!(p = lock_user_string(arg4)))
+ goto efault;
+ ret = reboot(arg1, arg2, arg3, p);
+ unlock_user(p, arg4, 0);
+ break;
#ifdef TARGET_NR_readdir
case TARGET_NR_readdir:
goto unimplemented;
--
1.7.5.4
- [Qemu-devel] [PATCH 00/10] Linux-user patches for 1.0, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 10/10] ppc64-linux-user: Fix syscall return type., riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 07/10] sparc-linux-user: Fixup sending SIGSEGV, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 04/10] linux-user: fix openat, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 02/10] linux-user: fix rlimit syscalls on sparc(64), riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 08/10] sparc-linux-user: Add some missing syscall numbers, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 09/10] ppc64-linux-user: Properly interpret the entry function descriptor., riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 05/10] linux-user: implement reboot syscall,
riku . voipio <=
- [Qemu-devel] [PATCH 01/10] linux-user: fix TARGET_RLIM_INFINITY declaration, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 03/10] linux-user: fix abi_(u)long, target_ulong mismatch, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 06/10] sparc-linux-user: Handle SIGILL., riku . voipio, 2011/10/27