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

Method new

vhost_user_block/src/lib.rs:99–115  ·  view source on GitHub ↗
(
        disk_image: Arc<Mutex<RawFile>>,
        serial: Vec<u8>,
        disk_nsectors: u64,
        writeback: Arc<AtomicBool>,
        mem: GuestMemoryAtomic<GuestMemoryMmap>,
    )

Source from the content-addressed store, hash-verified

97
98impl VhostUserBlkThread {
99 fn new(
100 disk_image: Arc<Mutex<RawFile>>,
101 serial: Vec<u8>,
102 disk_nsectors: u64,
103 writeback: Arc<AtomicBool>,
104 mem: GuestMemoryAtomic<GuestMemoryMmap>,
105 ) -> Result<Self> {
106 Ok(VhostUserBlkThread {
107 disk_image,
108 serial,
109 disk_nsectors,
110 event_idx: false,
111 kill_evt: EventFd::new(EFD_NONBLOCK).map_err(Error::CreateKillEventFd)?,
112 writeback,
113 mem,
114 })
115 }
116
117 fn process_queue(
118 &mut self,

Callers

nothing calls this directly

Calls 8

newFunction · 0.85
build_serialFunction · 0.85
openMethod · 0.80
readMethod · 0.45
writeMethod · 0.45
seekMethod · 0.45
cloneMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected