commit | 572519253ddc0ef6c27bb465d880420a29466e37 | [log] [tgz] |
---|---|---|
author | Grzegorz Jaszczyk <jaz@semihalf.com> | Tue Sep 20 23:00:36 2022 +0000 |
committer | crosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Sep 22 09:14:19 2022 +0000 |
tree | df7655ed3c0d61b34b911a7b856f7c3d8af9c8d7 | |
parent | aea39132e8cc58697397ac8773062719496b9a5a [diff] |
audio: fix VirtioSnd re-activation Hitherto the activation could succeed only once since take() function on Option "Takes the value out of the option, leaving a None in its place." Above resulted with crosvm crash in guest suspend/resume scenario when the activate was called more than once (for the second time snd_data and stream_source_generators was None). To overcome above issue use clone for snd_data. For stream_source_generator the clone can't be easily used due to missing Clone support for stream_source_generators embed data types (e.g. 369 | struct AudioBuffer<'a> { 370 | buffer: &'a mut [u8], | ^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `&mut [u8]` and some other). Therefore for stream_source_generator move create_stream_source_generators from new() to activate. BUG=b:246728970 TEST=Perform multiple suspend/resume s2idle cycle for borealis VM and make sure that 1) crosvm doesn't crash anymore 2) audio from borealis VM is still working after VM suspend/resume cycles. Change-Id: I8b27042e4cc0e5efb1d92756ac3b71a5a744f705 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3904649 Commit-Queue: Norman Bintang <normanbt@chromium.org> Reviewed-by: Norman Bintang <normanbt@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on Chrome OS devices.