OvmfPkg[all]  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VirtioFs.h File Reference

Data Structures

struct  VIRTIO_FS_CONFIG
 
struct  VIRTIO_FS_FUSE_REQUEST
 
struct  VIRTIO_FS_FUSE_RESPONSE
 
struct  VIRTIO_FS_FUSE_NODE_RESPONSE
 
struct  VIRTIO_FS_FUSE_ATTRIBUTES_RESPONSE
 
struct  VIRTIO_FS_FUSE_FORGET_REQUEST
 
struct  VIRTIO_FS_FUSE_GETATTR_REQUEST
 
struct  VIRTIO_FS_FUSE_GETATTR_RESPONSE
 
struct  VIRTIO_FS_FUSE_SETATTR_REQUEST
 
struct  VIRTIO_FS_FUSE_MKDIR_REQUEST
 
struct  VIRTIO_FS_FUSE_OPEN_REQUEST
 
struct  VIRTIO_FS_FUSE_OPEN_RESPONSE
 
struct  VIRTIO_FS_FUSE_READ_REQUEST
 
struct  VIRTIO_FS_FUSE_WRITE_REQUEST
 
struct  VIRTIO_FS_FUSE_WRITE_RESPONSE
 
struct  VIRTIO_FS_FUSE_STATFS_RESPONSE
 
struct  VIRTIO_FS_FUSE_RELEASE_REQUEST
 
struct  VIRTIO_FS_FUSE_FSYNC_REQUEST
 
struct  VIRTIO_FS_FUSE_FLUSH_REQUEST
 
struct  VIRTIO_FS_FUSE_INIT_REQUEST
 
struct  VIRTIO_FS_FUSE_INIT_RESPONSE
 
struct  VIRTIO_FS_FUSE_CREATE_REQUEST
 
struct  VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE
 
struct  VIRTIO_FS_FUSE_RENAME2_REQUEST
 

Macros

#define VIRTIO_FS_REQUEST_QUEUE   1
 
#define VIRTIO_FS_TAG_BYTES   36
 
#define VIRTIO_FS_FUSE_MAJOR   7
 
#define VIRTIO_FS_FUSE_MINOR   31
 
#define VIRTIO_FS_FUSE_ROOT_DIR_NODE_ID   1
 
#define VIRTIO_FS_FUSE_ERRNO_ENOENT   (-2)
 
#define VIRTIO_FS_FUSE_MODE_TYPE_MASK   0170000u
 
#define VIRTIO_FS_FUSE_MODE_TYPE_REG   0100000u
 
#define VIRTIO_FS_FUSE_MODE_TYPE_DIR   0040000u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RWXU   0000700u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RUSR   0000400u
 
#define VIRTIO_FS_FUSE_MODE_PERM_WUSR   0000200u
 
#define VIRTIO_FS_FUSE_MODE_PERM_XUSR   0000100u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RWXG   0000070u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RGRP   0000040u
 
#define VIRTIO_FS_FUSE_MODE_PERM_WGRP   0000020u
 
#define VIRTIO_FS_FUSE_MODE_PERM_XGRP   0000010u
 
#define VIRTIO_FS_FUSE_MODE_PERM_RWXO   0000007u
 
#define VIRTIO_FS_FUSE_MODE_PERM_ROTH   0000004u
 
#define VIRTIO_FS_FUSE_MODE_PERM_WOTH   0000002u
 
#define VIRTIO_FS_FUSE_MODE_PERM_XOTH   0000001u
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MODE   BIT0
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_SIZE   BIT3
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_ATIME   BIT4
 
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MTIME   BIT5
 
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY   0
 
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR   2
 
#define VIRTIO_FS_FUSE_INIT_REQ_F_DO_READDIRPLUS   BIT13
 
#define VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE_SIZE(Namelen)
 
#define VIRTIO_FS_FUSE_RENAME2_REQ_F_NOREPLACE   BIT0
 

Enumerations

enum  VIRTIO_FS_FUSE_OPCODE {
  VirtioFsFuseOpLookup = 1, VirtioFsFuseOpForget = 2, VirtioFsFuseOpGetAttr = 3, VirtioFsFuseOpSetAttr = 4,
  VirtioFsFuseOpMkDir = 9, VirtioFsFuseOpUnlink = 10, VirtioFsFuseOpRmDir = 11, VirtioFsFuseOpOpen = 14,
  VirtioFsFuseOpRead = 15, VirtioFsFuseOpWrite = 16, VirtioFsFuseOpStatFs = 17, VirtioFsFuseOpRelease = 18,
  VirtioFsFuseOpFsync = 20, VirtioFsFuseOpFlush = 25, VirtioFsFuseOpInit = 26, VirtioFsFuseOpOpenDir = 27,
  VirtioFsFuseOpReleaseDir = 29, VirtioFsFuseOpFsyncDir = 30, VirtioFsFuseOpCreate = 35, VirtioFsFuseOpReadDirPlus = 44,
  VirtioFsFuseOpRename2 = 45
}
 

