pub struct BpfMapWrite { /* private fields */ }Expand description
Host-side BPF map write performed during VM execution.
Applied by the host thread freeze_coord::start_bpf_map_write in three
phases: build the guest-memory BPF-map accessor, resolve the field
NAME to a byte offset via the target map’s program BTF, then write.
After the writes the host pushes SIGNAL_BPF_WRITE_DONE through
virtio-console (host_comms::request_bpf_map_write_done) so a guest
scenario gated on Ctx::wait_for_map_write unblocks.
Construct with BpfMapWrite::new, which const-asserts the
map_name_suffix format at compile time. Direct struct-literal
construction is rejected (fields are crate-private) so every
constructed BpfMapWrite passes through the format gate.
Implementations§
Source§impl BpfMapWrite
impl BpfMapWrite
Sourcepub const fn new(
map_name_suffix: &'static str,
field: &'static str,
value: u32,
) -> Self
pub const fn new( map_name_suffix: &'static str, field: &'static str, value: u32, ) -> Self
Const constructor for use in static/const context.
§Panics
Panics at compile time (or const-eval time) when:
map_name_suffixis emptymap_name_suffixdoes not start with.(BPF map names are derived from ELF section names like.bss,.data,.rodata; a suffix without the leading.would never match any loaded map and is almost certainly a typo)map_name_suffixis a bare.or starts with..(no real BPF section name has that shape)map_name_suffixcontains whitespace,/,\, or any non-printable / control byte (no real BPF map name carries those characters; NULL would truncate libbpf C-string comparison)fieldis empty (it names the VAR to write — a bare.bss/.dataglobal like"crash", or a dot-path into the value struct; the byte offset is resolved from the map’s BTF value type at write time, so a raw offset can never land in struct padding)fieldstarts or ends with., or contains..(an empty path segment the BTF resolver could never match)fieldcontains whitespace,/,\, or any non-printable / control byte (no real BTF VAR name carries those characters)
Sourcepub const fn map_name_suffix(&self) -> &'static str
pub const fn map_name_suffix(&self) -> &'static str
The validated map-name suffix to match against loaded BPF maps
(e.g. ".bss").
Trait Implementations§
Source§impl Clone for BpfMapWrite
impl Clone for BpfMapWrite
Source§fn clone(&self) -> BpfMapWrite
fn clone(&self) -> BpfMapWrite
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BpfMapWrite
impl Debug for BpfMapWrite
Source§impl Hash for BpfMapWrite
impl Hash for BpfMapWrite
Source§impl PartialEq for BpfMapWrite
impl PartialEq for BpfMapWrite
impl Copy for BpfMapWrite
impl Eq for BpfMapWrite
impl StructuralPartialEq for BpfMapWrite
Auto Trait Implementations§
impl Freeze for BpfMapWrite
impl RefUnwindSafe for BpfMapWrite
impl Send for BpfMapWrite
impl Sync for BpfMapWrite
impl Unpin for BpfMapWrite
impl UnwindSafe for BpfMapWrite
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more