Statistics
| Branch: | Revision:

root / hw / virtio-9p.c @ 89c473fd

History | View | Annotate | Download (94 kB)

# Date Author Comment
49594973 12/03/2010 02:06 am Venkateswararao Jujjuri (JV)

[virtio-9p] Add datasync to server side TFSYNC/RFSYNC for dotl

SYNOPSIS
size4 Tfsync tag2 fid4 datasync4

size[4] Rfsync tag[2]

DESCRIPTION

The Tfsync transaction transfers ("flushes") all modified in-core data of
file identified by fid to the disk device (or other permanent storage...
56d15a53 10/20/2010 08:10 pm Sanchit Garg

[virtio-9p] Use preadv/pwritev instead of readv/writev

readv & writev, read & write respectively from the current offset
of the file & hence their use has to be preceeded by a call to lseek.
preadv/writev can be used instead, as they take the offset as an argument....

45b23ff8 10/20/2010 08:10 pm Venkateswararao Jujjuri (JV)

[virtio-9p] Add support to v9fs_string_alloc_printf() for handling %lu.

Signed-off-by: Venkateswararao Jujjuri <>

ab03b63d 10/20/2010 08:10 pm Sripathi Kodi

[virtio-9p] open should not return EBADF

When 9P server fails to create a file due to permission problems it should
return EPERM. However the current 9P2000.L code returns EBADF. EBADF is NOT
a valid return value from open() call.

The problem is because we do not preserve the errno variable properly. If the...

82cc3ee8 10/20/2010 08:10 pm M. Mohan Kumar

[virto-9p] Implement TLOCK

Synopsis

size[4] TLock tag[2] fid[4] flock[n]
size[4] RLock tag[2] status[1]

Description

Tlock is used to acquire/release byte range posix locks on a file
identified by given fid. The reply contains status of the lock request...

8f354003 10/20/2010 08:10 pm M. Mohan Kumar

qemu-virtio9p: Implement TGETLOCK

Synopsis

size[4] TGetlock tag[2] fid[4] getlock[n]
size[4] RGetlock tag[2] getlock[n]

Description

TGetlock is used to test for the existence of byte range posix locks on
a file identified by given fid. The reply contains getlock structure. If...

b41e95d3 10/20/2010 08:10 pm Venkateswararao Jujjuri (JV)

[virtio-9p] Introduce server side TFSYNC/RFSYNC for dotl

SYNOPSIS
size4 Tfsync tag2 fid4

size[4] Rfsync tag[2]

DESCRIPTION

The Tfsync transaction transfers ("flushes") all modified in-core data of
file identified by fid to the disk device (or other permanent storage...

df0973a4 10/20/2010 08:10 pm M. Mohan Kumar

qemu-virtio-9p: Implement TREADLINK operation for 9p2000.L

Synopsis

size[4] TReadlink tag[2] fid[4]
size[4] RReadlink tag[2] target[s]

Description
Readlink is used to return the contents of the symoblic link
referred by fid. Contents of symboic link is returned as a...

0f8151cb 10/20/2010 08:10 pm Venkateswararao Jujjuri (JV)

[virtio-9p] Ignore O_DIRECT hint from client.

The O_DIRECT flag imposes alignment restrictions on the length and address
of userspace buffers and the file offset of I/Os.

While VirtFS/9P has plans to implement O_DIRECT behavior on the server,
for now we will stick to a behavior like NFS by bypassing the page cache...

fc22118d 10/20/2010 08:10 pm Aneesh Kumar K.V

virtio-9p: Use layered xattr approach

We would need this to make sure we handle the mapped
security model correctly for different xattr names.

Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Venkateswararao Jujjuri <>

9f506893 10/20/2010 08:10 pm Harsh Prateek Bora

[virtio-9p] Qemu 9p commandline options validity checks

Signed-off-by: Harsh Prateek Bora <>
Signed-off-by: Venkateswararao Jujjuri <>

c9ba47dc 10/03/2010 09:39 am Stefan Weil

virtio-9p: Use GCC_FMT_ATTR and fix a format warning

With the new gcc format warnings, gcc detected this:

/qemu/hw/virtio-9p.c:1040: error: format ‘%u’ expects type ‘unsigned int’, but argument 4 has type ‘__nlink_t’

Cc: Blue Swirl <>...

cf03eb2c 09/08/2010 08:28 pm Arun R Bharadwaj

[virtio-9p] Remove all instances of unnecessary dotu variable.

Signed-off-by: Arun R Bharadwaj <>
Signed-off-by: Venkateswararao Jujjuri <>

8f4d1ca5 09/08/2010 08:28 pm Arun R Bharadwaj

[virtio-9p] This patch implements TLERROR/RLERROR on the qemu 9P server.

Signed-off-by: Arun R Bharadwaj <>
Signed-off-by: Venkateswararao Jujjuri <>

630c2689 09/08/2010 08:28 pm Sripathi Kodi

virtio-9p: Change handling of flags in open() path for 9P2000.L

This patch applies on top of 9P2000.L patches that we have on the list.
I took a look at how 9P server is handling open() flags in 9P2000.L path.
I think we can do away with the valid_flags() function and simplify the...

12848bfc 09/08/2010 08:26 pm Aneesh Kumar K.V

virtio-9p: Add SM_NONE security model

This is equivalent to SM_PASSTHROUGH security model.
The only exception is, failure of privilige operation like chown
are ignored. This makes a passthrough like security model usable
for people who runs kvm as non root...

783f04e1 09/08/2010 08:26 pm Aneesh Kumar K.V

virtio-9p: Fix the memset usage

The arguments are wrong. Use qemu_mallocz directly

Signed-off-by: Aneesh Kumar K.V <>

9ed3ef26 09/08/2010 08:26 pm Aneesh Kumar K.V

virtio-9p: Add support for removing xattr

Signed-off-by: Aneesh Kumar K.V <>

c7b4b0b3 09/08/2010 08:26 pm M. Mohan Kumar

rename - change name of file or directory

size4 Trename tag2 fid4 newdirfid4 name[s]
size4 Rrename tag2

Implement the 2000.L rename operation. A new function
v9fs_complete_rename is introduced that acts as a common entry point
for 2000.L rename operation and 2000.U rename opearation (via wstat)....

771e9d4c 09/08/2010 08:26 pm M. Mohan Kumar

[virtio-9p] qemu: virtio-9p: Implement LOPEN

Implement 9p2000.L version of open(LOPEN) interface in qemu 9p server.

For LOPEN, no need to convert the flags to and from 9p mode to VFS mode.

Synopsis:

size[4] Tlopen tag[2] fid[4] mode[4]
size[4] Rlopen tag[2] qid[13] iounit[4]...
d62dbb51 09/08/2010 08:26 pm Aneesh Kumar K.V

virtio-9p: Add fidtype so that we can do type specific operation

We want to add type specific operation during read/write

Signed-off-by: Aneesh Kumar K.V <>

fa32ef88 09/08/2010 08:26 pm Aneesh Kumar K.V

virtio-9p: Implement TXATTRWALK

TXATTRWALK: Descend a ATTR namespace

size[4] TXATTRWALK tag[2] fid[4] newfid[4] name[s]
size[4] RXATTRWALK tag[2] size[8]

txattrwalk gets a fid pointing to xattr. This fid can later be
used to get read the xattr value. If name is NULL the fid returned...

10b468bd 09/08/2010 08:26 pm Aneesh Kumar K.V

virtio-9p: Implement TXATTRCREATE

TXATTRCREATE: Prepare a fid for setting xattr value on a file system object.

size[4] TXATTRCREATE tag[2] fid[4] name[s] attr_size[8] flags[4]
size[4] RXATTRWALK tag[2]

txattrcreate gets a fid pointing to xattr. This fid can later be...

8fc39ae4 09/08/2010 08:26 pm Sripathi Kodi

[virtio-9p] Make v9fs_do_utimensat accept timespec structures instead of v9stat.

Currently v9fs_do_utimensat takes a V9fsStat argument and builds
timespec structures. It sets tv_nsec values to 0 by default. Instead
of this it should take struct timespec2 and pass it down to the...

c79ce737 09/08/2010 08:26 pm Sripathi Kodi

virtio-9p: Implement server side of setattr for 9P2000.L protocol.

SYNOPSIS

size[4] Tsetattr tag[2] attr[n]
size[4] Rsetattr tag[2]
DESCRIPTION
The setattr command changes some of the file status information.
attr resembles the iattr structure used in Linux kernel. It...
b2c224be 09/08/2010 08:26 pm Venkateswararao Jujjuri (JV)

[virtio-9p] Implement TLINK for 9P2000.L

Create a Hardlink.

SYNOPSIS

size4 Tlink tag2 dfid4 oldfid4 newpath[s]

size4 Rlink tag2

DESCRIPTION

Create a link 'newpath' in directory pointed by dfid linking to oldfid path.

Signed-off-by: Venkateswararao Jujjuri <>

08c60fc9 09/08/2010 08:26 pm Venkateswararao Jujjuri (JV)

[virtio-9p] Define and implement TSYMLINK for 9P2000.L

This patch implements creating a symlink for TSYMLINK request
and responds with RSYMLINK. In the case of error, we return RERROR.

SYNOPSIS

size[4] Tsymlink tag[2] fid[4] name[s] symtgt[s] gid[4]...
c1568af5 09/08/2010 08:26 pm Venkateswararao Jujjuri (JV)

[virtio-9p] This patch implements TLCREATE for 9p2000.L protocol.

SYNOPSIS

size[4] Tlcreate tag[2] fid[4] name[s] flags[4] mode[4] gid[4]
size[4] Rlcreate tag[2] qid[13] iounit[4]

DESCRIPTION

The Tlreate request asks the file server to create a new regular file with the...

5268cecc 09/08/2010 08:26 pm M. Mohan Kumar

qemu: virtio-9p: Implement TMKNOD

Implement TMKNOD as part of 2000.L Work

Synopsis

size[4] Tmknod tag[2] fid[4] name[s] mode[4] major[4] minor[4] gid[4]
size[4] Rmknod tag[2] qid[13]

Description

mknod asks the file server to create a device node with given device...
b67592ea 09/08/2010 08:26 pm M. Mohan Kumar

qemu: virtio-9p: Implement TMKDIR

Synopsis

size[4] Tmkdir tag[2] fid[4] name[s] mode[4] gid[4]
size[4] Rmkdir tag[2] qid[13]

Description

mkdir asks the file server to create a directory with given name,
mode and gid. The qid for the new directory is returned with...
be940c87 09/08/2010 08:26 pm M. Mohan Kumar

qemu: virtio-9p: Implement statfs support in server

Implement statfs support in qemu server based on Sripathi's
initial statfs patch.

Signed-off-by: M. Mohan Kumar <>
Signed-off-by: Sripathi Kodi <>
Signed-off-by: Venkateswararao Jujjuri <>

926487b7 09/08/2010 08:26 pm Sripathi Kodi

virtio-9p: Return correct error from v9fs_remove

Signed-off-by: Sripathi Kodi <>

In v9fs_remove_post_remove() we currently ignore the error returned by
the previous call to remove() and return an error only if freeing the
fid fails. However, the client expects to see the error from remove()....

c18e2f94 09/08/2010 08:26 pm Sripathi Kodi

[V4] virtio-9p: readdir implementation for 9p2000.L

This patch implements the server part of readdir() implementation for
9p2000.L

SYNOPSIS
size[4] Treaddir tag[2] fid[4] offset[8] count[4]
size[4] Rreaddir tag[2] count[4] data[count]
DESCRIPTION...
5e94c103 09/08/2010 08:26 pm M. Mohan Kumar

virtio-9p: Compute iounit based on host filesystem block size

Compute iounit based on the host filesystem block size and pass it to
client with open/create response. Also return iounit as statfs's f_bsize
for optimal block size transfers.

Signed-off-by: M. Mohan Kumar <>...

00ede4c2 09/08/2010 08:26 pm Sripathi Kodi

virtio-9p: getattr server implementation for 9P2000.L protocol.

SYNOPSIS
size[4] Tgetattr tag[2] fid[4] request_mask[8]
size[4] Rgetattr tag[2] lstat[n]
DESCRIPTION
The getattr transaction inquires about the file identified by fid....
74bc02b2 09/08/2010 08:26 pm M. Mohan Kumar

virtio-9p: Do not reset atime

Current code resets file's atime to 0 when there is a change in mtime.
This results in resetting the atime to "1970-01-01 05:30:00". For
example, truncate -s 0 filename results in changing the mtime to the
truncate time, but resets the atime to "1970-01-01 05:30:00". utime...
84151514 09/08/2010 08:26 pm M. Mohan Kumar

qemu: virtio-9p: Recognize 9P2000.L protocol

Make 9P server recognize 9P2000.L protocol version

Signed-off-by: M. Mohan Kumar <>
Signed-off-by: Venkateswararao Jujjuri <>

cc597832 08/21/2010 12:04 am Blue Swirl

Replace qemu_malloc + memset with qemu_mallocz

Replace a qemu_malloc call, followed by a memset, with qemu_mallocz.

Found with this Coccinelle semantic patch, adapted from
Coccinelle test package rule 94:
@
type T;
expression x;
expression E;
@

- x = (T)qemu_malloc(E)...

00ec5c37 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Security model for mkdir

Signed-off-by: Venkateswararao Jujjuri <>
Signed-off-by: Anthony Liguori <>

879c2813 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Security model for symlink and readlink

Mapped mode stores extended attributes in the user space of the extended
attributes. Given that the user space extended attributes are available
to regular files only, special files are created as regular files on the...

1c293312 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Implement Security model for mknod

Mapped mode stores extended attributes in the user space of the extended
attributes. Given that the user space extended attributes are available
to regular files only, special files are created as regular files on the...

63729c36 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Implement Security model for mksock using mknod.

This patch uses mknod to create socket.

On Host/Fileserver:
rw------. 1 virfsuid virtfsgid 0 2010-05-11 09:57 asocket1

On Guest/Client:
srwxr-xr-x 1 guestuser guestuser 0 2010-05-11 12:57 asocket1...

758e8e38 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Make infrastructure for the new security model.

This patch adds required infrastructure for the new security model.

- A new configure option for attr/xattr.
- if CONFIG_VIRTFS will be defined if both CONFIG_LINUX and CONFIG_ATTR defined.
- Defines routines related to both security models....

e95ead32 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Security model for chmod

Signed-off-by: Venkateswararao Jujjuri <>
Signed-off-by: Anthony Liguori <>

f7613bee 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Security model for chown

mapped model changes the owner in the extended attributes.
passthrough model does the change through lchown() as the
server don't need to follow the link and client will send the
actual filesystem object.

Signed-off-by: Venkateswararao Jujjuri <>...

4750a96f 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Security model for create/open2

In the mapped security model, VirtFS server intercepts and maps
the file object create and get/set attribute requests. Files on the fileserver
will be created with VirtFS servers (QEMU) user credentials and the
client-users credentials are stored in extended attributes. On the request...

fac4f111 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Rearrange fileop structures

This patch rearranges the fileop structures by moving the structure definitions
from virtio-9p.c to virtio-9p.h file. No functional changes.

Signed-off-by: Venkateswararao Jujjuri <>
Signed-off-by: Anthony Liguori <>

9ce56db6 06/22/2010 11:15 pm Venkateswararao Jujjuri (JV)

virtio-9p: Introduces an option to specify the security model.

The new option is:

-fsdev fstype,id=myid,path=/share_path/,security_model=[mapped|passthrough]
-virtfs fstype,path=/share_path/,security_model=[mapped|passthrough],mnt_tag=tag

In the case of mapped security model, files are created with QEMU user...

a6568fe2 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TOPEN support.

Implement P9_TOPEN support.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

a9231555 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TREAD support

Implement P9_TREAD support.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

bbd5697b 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TCLUNK support

Implement P9_TCLUNK support.
This patch gets `ls -al` to work.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

8449360c 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TWRITE support

Implement P9_TWRITE support.
This gets write to file to work

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

c494dd6f 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TCREATE support

Implement P9_TCREATE support.
[: strdup to qemu_strdup conversion]

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

8cf89e00 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TWSTAT support

Implement P9_TWSTAT support.
This gets file and directory creation to work.

[: strdup to qemu_strdup conversion]
[: v9fs_fix_path]

Signed-off-by: Anthony Liguori <>...

5bae1900 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TREMOVE support.

Implement P9_TREMOVE support.
This gets file deletion to work.

[: Fix truncate to use the relative path]

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>...

9c5e9d89 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TFLUSH support

Don't do anything special for flush.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

a03f7874 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add string manipulation support.

Add helpers to do string manipulation.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

131dcb25 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add minimal set of FileOperations

Add minimal set of FileOperations and the corresponding implementations for
local fstype. These will be required for the FID management patches later on.

[: rpath fix ]
Signed-off-by: Anthony Liguori <>...

286d5652 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add fid and qid management support.

Helper APIs for FID and QID management.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

bb9e3216 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add stat and mode related helper functions.

Add helpers to obtain file stat and mode details.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

1f5a89bf 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add sg helper functions

Add scatter-gather helper functions.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

92c1ad03 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TVERSION support

Implement P9_TVERSION support.

[: Handle unknown 9P versions as per the standards]

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>...

955efc47 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TATTACH support.

Implement P9_TATTACH support.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

4da7d3fa 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TSTAT support

Implement P9_TSTAT support. This get the mount to work on the guest.

[: malloc to qemu_malloc conversion]

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>...

ff5e54c9 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add P9_TWALK support

Implement P9_TWALK support.

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>

9f107513 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: Add a virtio 9p device to qemu

This patch doesn't implement the 9p protocol handling
code. It adds a simple device which dump the protocol data.

[: Little-Endian to host format conversion]
[: Multiple-mounts support]...

405a549a 05/03/2010 08:17 pm Anthony Liguori

virtio-9p: pdu processing support.

Add helpers to process the PDUs.

[: malloc to qemu_malloc coversion]

Signed-off-by: Anthony Liguori <>
Signed-off-by: Aneesh Kumar K.V <>
Signed-off-by: Anthony Liguori <>