MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / read_config

Method read_config

virtio-devices/src/vsock/device.rs:463–476  ·  view source on GitHub ↗
(&self, offset: u64, data: &mut [u8])

Source from the content-addressed store, hash-verified

461 }
462
463 fn read_config(&self, offset: u64, data: &mut [u8]) {
464 match offset {
465 0 if data.len() == 8 => LittleEndian::write_u64(data, self.cid),
466 0 if data.len() == 4 => LittleEndian::write_u32(data, (self.cid & 0xffff_ffff) as u32),
467 4 if data.len() == 4 => {
468 LittleEndian::write_u32(data, ((self.cid >> 32) & 0xffff_ffff) as u32);
469 }
470 _ => warn!(
471 "vsock: virtio-vsock received invalid read request of {} bytes at offset {}",
472 data.len(),
473 offset
474 ),
475 }
476 }
477
478 fn activate(&mut self, context: crate::device::ActivationContext) -> ActivateResult {
479 let crate::device::ActivationContext {

Callers 1

test_virtio_deviceFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by 1

test_virtio_deviceFunction · 0.36