New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dragonball: introduce vhost-user-fs device #8429
dragonball: introduce vhost-user-fs device #8429
Conversation
Can one of the admins verify this patch? |
pub fn get_vring_notifier(&self) -> Vec<&EventFd> { | ||
self.queues | ||
.iter() | ||
.map(|x| x.notifier.notifier().unwrap()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please help to add comments about why it's safe to call unwrap()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should we return Result<Vec<&EventFd>> instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is duplicated with get_queue_interrupt_eventfds, so I removed it.
@@ -32,6 +32,7 @@ serde = "1.0.27" | |||
serde_json = "1.0.9" | |||
thiserror = "1" | |||
threadpool = "1" | |||
vm-device = "0.1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why using vm-device
instead of dbs-device
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this was a misuse, I fixed it.
2028d90
to
e9211da
Compare
/test |
27c7d83
to
4520a05
Compare
vhost-user-fs = ["vhost"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to define:
vhost-user = ["vhost"]
vhost-user-fs = ["vhost-user"]
Then it's flexible to support vhost-user-blk
etc in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks @adamqqqplay! A few comments here.
@@ -10,7 +10,7 @@ pub mod vhost_kern; | |||
pub use vhost_rs::vhost_user::Error as VhostUserError; | |||
pub use vhost_rs::Error as VhostError; | |||
|
|||
#[cfg(feature = "vhost-user")] | |||
#[cfg(feature = "vhost-user-fs")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change it to vhost-user
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let me improve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
MASTER_SLOT => { | ||
// If virtiofsd crashes, vmm will exit too. | ||
error!("{}: Master-slave disconnected, exiting...", self.id); | ||
// TODO: how to make dragonball crash here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No action of exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is currently no good way to fix it.
This patch implements the virtio-fs device used for filesystem sharing and heavily based on the vhost-user protocol. This vhost-user-fs device defines 5 parameters: - path: vhost-user socket path - tag: mount tag used from the guest to mount the filesystem - req_num_queues: number of request virtqueues - queue_size: depth of each virtqueue - cache_size: cache window size for dax This device needs to be defined before the VM instance is started, which can be done through the dbs-cli tool with --fs option: --fs '{ "sock_path":"/path/to/virtiofs.socket", "tag":"myfs", "num_queues":1, "queue_size":1024, "cache_size":0, "thread_pool_size":1, "cache_policy":"auto", "writeback_cache":true, "no_open":true, "xattr":true, "drop_sys_resource":false, "mode":"vhostuser", "fuse_killpriv_v2":true, "no_readdir":false, }' Fixes: kata-containers#8428 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Signed-off-by: Eryu Guan <eguan@linux.alibaba.com> Signed-off-by: Huang Jianan <jnhuang@linux.alibaba.com>
Add some test cases for vhost-user-fs function. Signed-off-by: Beiyue <beiyue@linux.alibaba.com> Signed-off-by: Huang Jianan <jnhuang@linux.alibaba.com>
4520a05
to
2a1fc29
Compare
/test |
This patch implements the virtio-fs device used for filesystem sharing and heavily based on the vhost-user protocol. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Signed-off-by: Eryu Guan <eguan@linux.alibaba.com> Signed-off-by: Huang Jianan <jnhuang@linux.alibaba.com> Signed-off-by: Qinqi Qu <quqinqi@linux.alibaba.com>
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks!
dragonball: support vhost-user-fs
Fixes: #8428