qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 8/9] linux-user: Add missing TARGET_EDQUOT error code


From: Leon Alrae
Subject: [Qemu-devel] [PULL 8/9] linux-user: Add missing TARGET_EDQUOT error code for Mips
Date: Fri, 23 Sep 2016 08:20:09 +0100

From: Aleksandar Markovic <address@hidden>

EDQUOT is defined for Mips platform in Linux kernel in such a way
that it has different value than on most other platforms. However,
correspondent TARGET_EDQUOT for Mips is missing in Qemu code. Moreover,
TARGET_EDQUOT is missing from the table for conversion of error codes
from host to target. This patch fixes these problems.

Without this patch, syscalls add_key(), keyctl(), link(), mkdir(), mknod(),
open(), rename(), request_key(), setxattr(), symlink(), and write() will not
be able to return the right error code in some scenarios on Mips platform.
(Some of these syscalls are not yet supported in Qemu, but once they are
supported, they will need correct EDQUOT handling.)

Signed-off-by: Aleksandar Markovic <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Acked-by: Riku Voipio <address@hidden>
Signed-off-by: Leon Alrae <address@hidden>
---
 linux-user/mips/target_syscall.h   | 2 ++
 linux-user/mips64/target_syscall.h | 2 ++
 linux-user/syscall.c               | 1 +
 3 files changed, 5 insertions(+)

diff --git a/linux-user/mips/target_syscall.h b/linux-user/mips/target_syscall.h
index 6c666dc..0b64b73 100644
--- a/linux-user/mips/target_syscall.h
+++ b/linux-user/mips/target_syscall.h
@@ -221,6 +221,8 @@ struct target_pt_regs {
 #undef TARGET_ENOTRECOVERABLE
 #define TARGET_ENOTRECOVERABLE 166     /* State not recoverable */
 
+#undef TARGET_EDQUOT
+#define TARGET_EDQUOT          1133    /* Quota exceeded */
 
 #define UNAME_MACHINE "mips"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/mips64/target_syscall.h 
b/linux-user/mips64/target_syscall.h
index a9c17f7..6692917 100644
--- a/linux-user/mips64/target_syscall.h
+++ b/linux-user/mips64/target_syscall.h
@@ -218,6 +218,8 @@ struct target_pt_regs {
 #undef TARGET_ENOTRECOVERABLE
 #define TARGET_ENOTRECOVERABLE 166     /* State not recoverable */
 
+#undef TARGET_EDQUOT
+#define TARGET_EDQUOT          1133    /* Quota exceeded */
 
 #define UNAME_MACHINE "mips64"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 116e463..0815f30 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -757,6 +757,7 @@ static uint16_t 
host_to_target_errno_table[ERRNO_TABLE_SIZE] = {
     [ENAVAIL]          = TARGET_ENAVAIL,
     [EISNAM]           = TARGET_EISNAM,
     [EREMOTEIO]                = TARGET_EREMOTEIO,
+    [EDQUOT]            = TARGET_EDQUOT,
     [ESHUTDOWN]                = TARGET_ESHUTDOWN,
     [ETOOMANYREFS]     = TARGET_ETOOMANYREFS,
     [ETIMEDOUT]                = TARGET_ETIMEDOUT,
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]