It would make sense for these types to be defined in a header file if
we had an API for fsdrivers to register themselves. In practice, we
only have three of them and it is very unlikely we add new ones since
the future of file sharing between host and guest is the upcoming
virtio-fs.
Move the types to qemu-fsdev.c instead since they are only used there.
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
This is a leftover of the handle backend, removed in QEMU 4.0.
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Calling error_report() from within a function that takes an Error **
argument is suspicious. qemu_fsdev_add() does that, and its caller
fsdev_init_func() then fails without setting an error. Its caller
main(), via qemu_opts_foreach(), is fine with it, but clean it up
anyway.
Cc: Greg Kurz <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Acked-by: Greg Kurz <[email protected]>
Message-Id: <[email protected]>
qemu-common.h includes qemu/option.h, but most places that include the
former don't actually need the latter. Drop the include, and add it
to the places that actually need it.
While there, drop superfluous includes of both headers, and
separate #include from file comment with a blank line.
This cleanup makes the number of objects depending on qemu/option.h
drop from 4545 (out of 4743) to 284 in my "build everything" tree.
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
[Semantic conflict with commit bdd6a90a9e in block/nvme.c resolved]
Most of the 9p code is now virtio agnostic. This patch does a final cleanup:
- drop references to Virtio from the header comments
- fix includes
Also drop a couple of leading empty lines while here.
Signed-off-by: Greg Kurz <[email protected]>
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 <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
This remove all conditional code from common code path and
make opt validation a FSDriver callback.
Signed-off-by: Aneesh Kumar K.V <[email protected]>
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 <[email protected]>
writeout=immediate implies the after pwritev we do a sync_file_range.
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Now that we start adding more files related to 9pfs
it make sense to move them to a separate directory
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Venkateswararao Jujjuri <[email protected]>
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
credentials and the client-user's credentials are saved in extended attributes.
Whereas in the case of passthrough security model, files on the
filesystem are directly created with client-user's credentials.
Signed-off-by: Venkateswararao Jujjuri <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch doesn't implement the 9p protocol handling
code. It adds a simple device which dump the protocol data.
[[email protected]: Little-Endian to host format conversion]
[[email protected]: Multiple-mounts support]
Signed-off-by: Anthony Liguori <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
This patch creates a new command line option named -fsdev to hold any file
system specific information.
The option will currently hold the following attributes:
-fsdev fstype id=id,path=path_to_share
where
fstype: Type of the file system.
id: Identifier used to refer to this fsdev
path: The path on the host that is identified by this fsdev.
[[email protected]: Abstraction using FsContext]
Signed-off-by: Gautham R Shenoy <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>