From 494a8ebe713055d3946183f4b395f85a18b43e9e Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 18 Nov 2015 18:21:14 +0000 Subject: 9pfs: rename virtio-9p-proxy.{c,h} to 9p-proxy.{c,h} Those two files are not virtio specific. Rename them to use generic names. Fix includes in various C files. Change define guards and comments in header files. Signed-off-by: Wei Liu Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/9p-proxy.h | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 hw/9pfs/9p-proxy.h (limited to 'hw/9pfs/9p-proxy.h') diff --git a/hw/9pfs/9p-proxy.h b/hw/9pfs/9p-proxy.h new file mode 100644 index 0000000000..56150b948b --- /dev/null +++ b/hw/9pfs/9p-proxy.h @@ -0,0 +1,95 @@ +/* + * 9p Proxy callback + * + * Copyright IBM, Corp. 2011 + * + * Authors: + * M. Mohan Kumar + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + */ +#ifndef _QEMU_9P_PROXY_H +#define _QEMU_9P_PROXY_H + +#define PROXY_MAX_IO_SZ (64 * 1024) +#define V9FS_FD_VALID INT_MAX + +/* + * proxy iovec only support one element and + * marsha/unmarshal doesn't do little endian conversion. + */ +#define proxy_unmarshal(in_sg, offset, fmt, args...) \ + v9fs_unmarshal(in_sg, 1, offset, 0, fmt, ##args) +#define proxy_marshal(out_sg, offset, fmt, args...) \ + v9fs_marshal(out_sg, 1, offset, 0, fmt, ##args) + +union MsgControl { + struct cmsghdr cmsg; + char control[CMSG_SPACE(sizeof(int))]; +}; + +typedef struct { + uint32_t type; + uint32_t size; +} ProxyHeader; + +#define PROXY_HDR_SZ (sizeof(ProxyHeader)) + +enum { + T_SUCCESS = 0, + T_ERROR, + T_OPEN, + T_CREATE, + T_MKNOD, + T_MKDIR, + T_SYMLINK, + T_LINK, + T_LSTAT, + T_READLINK, + T_STATFS, + T_CHMOD, + T_CHOWN, + T_TRUNCATE, + T_UTIME, + T_RENAME, + T_REMOVE, + T_LGETXATTR, + T_LLISTXATTR, + T_LSETXATTR, + T_LREMOVEXATTR, + T_GETVERSION, +}; + +typedef struct { + uint64_t st_dev; + uint64_t st_ino; + uint64_t st_nlink; + uint32_t st_mode; + uint32_t st_uid; + uint32_t st_gid; + uint64_t st_rdev; + uint64_t st_size; + uint64_t st_blksize; + uint64_t st_blocks; + uint64_t st_atim_sec; + uint64_t st_atim_nsec; + uint64_t st_mtim_sec; + uint64_t st_mtim_nsec; + uint64_t st_ctim_sec; + uint64_t st_ctim_nsec; +} ProxyStat; + +typedef struct { + uint64_t f_type; + uint64_t f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + uint64_t f_fsid[2]; + uint64_t f_namelen; + uint64_t f_frsize; +} ProxyStatFS; +#endif -- cgit v1.2.3 From 2209bd050a9287120b74f8616837293d739c5fb3 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Mon, 30 Nov 2015 16:14:29 +0000 Subject: fsdev: rename virtio-9p-marshal.{c,h} to 9p-iov-marshal.{c,h} And rename v9fs_marshal to v9fs_iov_marshal, v9fs_unmarshal to v9fs_iov_unmarshal. The rationale behind this change is that, this marshalling interface is used both by virtio and proxy helper. Renaming files and functions to reflect the true nature of this interface. Xen transport is going to have its own marshalling interface. Signed-off-by: Wei Liu Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/9p-proxy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/9pfs/9p-proxy.h') diff --git a/hw/9pfs/9p-proxy.h b/hw/9pfs/9p-proxy.h index 56150b948b..ba9ca203de 100644 --- a/hw/9pfs/9p-proxy.h +++ b/hw/9pfs/9p-proxy.h @@ -20,9 +20,9 @@ * marsha/unmarshal doesn't do little endian conversion. */ #define proxy_unmarshal(in_sg, offset, fmt, args...) \ - v9fs_unmarshal(in_sg, 1, offset, 0, fmt, ##args) + v9fs_iov_unmarshal(in_sg, 1, offset, 0, fmt, ##args) #define proxy_marshal(out_sg, offset, fmt, args...) \ - v9fs_marshal(out_sg, 1, offset, 0, fmt, ##args) + v9fs_iov_marshal(out_sg, 1, offset, 0, fmt, ##args) union MsgControl { struct cmsghdr cmsg; -- cgit v1.2.3