[PATCH 0/9] hw/audio/virtio-sound: basic migration support

Alexander Mikhalitsyn posted 9 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260625080910.30569-1-alexander@mihalicyn.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
There is a newer version of this series
hw/audio/trace-events         |   3 +-
hw/audio/virtio-snd.c         | 685 ++++++++++++++++++++--------------
include/hw/audio/virtio-snd.h |  25 +-
3 files changed, 407 insertions(+), 306 deletions(-)
[PATCH 0/9] hw/audio/virtio-sound: basic migration support
Posted by Alexander Mikhalitsyn 1 month ago
From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>

Dear friends,

This patchset is aimed to support virtio-sound live migration and based on
pre-existing Volker Rümelin's patches from qemu-devel lists [1]. I tried
to ask (https://lore.kernel.org/qemu-devel/9d7ea128c711c201688a4716f53b8a335fc53569.camel@mihalicyn.com/)
if Volker is going to continue his work on this, but received no reply so I
just decided to go forward: take his patches, rebase and resend. Of course,
I kept all authorship/tags so I hope that it is fine.

Testing.

I manually validated this with Ubuntu 24.04 Desktop VM and found no issues.
Also, it was validated with CI (https://gitlab.com/mihalicyn/qemu/-/pipelines/2626702088).

Original patchset:
https://lore.kernel.org/qemu-devel/a289a081-9a61-4bcb-b693-bf6cd7768c0e@t-online.de [1]

Git tree:
https://gitlab.com/mihalicyn/qemu/-/commits/virtio-sound-migration

Changelog relative to the original Volker Rümelin's submission:
- rebased:
	- "hw/audio/virtio-sound: return correct command response size"
		was dropped as it was already merged
	- "hw/audio/virtio-sound: fix segmentation fault in tx/rx xfer handler"
		was dropped as it seems to be replaced with another fix
		https://github.com/qemu/qemu/commit/731655f87f319fd06f27282c6cafbc2467ac8045
	- I had to drop all pre-existing Reviewed-by tags cause it was 2 years since
	  this patchset was sent and reviewed and I did a quite significant code changes
	  during rebase

Kind regards,
Alex

Volker Rümelin (9):
  hw/audio/virtio-sound: remove command and stream mutexes
  hw/audio/virtio-sound: allocate an array of streams
  hw/audio/virtio-sound: free all stream buffers on reset
  hw/audio/virtio-sound: split out virtio_snd_pcm_start_stop()
  hw/audio/virtio-sound: add stream state variable
  hw/audio/virtio-sound: introduce virtio_snd_pcm_open()
  hw/audio/virtio-sound: introduce virtio_snd_set_active()
  hw/audio/virtio-sound: add missing vmstate fields
  hw/audio/virtio-sound: add placeholder for buffer write position

 hw/audio/trace-events         |   3 +-
 hw/audio/virtio-snd.c         | 685 ++++++++++++++++++++--------------
 include/hw/audio/virtio-snd.h |  25 +-
 3 files changed, 407 insertions(+), 306 deletions(-)

-- 
2.47.3


Re: [PATCH 0/9] hw/audio/virtio-sound: basic migration support
Posted by Daniel P. Berrangé 1 month ago
On Thu, Jun 25, 2026 at 10:09:01AM +0200, Alexander Mikhalitsyn wrote:
> From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> 
> Dear friends,
> 
> This patchset is aimed to support virtio-sound live migration and based on
> pre-existing Volker Rümelin's patches from qemu-devel lists [1]. I tried
> to ask (https://lore.kernel.org/qemu-devel/9d7ea128c711c201688a4716f53b8a335fc53569.camel@mihalicyn.com/)
> if Volker is going to continue his work on this, but received no reply so I
> just decided to go forward: take his patches, rebase and resend. Of course,
> I kept all authorship/tags so I hope that it is fine.

Yes, that's the right way to approach it, you waited a decently long
time for any response to your query.

My only suggestion, in the commit messages, if you made any non-trivial
changes to Volker's functional code, then just put a single sentence
inbetween the two S-o-B lines to highlight it, eg

  Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
  [AM:  changed blah, blah & blah because blah]
  Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>

if you didn't make any non-trivial changes, then what you've done is fine.

> Changelog relative to the original Volker Rümelin's submission:
> - rebased:
> 	- "hw/audio/virtio-sound: return correct command response size"
> 		was dropped as it was already merged
> 	- "hw/audio/virtio-sound: fix segmentation fault in tx/rx xfer handler"
> 		was dropped as it seems to be replaced with another fix
> 		https://github.com/qemu/qemu/commit/731655f87f319fd06f27282c6cafbc2467ac8045
> 	- I had to drop all pre-existing Reviewed-by tags cause it was 2 years since
> 	  this patchset was sent and reviewed and I did a quite significant code changes
> 	  during rebase

No problem.

> 
> Kind regards,
> Alex
> 
> Volker Rümelin (9):
>   hw/audio/virtio-sound: remove command and stream mutexes
>   hw/audio/virtio-sound: allocate an array of streams
>   hw/audio/virtio-sound: free all stream buffers on reset
>   hw/audio/virtio-sound: split out virtio_snd_pcm_start_stop()
>   hw/audio/virtio-sound: add stream state variable
>   hw/audio/virtio-sound: introduce virtio_snd_pcm_open()
>   hw/audio/virtio-sound: introduce virtio_snd_set_active()
>   hw/audio/virtio-sound: add missing vmstate fields
>   hw/audio/virtio-sound: add placeholder for buffer write position
> 
>  hw/audio/trace-events         |   3 +-
>  hw/audio/virtio-snd.c         | 685 ++++++++++++++++++++--------------
>  include/hw/audio/virtio-snd.h |  25 +-
>  3 files changed, 407 insertions(+), 306 deletions(-)
> 
> -- 
> 2.47.3
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Re: [PATCH 0/9] hw/audio/virtio-sound: basic migration support
Posted by Alexander Mikhalitsyn 1 month ago
Am Do., 25. Juni 2026 um 10:37 Uhr schrieb Daniel P. Berrangé
<berrange@redhat.com>:
>
> On Thu, Jun 25, 2026 at 10:09:01AM +0200, Alexander Mikhalitsyn wrote:
> > From: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
> >
> > Dear friends,
> >
> > This patchset is aimed to support virtio-sound live migration and based on
> > pre-existing Volker Rümelin's patches from qemu-devel lists [1]. I tried
> > to ask (https://lore.kernel.org/qemu-devel/9d7ea128c711c201688a4716f53b8a335fc53569.camel@mihalicyn.com/)
> > if Volker is going to continue his work on this, but received no reply so I
> > just decided to go forward: take his patches, rebase and resend. Of course,
> > I kept all authorship/tags so I hope that it is fine.
>
> Yes, that's the right way to approach it, you waited a decently long
> time for any response to your query.
>
> My only suggestion, in the commit messages, if you made any non-trivial
> changes to Volker's functional code, then just put a single sentence
> inbetween the two S-o-B lines to highlight it, eg
>
>   Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
>   [AM:  changed blah, blah & blah because blah]
>   Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
>
> if you didn't make any non-trivial changes, then what you've done is fine.

Hi Daniel,

thank you for such a fast reaction on my patch submission ;-)

I've addressed this in -v2 and sent it.

Kind regards,
Alex

>
> > Changelog relative to the original Volker Rümelin's submission:
> > - rebased:
> >       - "hw/audio/virtio-sound: return correct command response size"
> >               was dropped as it was already merged
> >       - "hw/audio/virtio-sound: fix segmentation fault in tx/rx xfer handler"
> >               was dropped as it seems to be replaced with another fix
> >               https://github.com/qemu/qemu/commit/731655f87f319fd06f27282c6cafbc2467ac8045
> >       - I had to drop all pre-existing Reviewed-by tags cause it was 2 years since
> >         this patchset was sent and reviewed and I did a quite significant code changes
> >         during rebase
>
> No problem.
>
> >
> > Kind regards,
> > Alex
> >
> > Volker Rümelin (9):
> >   hw/audio/virtio-sound: remove command and stream mutexes
> >   hw/audio/virtio-sound: allocate an array of streams
> >   hw/audio/virtio-sound: free all stream buffers on reset
> >   hw/audio/virtio-sound: split out virtio_snd_pcm_start_stop()
> >   hw/audio/virtio-sound: add stream state variable
> >   hw/audio/virtio-sound: introduce virtio_snd_pcm_open()
> >   hw/audio/virtio-sound: introduce virtio_snd_set_active()
> >   hw/audio/virtio-sound: add missing vmstate fields
> >   hw/audio/virtio-sound: add placeholder for buffer write position
> >
> >  hw/audio/trace-events         |   3 +-
> >  hw/audio/virtio-snd.c         | 685 ++++++++++++++++++++--------------
> >  include/hw/audio/virtio-snd.h |  25 +-
> >  3 files changed, 407 insertions(+), 306 deletions(-)
> >
> > --
> > 2.47.3
> >
> >
>
> With regards,
> Daniel
> --
> |: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
> |: https://libvirt.org          ~~          https://entangle-photo.org :|
> |: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|
>