virtio-fs.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>,
	virtio-fs@redhat.com,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Fam Zheng <fam@euphon.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	German Maglione <gmaglione@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Raphael Norwitz <raphael.norwitz@nutanix.com>,
	Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, "Gonglei (Arei)" <arei.gonglei@huawei.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Virtio-fs] [PATCH for-7.2] vhost: enable vrings in vhost_dev_start() for vhost-user devices
Date: Mon, 5 Dec 2022 10:29:49 +0100	[thread overview]
Message-ID: <20221205092949.goyo76dy76u2d4ie@sgarzare-redhat> (raw)
In-Reply-To: <20221201164750-mutt-send-email-mst@kernel.org>

On Thu, Dec 01, 2022 at 04:49:37PM -0500, Michael S. Tsirkin wrote:
>On Thu, Dec 01, 2022 at 12:21:21PM +0000, Alex Bennée wrote:
>>
>> "Michael S. Tsirkin" <mst@redhat.com> writes:
>>
>> > On Thu, Dec 01, 2022 at 10:14:39AM +0000, Alex Bennée wrote:
>> >> Do you think rust-vmm's vhost crates have enough of the state
>> >> management to manage vhost and vhost-user backends? Maybe it would be a
>> >> good experiment in replacing a (small well defined) piece of
>> >> functionality with rust?

I honestly don't know, but I think they are not 100% complete.
I do agree that an experiment would be nice though, maybe a GSoC?
Or maybe not, since it's not very clear whether we get to the end or not....

>> >>
>> >> That said there is a lot of deep magic in the vhost-net stuff which I
>> >> think is down to the interaction with things like vdpk and other network
>> >> optimisations that might be missing. For the rest of the devices most of
>> >> the code is basically boiler plate which has grown variations due to
>> >> code motion and change. This is the sort of thing that generics solves
>> >> well.
>> >
>> > Not sure what you want to replace with what though, libvhost-user or
>> > vhost-user bits in qemu?
>>
>> The vhost-user bits in the main QEMU binary. We already don't use
>> libvhost-user for most of our backends anyway ;-)
>
>Mixing C and Rust like this is far from trivial. I'd start with
>something much less ambitious that virtio.

We recently merged libblkio [1] support in QEMU [2], where we did
something similar.
libblkio provides a C API, but the library is totally written in Rust.
Writing the C interface was not too complicated.

The advantage here is that the Rust code is already part of the rust-vmm
crates.
I think it needs adjustments, but it's not a bad idea in my opinion.

Anyway, I don't think it's an easy job, though, so maybe GSoC could just
be about writing the C interface and adapting Rust crates. Touching QEMU
might require too much knowledge of the current code.

Thanks,
Stefano

[1] https://libblkio.gitlab.io/libblkio/
[2] https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg02215.html


      reply	other threads:[~2022-12-05  9:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 13:16 [Virtio-fs] [PATCH for-7.2] vhost: enable vrings in vhost_dev_start() for vhost-user devices Stefano Garzarella
2022-11-24  0:19 ` Raphael Norwitz
2022-11-24  6:50   ` Michael S. Tsirkin
2022-11-24  7:54     ` Stefano Garzarella
2022-11-24 13:50       ` Raphael Norwitz
2022-11-24 18:36 ` Stefan Hajnoczi
2022-11-25  8:12   ` Stefano Garzarella
2022-11-30 21:03     ` Stefan Hajnoczi
2022-12-01  7:04       ` Michael S. Tsirkin
2022-12-01  8:02       ` Stefano Garzarella
2022-12-01 10:14         ` Alex Bennée
2022-12-01 10:34           ` Michael S. Tsirkin
2022-12-01 12:21             ` Alex Bennée
2022-12-01 21:49               ` Michael S. Tsirkin
2022-12-05  9:29                 ` Stefano Garzarella [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221205092949.goyo76dy76u2d4ie@sgarzare-redhat \
    --to=sgarzare@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=arei.gonglei@huawei.com \
    --cc=dgilbert@redhat.com \
    --cc=fam@euphon.net \
    --cc=gmaglione@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.norwitz@nutanix.com \
    --cc=stefanha@redhat.com \
    --cc=viresh.kumar@linaro.org \
    --cc=virtio-fs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).