vmm: update serial manager epoll events size

I've moved this so that it's just after the enum definition, which
will hopefully make it less easy to miss if events are added/removed
again in future.

Fixes: 6d1077fc ("vmm: Unix socket backend for serial port")
Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
Alyssa Ross 2024-09-20 22:18:53 +02:00 committed by Rob Bradford
parent e810be62cd
commit 938ff2eeb7

View File

@ -92,6 +92,7 @@ pub enum EpollDispatch {
Socket = 2,
Unknown,
}
const EPOLL_EVENTS_LEN: usize = 4;
impl From<u64> for EpollDispatch {
fn from(v: u64) -> Self {
@ -291,9 +292,6 @@ impl SerialManager {
.name("serial-manager".to_string())
.spawn(move || {
std::panic::catch_unwind(AssertUnwindSafe(move || {
// 3 for File, Kill, and Unknown
const EPOLL_EVENTS_LEN: usize = 3;
let mut events =
[epoll::Event::new(epoll::Events::empty(), 0); EPOLL_EVENTS_LEN];