virtio: Remove default case from fmt() function

The default case can't call format! with the unexpected type because it
will end up back in fmt until the stack overflows.

BUG=b:232259781
TEST=build and boot Cuttlefish in aosp which uses the unhandled type

Change-Id: I80d9b745cf78859bc7e7e939fcc5f9955507241c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3655281
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Steven Moreland <smoreland@google.com>
Commit-Queue: Devin Moore <devinmoore@google.com>
This commit is contained in:
Devin Moore 2022-05-19 16:57:06 +00:00 committed by Chromeos LUCI
parent 56c0d02760
commit cbc8d507d0

View file

@ -134,7 +134,7 @@ impl std::fmt::Display for DeviceType {
DeviceType::Tpm => write!(f, "tpm"),
DeviceType::VideoDec => write!(f, "video-decoder"),
DeviceType::VideoEnc => write!(f, "video-encoder"),
t => write!(f, "unknown-{}", t),
DeviceType::Mac80211HwSim => write!(f, "mac-80211-hw-sim"),
}
}
}