From: "Alex Bennée" <alex.bennee@linaro.org>
To: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Subject: Re: Fwd: VirtioSound device emulation implementation
Date: Thu, 14 Jan 2021 17:41:54 +0000 [thread overview]
Message-ID: <87ft33l8an.fsf@linaro.org> (raw)
In-Reply-To: <CAAQ-SiNKXhJcT1XEodQT6kojqppq37Kg8F8igipQ-HVYOU0=zA@mail.gmail.com>
Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com> writes:
> Just an update:
>
> I've studied the virtio specification along with the source code and I now
> understand what the device implementation is
> going to look like. Also I understand the source code a lot better. I am
> now reading about the qemu vhost-user protocol.
>
> Although I haven't read about the vhost-user daemon in detail, from what
> little I have read, I would say that the daemon
> would get the virtqueues from the virtio device and forward it to the sound
> device of the host. (This is the hard part
> I think, since an in QEMU device would use code already written for
> processing these queues.)
I can't comment on the difficulty there but this does point more towards
using the in-QEMU approach given we have a bunch of utility functions already.
> I think only the tx and rx
> queues would be shared, and although I do not know exactly how the sharing
> will be implemented, I think the memory
> will be shared to the vhost-user daemon too? So now the virtqueue memory is
> shared between the virtio driver in guest
> OS, the virtio device in QEMU, and the vhost-user daemon running in the
> host userspace.
QEMU uses a memfd file descriptor to share the guests entire memory map
with the daemon.
> As for the configuration part, the driver will negotiate features with the
> virtio device in QEMU, which in turn will communicate
> with the vhost-user daemon (via sockets) to get the features supported I
> think.
>
> This is what I think it will roughly look like. (Of course modulo the
> implementation details.) I do not yet understand how
> much more difficult will implementing the vhost-user daemon be, and since I
> was already
> warned about the difficulty, I will not risk making any hasty decisions
> that later hinder the project. I will read up
> about the vhost-user daemon and how it's implemented to get a better idea,
> and then make the final call.
If you want to see an example of a branch new vhost-user daemon being
built up from scratch see my recent virtio-rpmb series. The first few
patches of in-QEMU code will be the same boilerplate either way I think:
https://patchew.org/QEMU/20200925125147.26943-1-alex.bennee@linaro.org/
> Anyways I am super excited about the project. I got to learn about some
> really cool things in the past couple of days,
> and I can not wait to implement it. :)
--
Alex Bennée
next prev parent reply other threads:[~2021-01-14 18:36 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 10:00 VirtioSound device emulation implementation Shreyansh Chouhan
2021-01-06 11:40 ` Alex Bennée
2021-01-07 14:58 ` Shreyansh Chouhan
2021-01-07 15:58 ` Gerd Hoffmann
2021-01-07 17:17 ` Alex Bennée
2021-01-08 7:53 ` Shreyansh Chouhan
2021-01-08 8:34 ` Gerd Hoffmann
2021-01-10 8:25 ` Shreyansh Chouhan
[not found] ` <CAAQ-SiPiq5NQN=2mvP3isZ9PtYO2Bu64kVEvE6T+3OJd5B-U5A@mail.gmail.com>
2021-01-11 6:29 ` Fwd: " Shreyansh Chouhan
2021-01-11 11:59 ` Alex Bennée
2021-01-14 15:00 ` Shreyansh Chouhan
2021-01-14 17:41 ` Alex Bennée [this message]
2021-01-15 8:00 ` Shreyansh Chouhan
2021-01-17 10:30 ` Shreyansh Chouhan
2021-01-18 18:53 ` Shreyansh Chouhan
2021-01-20 11:41 ` Shreyansh Chouhan
2021-01-25 6:02 ` Shreyansh Chouhan
2021-01-25 11:23 ` Alex Bennée
2021-01-28 4:28 ` Shreyansh Chouhan
2021-01-28 10:42 ` Alex Bennée
2021-01-28 15:40 ` Shreyansh Chouhan
2021-01-28 11:25 ` Gerd Hoffmann
2021-01-28 15:50 ` Shreyansh Chouhan
2021-01-28 16:30 ` Gerd Hoffmann
2021-01-28 17:34 ` Shreyansh Chouhan
2021-02-11 4:59 ` Shreyansh Chouhan
2021-02-15 14:39 ` Gerd Hoffmann
2021-04-04 13:55 ` Shreyansh Chouhan
2021-04-16 11:32 ` Gerd Hoffmann
2021-04-19 12:30 ` Shreyansh Chouhan
2021-04-19 12:33 ` Shreyansh Chouhan
2021-04-19 13:10 ` Gerd Hoffmann
[not found] ` <CAAQ-SiMf=BV-HUudRayZkRPJjmkYWuiBuKqYHHLzYjcFnPOgLQ@mail.gmail.com>
[not found] ` <20210419135627.dlerwnswhfxt6ciz@sirius.home.kraxel.org>
[not found] ` <CAAQ-SiM6uWUgHTS5PQ-hSkuXNOoKC7fw6Y1ZHhJ0MCUE3oaBqg@mail.gmail.com>
[not found] ` <20210420071304.gmndase3r6mwp5yt@sirius.home.kraxel.org>
[not found] ` <CAAQ-SiPPNK0xqnPPSjNZgwQCs+Vj0_A5koq5xK8HzhZKDgqVJw@mail.gmail.com>
2021-12-29 5:52 ` Shreyansh Chouhan
2022-01-20 10:39 ` Laurent Vivier
2022-02-07 4:06 ` Shreyansh Chouhan
2022-02-08 17:26 ` Shreyansh Chouhan
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=87ft33l8an.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=chouhan.shreyansh2702@gmail.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 NNTP newsgroup(s).