Detailed Description

Type and macro definitions specific to the Virtio Filesystem device.

At the time of this writing, the latest released Virtio specification (v1.1) does not include the virtio-fs device. The development version of the specification defines it however; see the latest version at https://github.com/oasis-tcs/virtio-spec/blob/87fa6b5d8155/virtio-fs.tex.

This header file is minimal, and only defines the types and macros that are necessary for the OvmfPkg implementation.

Copyright (C) 2020, Red Hat, Inc.

SPDX-License-Identifier: BSD-2-Clause-Patent

Macro Definition Documentation

#define VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE_SIZE (   Namelen)
Value:
((Namelen) == 0 || (Namelen) > SIZE_4KB ? \
(UINTN)0 : \
ALIGN_VALUE ( \
sizeof (VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE) + (UINTN)(Namelen), \
sizeof (UINT64) \
) \
)
Definition: VirtioFs.h:435

Macro for calculating the size of a directory stream entry.

The macro may evaluate Namelen multiple times.

The macro evaluates to a UINTN value that is safe to cast to UINT32.

Parameters
[in]NamelenThe size of the filename byte array that follows VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE in the directory stream, as reported by VIRTIO_FS_FUSE_STATFS_RESPONSE.Namelen or VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE.Namelen. The filename byte array is not NUL-terminated.
Return values
0Namelen was zero or greater than SIZE_4KB.
Returns
The number of bytes in the directory entry, including the VIRTIO_FS_FUSE_DIRENTPLUS_RESPONSE header.
#define VIRTIO_FS_FUSE_ERRNO_ENOENT   (-2)
#define VIRTIO_FS_FUSE_INIT_REQ_F_DO_READDIRPLUS   BIT13
#define VIRTIO_FS_FUSE_MAJOR   7
#define VIRTIO_FS_FUSE_MINOR   31
#define VIRTIO_FS_FUSE_MODE_PERM_RGRP   0000040u
#define VIRTIO_FS_FUSE_MODE_PERM_ROTH   0000004u
#define VIRTIO_FS_FUSE_MODE_PERM_RUSR   0000400u
#define VIRTIO_FS_FUSE_MODE_PERM_RWXG   0000070u
#define VIRTIO_FS_FUSE_MODE_PERM_RWXO   0000007u
#define VIRTIO_FS_FUSE_MODE_PERM_RWXU   0000700u
#define VIRTIO_FS_FUSE_MODE_PERM_WGRP   0000020u
#define VIRTIO_FS_FUSE_MODE_PERM_WOTH   0000002u
#define VIRTIO_FS_FUSE_MODE_PERM_WUSR   0000200u
#define VIRTIO_FS_FUSE_MODE_PERM_XGRP   0000010u
#define VIRTIO_FS_FUSE_MODE_PERM_XOTH   0000001u
#define VIRTIO_FS_FUSE_MODE_PERM_XUSR   0000100u
#define VIRTIO_FS_FUSE_MODE_TYPE_DIR   0040000u
#define VIRTIO_FS_FUSE_MODE_TYPE_MASK   0170000u
#define VIRTIO_FS_FUSE_MODE_TYPE_REG   0100000u
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDONLY   0
#define VIRTIO_FS_FUSE_OPEN_REQ_F_RDWR   2
#define VIRTIO_FS_FUSE_RENAME2_REQ_F_NOREPLACE   BIT0
#define VIRTIO_FS_FUSE_ROOT_DIR_NODE_ID   1
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_ATIME   BIT4
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MODE   BIT0
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_MTIME   BIT5
#define VIRTIO_FS_FUSE_SETATTR_REQ_F_SIZE   BIT3
#define VIRTIO_FS_REQUEST_QUEUE   1
#define VIRTIO_FS_TAG_BYTES   36

Enumeration Type Documentation

Enumerator
VirtioFsFuseOpLookup 
VirtioFsFuseOpForget 
VirtioFsFuseOpGetAttr 
VirtioFsFuseOpSetAttr 
VirtioFsFuseOpMkDir 
VirtioFsFuseOpUnlink 
VirtioFsFuseOpRmDir 
VirtioFsFuseOpOpen 
VirtioFsFuseOpRead 
VirtioFsFuseOpWrite 
VirtioFsFuseOpStatFs 
VirtioFsFuseOpRelease 
VirtioFsFuseOpFsync 
VirtioFsFuseOpFlush 
VirtioFsFuseOpInit 
VirtioFsFuseOpOpenDir 
VirtioFsFuseOpReleaseDir 
VirtioFsFuseOpFsyncDir 
VirtioFsFuseOpCreate 
VirtioFsFuseOpReadDirPlus 
VirtioFsFuseOpRename2