All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Subject: Re: Fwd: VirtioSound device emulation implementation
Date: Thu, 28 Jan 2021 21:10:03 +0530	[thread overview]
Message-ID: <CAAQ-SiOCRSFxyWGqw07a-=0yg8tAiNCoLSSNm4sFx3a6+X7b5w@mail.gmail.com> (raw)
In-Reply-To: <87o8h9wbh5.fsf@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 3061 bytes --]

On Thu, 28 Jan 2021 at 16:54, Alex Bennée <alex.bennee@linaro.org> wrote:

>
> Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com> writes:
>
> > Thanks a lot Alex!
> >
> >> All QEMU devices have two parts, a frontend (which the guest sees) and a
> >> backend (which is how the data gets to somewhere in the host). Some of
> >> the command line options in QEMU elide the details for convenience (-nic
> >> and -drive are examples). The -netdev device is all about configuring
> >> the backend of the network part for a paired -device front end. There is
> >> a similar setup for audio (-audiodev) although I'll defer to Gerd's
> >> expertise on how the two interact.
> >
> > This helped me understand a bit more about how the devices work. In the
> > source
> > code, I found the `virtio-net-pci.c` and `virtio-net.c` files, I think
> the
> > pci device is what is visible to the guest.
> > So `virtio-net-pci.c` should be the front end?
>
> No - they are both front-ends. In VirtIO you have two transports. The
> first is virtio-mmio which is a simple set of memory mapped IO
> registers. There is no discovery (well there is some but the guest needs
> to find where in memory the mmio bus is via some method like hardcoded
> address or DTB).
>
> The second is virtio-pci. Here the virtio devices are encapsulated in a
> PCI bus so you get the benefits of discovery and bus enumeration.
>
So I am a bit confused here. First of there are two parts to a virtio
device in general. One is the
front end that the guest sees, and one is where the processing happens,
which could be either in QEMU
or as a separate daemon. In case of an in QEMU virtio device, the QEMU
front end is replaced by the
virtio-front end. Is that true? That's what I think should happen if both
of those files are front ends.

When you said earlier that all QEMU devices have two parts, I somehow
thought that
the in-QEMU backend for the audio device will itself have two parts.

>
> > For the realize function, I saw that the `virtio_net_device_realize`
> > function initializes
> > the `net_conf` for the device. So I am guessing that the
> > `virtio_snd_device_realize` function
> > should initialize the number of jacks and streams a device has, along
> with
> > the configuration
> > for all these jacks and streams?
>
> No those are all front-end configuration knobs.
>
I am assuming these are set from the command-line or the configuration
files.

>
> > The thing is I do not understand `net` devices all that well so I get a
> bit
> > confused with
> > what is specific to a net device and what should I actually be worried
> > about :)
> >
> > The device initalization step mentions that the jack and streams should
> be
> > read and
> > a query should be made for the config of all jacks and streams. What
> should
> > be the
> > default values of these configurations? I think the realize function is
> > responsible
> > for setting these up.
>
> Gerd?
>
>
>
> --
> Alex Bennée
>
--
Shreyansh

[-- Attachment #2: Type: text/html, Size: 4049 bytes --]

  reply	other threads:[~2021-01-28 15:43 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
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 [this message]
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='CAAQ-SiOCRSFxyWGqw07a-=0yg8tAiNCoLSSNm4sFx3a6+X7b5w@mail.gmail.com' \
    --to=chouhan.shreyansh2702@gmail.com \
    --cc=alex.bennee@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.