virtio: move cras-snd creation after virtio GPU

In ARCVM `genfs_contexts`, we have hard-coded rules with device node id for
network and virtio-gpu. In crosvm virtio devices creation, the
device node id is assigned by order, so introducing 2 virtio-snd devices
will shift id to id+2 for those devices created after virtio-snd.

This will break ARCVM-next boot.

Changes:
Move virtio-snd device creation after virtio GPU.

BUG=b:213249578, b:199001477
TEST=cargo build

Change-Id: I2fd6ee2c892ae65b0e41d7f42613714a31d7833f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3366166
Auto-Submit: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
This commit is contained in:
Chih-Yang Hsia 2022-01-05 17:30:28 +08:00 committed by Commit Bot
parent 3cde974af0
commit e31731c1e5

View file

@ -1441,13 +1441,6 @@ fn create_virtio_devices(
devs.push(create_rng_device(cfg)?);
#[cfg(feature = "audio_cras")]
{
for cras_snd in &cfg.cras_snds {
devs.push(create_cras_snd_device(cfg, cras_snd.clone())?);
}
}
#[cfg(feature = "tpm")]
{
if cfg.software_tpm {
@ -1653,6 +1646,13 @@ fn create_virtio_devices(
}
}
#[cfg(feature = "audio_cras")]
{
for cras_snd in &cfg.cras_snds {
devs.push(create_cras_snd_device(cfg, cras_snd.clone())?);
}
}
#[cfg(feature = "video-decoder")]
{
if let Some((video_dec_tube, video_dec_backend)) = video_dec_cfg {