aboutsummaryrefslogtreecommitdiffstats
path: root/hw/9pfs
AgeCommit message (Collapse)AuthorFilesLines
2012-01-27pci: convert to QEMU Object ModelAnthony Liguori1-17/+26
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: prepare source tree for code conversionAnthony Liguori1-2/+1
These are various small stylistic changes which help make things more consistent such that the automated conversion script can be simpler. It's not necessary to agree or disagree with these style changes because all of this code is going to be rewritten by the patch monkey script anyway. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-06virtio-9p-proxy: Fix typo causing compile failure on 32 bit hostsPeter Maydell1-2/+2
Fix a compile failure on 32 bit hosts (integer constant is too large for 'unsigned long' type) by correcting a typo where the mask used for filling in the second f_fsid word had too many 'F's in it. Also drop the 'L' suffix that allowed this typo to go undetected on 64 bit hosts. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-04hw/9pfs: Add support to use named socket for proxy FSM. Mohan Kumar1-7/+45
Add option to use named socket for communicating between proxy helper and qemu proxy FS. Access to socket can be given by using command line options -u and -g. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Proxy getversionM. Mohan Kumar2-0/+33
Add proxy getversion to get generation number Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: xattr interfaces in proxy filesystem driverM. Mohan Kumar2-8/+120
Add xattr support for proxy FS Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: File ownership and othersM. Mohan Kumar2-12/+130
Add file ownership interfaces like chmod/chown, utime update, rename, remove and truncating files for proxy FS Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Add stat/readlink/statfs for proxy FSM. Mohan Kumar2-8/+232
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Create other filesystem objectsM. Mohan Kumar2-17/+190
Add interfaces to create filesystem objects like directory, device nodes, symbolic links, links for proxy filesytem driver Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Open and create filesM. Mohan Kumar2-6/+192
Add interfaces to open and create files for proxy file system driver. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: File system helper process for qemu 9p proxy FSM. Mohan Kumar1-0/+9
Provide root privilege access to QEMU 9p proxy filesystem using socket communication. Proxy helper is started by root user as: ~ # virtfs-proxy-helper -f|--fd <socket descriptor> -p|--path <path-to-share> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Add new proxy filesystem driverM. Mohan Kumar2-0/+412
Add new proxy filesystem driver to add root privilege to qemu process. It needs a helper process to be started by root user. Following command line can be used to utilize proxy filesystem driver -virtfs proxy,id=<id>,mount_tag=<tag>,socket_fd=<socket-fd> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Add validation to {un}marshal codeM. Mohan Kumar1-123/+338
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Move pdu_marshal/unmarshal code to a seperate fileM. Mohan Kumar2-322/+12
Move p9 marshaling/unmarshaling code to a separate file so that proxy filesytem driver can use these calls. Also made marshaling code generic to accept "struct iovec" instead of V9fsPDU. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Move opt validation to FsDriver callbackAneesh Kumar K.V3-5/+62
This remove all conditional code from common code path and make opt validation a FSDriver callback. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-21hw/9pfs: iattr_valid flags are kernel internal flags map them to 9p values.Aneesh Kumar K.V1-23/+24
Kernel internal values can change, add protocol values for these constant and use them. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-21hw/9pfs: Use the correct signed type for different variablesAneesh Kumar K.V2-11/+12
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-21hw/9pfs: replace iovec manipulation with QEMUIOVectorStefan Hajnoczi1-102/+60
The v9fs_read() and v9fs_write() functions rely on iovec[] manipulation code should be replaced with QEMUIOVector to avoid duplicating code. In the future it may be possible to make the code even more concise by using QEMUIOVector consistently across virtio and 9pfs. The "v" format specifier for pdu_marshal() and pdu_unmarshal() is dropped since it does not actually pack/unpack anything. The specifier was also not implemented to update the offset variable and could only be used at the end of a format string, another sign that this shouldn't really be a format specifier. Instead, see the new v9fs_init_qiov_from_pdu() function. This change avoids a possible iovec[] buffer overflow when indirect vrings are used since the number of vectors is now limited by the underlying VirtQueueElement and cannot be out-of-bounds. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-06fix spelling in hw sub directoryDong Xu Wang2-2/+2
Correct obvious spelling errors in qemu/hw directory. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-12-06fix typo: delete redundant semicolonDong Xu Wang3-6/+6
Double semicolons should be single. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-12-04hw/9pfs: Use the correct file descriptor in Fsdriver CallbackAneesh Kumar K.V4-20/+53
Fsdriver callback that operate on file descriptor need to differentiate between directory fd and file fd. Based on the original patch from Sassan Panahinejad <sassan@sassan.me.uk> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04hw/9pfs: Add qdev.reset callback for virtio-9p-pci deviceAneesh Kumar K.V1-1/+2
Add the device reset callback Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04hw/9pfs: Reset server state during TVERSIONDeepak C Shetty1-0/+26
As per the 9p rfc, during TVERSION its necessary to clean all the active fids, so that we start the session from a clean state. Its also needed in scenarios where the guest is booting off 9p, and boot fails, and client restarts, without any knowledge of the past, it will issue a TVERSION again so this ensures that we always start from a clean state. Signed-off-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04hw/9pfs: use migration blockers to prevent live migration when virtfs export ↵Aneesh Kumar K.V3-13/+33
path is mounted Now when you try to migrate with VirtFS export path mounted, you get a proper QMP error: (qemu) migrate tcp:localhost:4444 Migration is disabled when VirtFS export path '/tmp/' is mounted in the guest using mount_tag 'v_tmp' (qemu) Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-12-04hw/9pfs: Improve portability to older systemsAneesh Kumar K.V1-33/+0
handle fs driver require a set of newly added syscalls. Don't Compile handle FS driver if those syscalls are not available. Instead of adding #ifdef for all those syscalls we check for open by handle syscall. If that is available then rest of the syscalls used by the driver should be available. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-11-289pfs: improve portability to older systemsAneesh Kumar K.V1-1/+6
I guess we can also make sure we don't call local_ioc_getversion at all. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-289pfs: improve portability to older systemsPaolo Bonzini1-2/+5
Small requirements on "new" features have percolated to virtio-9p-local.c. In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWD and flags = AT_SYMLINK_NOFOLLOW in the fallback code. Remove the arguments so that virtio-9p-local.c will not use AT_* constants. At the same time, fail local_ioc_getversion if the ioctl is not supported by the host. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-219p: pass dotl flags to the unlinkat methodPaolo Bonzini2-11/+11
AT_REMOVEDIR is not defined on all systems. Pass the raw flags from the 9p protocol, which are always there. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-219p: allow compiling the dummy virtio-9p-handle.c code on LinuxPaolo Bonzini1-1/+2
Avoid a conflict on the definition of struct file_handle by using a replacement name. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09configure: fix detection for xattr.h on modern distributionsAvi Kivity4-4/+4
Modern distributions place xattr.h in /usr/include/sys, and fold libattr.so into libc. They also don't have an ENOATTR. Make configure detect this, and add a qemu-xattr.h file that directs the #include to the right place. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-02hw/9pfs: use g_vasprintf() instead of rolling our ownStefan Hajnoczi1-99/+4
Markus Armbruster <armbru@redhat.com> sent fixes for va_list vararg issues in v9fs_string_alloc_printf(). It turns out the function duplicates g_vasprintf() and can therefore be eliminated entirely. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Replace rwlocks with RCU variants of interfaces.Harsh Prateek Bora1-16/+13
Use QLIST_INSERT_HEAD_RCU and rcu_read_lock/unlock instead of rwlocks. Use v9fs_synth_mutex as a write-only mutex to handle concurrent writers. Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Add synthetic file system support using 9pAneesh Kumar K.V3-0/+630
This patch create a synthetic file system with mount tag v_synth when -virtfs_synth command line option is specified in qemu. The synthetic file system can be mounted in guest using 9p using the below command line mount -t 9p -oversion=9p2000.L,trans=virtio v_synth <mountpint> Synthetic file system enabled different qemu subsystem to register callbacks for read and write events from guest. The subsystem can create directories and files in the synthetic file system as show in ex below qemu_v9fs_synth_mkdir(NULL, 0777, "test2", &node); qemu_v9fs_synth_add_file(node, 0777, "testfile", my_test_read, NULL, NULL); Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Abstract open state of fid to V9fsFidOpenStateAneesh Kumar K.V7-128/+160
To implement synthetic file system in Qemu we may not really require file descriptor and Dir *. Make generic code use V9fsFidOpenState instead. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Read-only support for 9p exportM. Mohan Kumar1-0/+50
A new fsdev parameter "readonly" is introduced to control accessing 9p export. "readonly" can be used to specify the access type. By default "rw" access is given to 9p export. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-31hw/9pfs: Fix error handling in local_mknodAneesh Kumar K.V1-8/+5
Update local_chown to remove unnecessary if loop Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-30hw/9pfs: Make VirtFS tracing work correctlyAneesh Kumar K.V1-31/+29
this patch fix multiple issues with VirtFS tracing. a) Add tracepoint to the correct code path. We handle error in complete_pdu b) Fix indentation in python script c) Fix variable naming issue in python script Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-10-15hw/9pfs: Use export flag for indicating security modelAneesh Kumar K.V2-50/+33
This helps to remove some of the structure members Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Rename fstype to fsdriver to make it consistent across VirtFS codeAneesh Kumar K.V1-1/+1
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Use export_flag for indicating whether fs driver use path names.Aneesh Kumar K.V5-9/+8
This allows us to remove another member from the struct Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Use fs driver specific lstatM. Mohan Kumar1-10/+23
Use file system driver specific lstat instead of generic lstat. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Remove virtio-9p-debug.* infra to be replaced by Qemu Tracing.Harsh Prateek Bora3-660/+0
Removing the existing debug infrastrucure as proposed to be replaced by Qemu Tracing infrastructure. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Introduce tracing for 9p pdu handlersHarsh Prateek Bora1-0/+72
Plan is to replace the existing debug infrastructure with Qemu tracing infrastructure so that user can dynamically enable/disable trace events and therefore a meaningful trace log can be generated which can be further filtered using an analysis script. Note: Because of current simpletrace limitations, the trace events are logging at max 6 args, however, once the more args are supported, we can change trace events to log more info as well. Also, This initial patch only provides a replacement for existing debug infra. More trace events to be added later for newly added handlers and sub-routines. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Add st_gen support for handle based fs driverHarsh Prateek Bora1-0/+51
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Add st_gen support in getattr replyHarsh Prateek Bora5-1/+91
This patch use file system specific ioctl for getting i_generation value. Not all file system support the ioctl. So we add an export specific extended operation and assign right callback for the file system that support i_generation ioctl ["M. Mohan Kumar" <mohan@in.ibm.com> we can do ioctl only for regular files and directories on the server] Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Add open flag mappingM. Mohan Kumar2-1/+76
Some of the flags are OS/arch dependent we need to use 9P defined value on wire, Based on the original patch from Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Ensure an error is reported to user if 9pfs mount tag is too longDaniel P. Berrange1-1/+3
If the 9pfs mount tag is longer than MAX_TAG_LEN bytes, rather than silently truncating the tag which will likely break the guest OS, report an immediate error and exit QEMU * hw/9pfs/virtio-9p-device.c: Report error & exit if mount tag is too long Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15virtio-9p: Use 9P specific Lock constantsM. Mohan Kumar2-1/+6
Use 9P specific lock constants instead of arch specific lock constants. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-15hw/9pfs: Fix build error on platform that don't support futimensAneesh Kumar K.V1-28/+24
Also don't do glibc version check to find handle support. Instead do handle syscall support in configure. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-10-12hw/9pfs: Add new virtfs option writeout=immediate skip host page cacheAneesh Kumar K.V4-10/+48
writeout=immediate implies the after pwritev we do a sync_file_range. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>