cloud-hypervisor/vmm/src
Alyssa Ross a455917db5 vmm: fix missed API or debug events
Previously, we were assuming that every time an eventfd notified us,
there was only a single event waiting for us.  This meant that if,
while one API request was being processed, two more arrived, the
second one would not be processed (until the next one arrived, when it
would be processed instead of that event, and so on).  To fix this,
make sure we're processing the number of API and debug requests we've
been told have arrived, rather than just one.  This is easy to
demonstrate by sending lots of API events and adding some sleeps to
make sure multiple events can arrive while each is being processed.

For other uses of eventfd, like the exit event, this doesn't matter —
even if we've received multiple exit events in quick succession, we
only need to exit once.  So I've only made this change where receiving
an event is non-idempotent, i.e. where it matters that we process the
event the right number of times.

Technically, reset requests are also non-idempotent — there's an
observable difference between a VM resetting once, and a VM resetting
once and then immediately resetting again.  But I've left that alone
for now because two resets in immediate succession doesn't sound like
something anyone would ever want to me.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
2022-07-14 17:44:11 +01:00
..
api vmm: drop Sync+Send bounds for EndpointHandler 2022-06-20 23:28:57 +01:00
acpi.rs aarch64: Align the data types in layout 2022-04-08 11:08:43 -07:00
clone3.rs vmm: notify virtio-console of pty resizes 2021-09-14 15:43:25 +01:00
config.rs build: Fix beta clippy issue (derive_partial_eq_without_eq) 2022-06-30 20:50:45 +01:00
coredump.rs vmm: Fix clippy issues under "guest_debug" feature 2022-06-08 11:40:56 +01:00
cpu.rs hypervisor: Refactor system_registers on AArch64 2022-07-14 22:55:19 +08:00
device_manager.rs device_manager: assert passthrough_device has the correct type 2022-07-14 08:09:50 +01:00
device_tree.rs cargo: Clean up serde dependencies 2022-05-18 08:21:19 +02:00
gdb.rs build: Fix beta clippy issue (needless_return) 2022-06-30 20:50:45 +01:00
interrupt.rs vmm: Move GIC unit test to hypervisor crate 2022-06-06 10:17:26 +08:00
lib.rs vmm: fix missed API or debug events 2022-07-14 17:44:11 +01:00
memory_manager.rs vmm: save guest memory for coredump 2022-05-30 13:41:40 +02:00
migration.rs vmm: add GuestDebuggable trait 2022-05-30 13:41:40 +02:00
pci_segment.rs arch, devices, vmm: Remove "acpi" feature gate 2022-03-28 09:18:29 -07:00
seccomp_filters.rs virtio-devices, vmm: Remove unused macro rules 2022-05-20 09:59:43 +01:00
serial_buffer.rs vmm: Refactor serial buffer to allow flush on PTY when writable 2021-09-27 14:18:21 +01:00
serial_manager.rs build: Fix beta clippy issue (derive_partial_eq_without_eq) 2022-06-30 20:50:45 +01:00
sigwinch_listener.rs vmm: Fix panic in SIGWINCH listener thread when no seccomp filter set 2021-11-16 14:28:02 +00:00
vm.rs vmm: Split signal handling for VM and VMM signals 2022-07-08 15:15:46 +01:00