History | View | Annotate | Download (84.5 kB)
hw/9pfs: Fix segfault with 9p2000.u
When guest tries to chmod a block or char device file over 9pfs,the qemu process segfaults. With 9p2000.u protocol we use wstat tochange mode bits and client don't send extension information forchmod. We need to check for size field to check whether extension...
virtio-9p: cleanup: QOM casts.
As the virtio-9p-pci is switched to the new API, we can use QOM casts.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366708123-19626-5-git-send-email-fred.konrad@greensocs.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
virtio-9p: remove PCI dependencies from hw/9pfs/
Also move the 9p.h file to 9pfs/virtio-9p-device.h, for consistencywith the corresponding .c file.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qemu/9p: Don't ignore error in fid clunk
We use the clunk request to do the actual xattr operation. So don'tignore the error value for fid clunk.
Security model "none" don't support posix acl. Without this patchguest won't get EOPNOTSUPP error on setxattr("system.posix_acl_access")...
g_malloc(0) and g_malloc0(0) return NULL; simplify
Once upon a time, it was decided that qemu_malloc(0) should abort.Switching to glib retired that bright idea. Some code that was addedto cope with it (e.g. in commits 702ef63, b76b6e9) is still around....
misc: move include files to include/qemu/
migration: move include files to include/migration/
cleanup useless return sentence
This patch cleans up return sentences in the end of void functions.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Amos Kong <akong@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
hw/9pfs: Fix assert when disabling migration
For 9p we can get the attach request multiple times for thesame export. So don't adding migration blocker for everyattach request.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent
qemu_iovec_concat() is currently a wrapper forqemu_iovec_copy(), use the former (with extra"0" arg) in a few places where it is used.
Change skip argument of qemu_iovec_copy() from...
hw/9pfs: Endian fixes for virtfs
This patch fixes several endian bugs in virtfs.
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
hw/9pfs: Remove O_NOATIME flag from 9pfs open() calls in readonly mode
When 2c74c2cb4bedddbfa67628fbd5f9273b4e0e9903 added support forthe 'readonly' flag against 9p filesystems, it also made QEMUadd the O_NOATIME flag as a side-effect.
The O_NOATIME flag, however, may only be set by the file owner,...
hw/9pfs: Fix crash when mounting with synthfs
Some Fsdriver backend don't have fs_root. So check for that inmigrate message.
hw/9pfs: Add validation to {un}marshal code
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file
Move p9 marshaling/unmarshaling code to a separate file so thatproxy filesytem driver can use these calls. Also made marshalingcode generic to accept "struct iovec" instead of V9fsPDU.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>...
hw/9pfs: Use the correct signed type for different variables
hw/9pfs: iattr_valid flags are kernel internal flags map them to 9p values.
Kernel internal values can change, add protocol values for these constant anduse them.
hw/9pfs: replace iovec manipulation with QEMUIOVector
The v9fs_read() and v9fs_write() functions rely on iovec[] manipulationcode should be replaced with QEMUIOVector to avoid duplicating code.In the future it may be possible to make the code even more concise by...
fix typo: delete redundant semicolon
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>
hw/9pfs: use migration blockers to prevent live migration when virtfs export path is mounted
Now when you try to migrate with VirtFS export path mounted, you get a proper QMP error:
(qemu) migrate tcp:localhost:4444Migration is disabled when VirtFS export path '/tmp/' is mounted in the guest using mount_tag 'v_tmp'...
hw/9pfs: Reset server state during TVERSION
As per the 9p rfc, during TVERSION its necessary to clean all the activefids, so that we start the session from a clean state. Its also needed inscenarios where the guest is booting off 9p, and boot fails, and client...
9p: pass dotl flags to the unlinkat method
AT_REMOVEDIR is not defined on all systems. Pass the raw flags from the9p protocol, which are always there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/9pfs: use g_vasprintf() instead of rolling our own
Markus Armbruster <armbru@redhat.com> sent fixes for va_list varargissues in v9fs_string_alloc_printf(). It turns out the functionduplicates g_vasprintf() and can therefore be eliminated entirely....
hw/9pfs: Read-only support for 9p export
A new fsdev parameter "readonly" is introduced to control accessing 9p export."readonly" can be used to specify the access type. By default "rw" accessis given to 9p export.
hw/9pfs: Abstract open state of fid to V9fsFidOpenState
To implement synthetic file system in Qemu we may not reallyrequire file descriptor and Dir *. Make generic code useV9fsFidOpenState instead.
hw/9pfs: Make VirtFS tracing work correctly
this patch fix multiple issues with VirtFS tracing.a) Add tracepoint to the correct code path. We handle error in complete_pdub) Fix indentation in python scriptc) Fix variable naming issue in python script...
hw/9pfs: Add open flag mapping
Some of the flags are OS/arch dependent we need to use9P defined value on wire,
Based on the original patch from Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
hw/9pfs: Add st_gen support in getattr reply
This patch use file system specific ioctl for getting i_generationvalue. Not all file system support the ioctl. So we add an exportspecific extended operation and assign right callback for thefile system that support i_generation ioctl...
hw/9pfs: Introduce tracing for 9p pdu handlers
Plan is to replace the existing debug infrastructure with Qemu tracinginfrastructure so that user can dynamically enable/disable trace events andtherefore a meaningful trace log can be generated which can be further...
hw/9pfs: Remove virtio-9p-debug.* infra to be replaced by Qemu Tracing.
Removing the existing debug infrastrucure as proposed to be replaced byQemu Tracing infrastructure.
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>...
hw/9pfs: Use export_flag for indicating whether fs driver use path names.
This allows us to remove another member from the struct
virtio-9p: Use 9P specific Lock constants
Use 9P specific lock constants instead of arch specific lock constants.
hw/9pfs: Add new virtfs option writeout=immediate skip host page cache
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>
hw/9pfs: Make v9fs_string* functions non-static
We will use them later in other files
hw/9pfs: Use read-write lock for protecting fid path.
On rename we take the write lock and this ensure pathdoesn't change as we operate on them.
hw/9pfs: Move fid pathname tracking to seperate data type.
This enables us to add handles to track fids later. TheV9fsPath added is similar to V9fsString except that thesize include the NULL byte also.
hw/9pfs: Add fs driver specific details to fscontext
Add a new context flag PATHNAME_FSCONTEXT and indicate whetherthe fs driver track fid using path names. Also add a privatepointer that help us to track fs driver specific values in there
hw/9pfs: Avoid unnecessary get_fid in v9fs_clunk
hw/9pfs: Implement TFLUSH operation
hw/9pfs: add 9P2000.L unlinkat operation
unlinkat - Remove a directory entry
size4 Tunlinkat tag2 dirfid4 name[s] flag4size4 Runlinkat tag2
older Tremove have the below request format
size4 Tremove tag2 fid4
The remove message is used to remove a directory entry either file or directory...
hw/9pfs: add 9P2000.L renameat operation
rename - change name of file or directory
size4 Trenameat tag2 olddirfid4 oldname[s] newdirfid4 newname[s]size4 Rrenameat tag2
older Trename have the below request format
size4 Trename tag2 fid4 newdirfid4 name[s]...
hw/9pfs: Fix memleaks in some 9p operation
hw/9pfs: Initialize rest of qid field to zero.
Since qid is allocated out of stack we need to intializethe field to zero. Otherwise we will send wrong qid valueto client.
hw/9pfs: Update the fidp path before opendir
We need to update the fidp path before opendir. Since we don'tuse the fid returned by mkdir, earlier code should not havemuch issue. We do a double v9fs_string_copy here. The later patchcleanup the entire function....
hw/9pfs: Use v9fs_do_close instead of close
we should use the local abstraction instead ofdirectly calling close.
hw/9pfs: Add directory reclaim support
hw/9pfs: mark directories also as un-reclaimable on unlink
hw/9pfs: Add reference counting for fid
hw/9pfs: Add file descriptor reclaim support
[M. Mohan Kumar <mohan@in.ibm.com> removed some unused variables]
use readdir_r instead of readdir for reentrancy
Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Update v9fs_read to use coroutines
hw/9pfs: Update v9fs_attach to use coroutines
hw/9pfs: Update v9fs_wstat to use coroutines
hw/9pfs: Update v9fs_write to use coroutines
hw/9pfs: Update v9fs_link to use coroutines
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Update v9fs_symlink to use coroutines
hw/9pfs: Update v9fs_create to use coroutines
hw/9pfs: Update v9fs_fsync to use coroutines
hw/9pfs: Update v9fs_clunk to use coroutines
hw/9pfs: Update v9fs_walk to use coroutines
hw/9pfs: Update v9fs_stat to use coroutines
hw/9pfs: Update v9fs_lcreate to use coroutines
hw/9pfs: Update v9fs_open to use coroutines
hw/9pfs: Update v9fs_getlock to use coroutines
hw/9pfs: Update v9fs_lock to use coroutines
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/9pfs: Update vfs_rename to use coroutines
I guess TRENAME 9p operation needs an update. The 9p op shouldmore similar renameat. Otherwise anything other than path cannot trackthe fid.
hw/9pfs: Update v9fs_remove to use coroutines
hw/9pfs: Update mkdir to use coroutines
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Update v9fs_mknod to use coroutines
hw/9pfs: Update v9fs_statfs to use coroutines
hw/9pfs: Update v9fs_getattr to use coroutines
hw/9pfs: Update v9fs_setattr to use coroutines
hw/9pfs: Update v9fs_xattrwalk to coroutines
hw/9pfs: Update v9fs_xattrcreate to use coroutines
hw/9pfs: Update v9fs_readdir to use coroutines
hw/9pfs: Update v9fs_readlink to use coroutine
[virtio-9p] Change all pdu handlers to coroutines.
This patch changes the top level handlers to coroutines and sets the base.It will be followed up with series of patches to convert all filesystemcalls to threaded coroutines pushing all blocking clals in VirtFS out...
Merge remote-tracking branch 'jvrao/for-anthony' into staging
virtio-9p: Remove statement without effect (fix warning from cppcheck)
cppcheck report:virtio-9p.c:197: warning: Redundant assignment of "flags" to itself
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Reviewed-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>...
hw/9pfs: Don't crash when we get a request with not supported 9p operation
Return EOPNOTSUPP as error
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
virtio-9p: Use relative includes for files in hw
Commit 353ac78d495ef976242abd868f68d78420861c2c moved the fileswithout fixing the include paths. It used a modified CFLAGSto add hw to the include search path, but this breaks buildswhere the user wants to set special CFLAGS. Long include paths...
virtio-9p: Move device specific code to virtio-9p-device
virtio-9p: Move 9p device registration into virtio-9p.c
This patch move the 9p device registration into its own file
[virtio-9p] Stop renaming files with similar name!
v9fs_complete_rename() mistakenly renames files with similar nameas we don't check if the matched name is really an offspring.
Signed-off-by: Malahal Naineni <malahal@us.ibm.com>Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
v9fs_walk: As per 9p2000 RFC, MAXWELEM >= nwnames >= 0.
The nwnames field in TWALK message is assumed to be >=0 and <= MAXWELEMwhich is defined as macro P9_MAXWELEM (16) in virtio-9p.h as per 9p2000RFC. Appropriate changes are required in V9fsWalkState and v9fs_walk....
virtio-9p: Bugfix to send correct iounit
LCREATE function packs address of iounit in the pdu, fix that to sendactual iounit itself.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>Acked-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
virtio-9p: Print the pdu details on return
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
virtio-9p: move 9p files around
Now that we start adding more files related to 9pfsit make sense to move them to a separate directory