From 42a8f2ccac461c5fea0761d3cc772145c2a72e8a Mon Sep 17 00:00:00 2001 From: Kohei Tokunaga Date: Thu, 7 Mar 2024 17:36:18 +0900 Subject: [PATCH] mapdir: use EOPNOTSUPP for xattr Signed-off-by: Kohei Tokunaga --- patches/bochs/Bochs/bochs/wasm.cc | 3 ++- patches/bochs/Bochs/bochs/wasm.h | 21 +++++++++++---------- patches/tinyemu/tinyemu/fs.h | 21 +++++++++++---------- patches/tinyemu/tinyemu/fs_disk.c | 1 + patches/tinyemu/tinyemu/virtio.c | 2 +- 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/patches/bochs/Bochs/bochs/wasm.cc b/patches/bochs/Bochs/bochs/wasm.cc index 1f82bba..602f4b9 100644 --- a/patches/bochs/Bochs/bochs/wasm.cc +++ b/patches/bochs/Bochs/bochs/wasm.cc @@ -531,6 +531,7 @@ static int errno_table[][2] = { { P9_ENOSPC, ENOSPC }, { P9_ENOTEMPTY, ENOTEMPTY }, { P9_EPROTO, EPROTO }, + { P9_EOPNOTSUPP, EOPNOTSUPP }, { P9_ENOTSUP, ENOTSUP }, }; @@ -2413,7 +2414,7 @@ int bx_virtio_9p_ctrl_c::device_recv(int queue_idx, int desc_idx, int read_size, case 30: /* xattrwalk */ { /* not supported yet */ - err = -P9_ENOTSUP; + err = -P9_EOPNOTSUPP; goto error; } break; diff --git a/patches/bochs/Bochs/bochs/wasm.h b/patches/bochs/Bochs/bochs/wasm.h index 35a572f..1952f42 100644 --- a/patches/bochs/Bochs/bochs/wasm.h +++ b/patches/bochs/Bochs/bochs/wasm.h @@ -450,16 +450,17 @@ class bx_virtio_ctrl_c : public bx_pci_device_c { #define P9_SETATTR_ATIME_SET 0x00000080 #define P9_SETATTR_MTIME_SET 0x00000100 -#define P9_EPERM 1 -#define P9_ENOENT 2 -#define P9_EIO 5 -#define P9_EEXIST 17 -#define P9_ENOTDIR 20 -#define P9_EINVAL 22 -#define P9_ENOSPC 28 -#define P9_ENOTEMPTY 39 -#define P9_EPROTO 71 -#define P9_ENOTSUP 524 +#define P9_EPERM 1 +#define P9_ENOENT 2 +#define P9_EIO 5 +#define P9_EEXIST 17 +#define P9_ENOTDIR 20 +#define P9_EINVAL 22 +#define P9_ENOSPC 28 +#define P9_ENOTEMPTY 39 +#define P9_EPROTO 71 +#define P9_EOPNOTSUPP 95 +#define P9_ENOTSUP 524 typedef struct VIRTIO9PDevice { FSDevice *fs; diff --git a/patches/tinyemu/tinyemu/fs.h b/patches/tinyemu/tinyemu/fs.h index 3228736..41ff352 100644 --- a/patches/tinyemu/tinyemu/fs.h +++ b/patches/tinyemu/tinyemu/fs.h @@ -80,16 +80,17 @@ #define P9_SETATTR_ATIME_SET 0x00000080 #define P9_SETATTR_MTIME_SET 0x00000100 -#define P9_EPERM 1 -#define P9_ENOENT 2 -#define P9_EIO 5 -#define P9_EEXIST 17 -#define P9_ENOTDIR 20 -#define P9_EINVAL 22 -#define P9_ENOSPC 28 -#define P9_ENOTEMPTY 39 -#define P9_EPROTO 71 -#define P9_ENOTSUP 524 +#define P9_EPERM 1 +#define P9_ENOENT 2 +#define P9_EIO 5 +#define P9_EEXIST 17 +#define P9_ENOTDIR 20 +#define P9_EINVAL 22 +#define P9_ENOSPC 28 +#define P9_ENOTEMPTY 39 +#define P9_EPROTO 71 +#define P9_EOPNOTSUPP 95 +#define P9_ENOTSUP 524 typedef struct FSDevice FSDevice; typedef struct FSFile FSFile; diff --git a/patches/tinyemu/tinyemu/fs_disk.c b/patches/tinyemu/tinyemu/fs_disk.c index da87036..e2d9dc8 100644 --- a/patches/tinyemu/tinyemu/fs_disk.c +++ b/patches/tinyemu/tinyemu/fs_disk.c @@ -90,6 +90,7 @@ static int errno_table[][2] = { { P9_ENOSPC, ENOSPC }, { P9_ENOTEMPTY, ENOTEMPTY }, { P9_EPROTO, EPROTO }, + { P9_EOPNOTSUPP, EOPNOTSUPP }, { P9_ENOTSUP, ENOTSUP }, }; diff --git a/patches/tinyemu/tinyemu/virtio.c b/patches/tinyemu/tinyemu/virtio.c index 8d07f44..b6b5aab 100644 --- a/patches/tinyemu/tinyemu/virtio.c +++ b/patches/tinyemu/tinyemu/virtio.c @@ -2276,7 +2276,7 @@ static int virtio_9p_recv_request(VIRTIODevice *s1, int queue_idx, case 30: /* xattrwalk */ { /* not supported yet */ - err = -P9_ENOTSUP; + err = -P9_EOPNOTSUPP; goto error; } break;