From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
Gerd Hoffmann <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-stable@nongnu.org
Subject: Re: [PATCH] hw/audio/virtio-snd: Use device endianness instead of target one
Date: Mon, 22 Apr 2024 15:09:30 +0200 [thread overview]
Message-ID: <335ba8e4-1e5c-4080-bc11-e01f63169a18@linaro.org> (raw)
In-Reply-To: <20240422130416.1891-1-philmd@linaro.org>
On 22/4/24 15:04, Philippe Mathieu-Daudé wrote:
> Since VirtIO devices can change endianness at runtime,
> we need to use the device endianness, not the target
> one.
>
> Cc: qemu-stable@nongnu.org
> Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/audio/virtio-snd.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
> -static void virtio_snd_get_qemu_audsettings(audsettings *as,
> +static void virtio_snd_get_qemu_audsettings(VirtIOSound *s, audsettings *as,
> virtio_snd_pcm_set_params *params)
> {
> + VirtIODevice *vdev = VIRTIO_DEVICE(s);
> +
> as->nchannels = MIN(AUDIO_MAX_CHANNELS, params->channels);
> as->fmt = virtio_snd_get_qemu_format(params->format);
> as->freq = virtio_snd_get_qemu_freq(params->rate);
> - as->endianness = target_words_bigendian() ? 1 : 0;
> + as->endianness = vdev->device_endian ? 1 : 0;
Err, I neglected to consider VIRTIO_DEVICE_ENDIAN_UNKNOWN :/
> }
prev parent reply other threads:[~2024-04-22 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 13:04 [PATCH] hw/audio/virtio-snd: Use device endianness instead of target one Philippe Mathieu-Daudé
2024-04-22 13:09 ` Philippe Mathieu-Daudé [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=335ba8e4-1e5c-4080-bc11-e01f63169a18@linaro.org \
--to=philmd@linaro.org \
--cc=kraxel@redhat.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).