(
tmp_dir: &TempDir,
blk_img: &str,
num_queues: usize,
rdonly: bool,
direct: bool,
)
| 138 | } |
| 139 | |
| 140 | pub(crate) fn prepare_vubd( |
| 141 | tmp_dir: &TempDir, |
| 142 | blk_img: &str, |
| 143 | num_queues: usize, |
| 144 | rdonly: bool, |
| 145 | direct: bool, |
| 146 | ) -> (std::process::Child, String) { |
| 147 | let mut workload_path = dirs::home_dir().unwrap(); |
| 148 | workload_path.push("workloads"); |
| 149 | |
| 150 | let mut blk_file_path = workload_path; |
| 151 | blk_file_path.push(blk_img); |
| 152 | let blk_file_path = String::from(blk_file_path.to_str().unwrap()); |
| 153 | |
| 154 | let vubd_socket_path = String::from(tmp_dir.as_path().join("vub.sock").to_str().unwrap()); |
| 155 | |
| 156 | // Start the daemon |
| 157 | let child = Command::new(clh_command("vhost_user_block")) |
| 158 | .args([ |
| 159 | "--block-backend", |
| 160 | format!( |
| 161 | "path={blk_file_path},socket={vubd_socket_path},num_queues={num_queues},readonly={rdonly},direct={direct}" |
| 162 | ) |
| 163 | .as_str(), |
| 164 | ]) |
| 165 | .spawn() |
| 166 | .unwrap(); |
| 167 | |
| 168 | thread::sleep(std::time::Duration::new(10, 0)); |
| 169 | |
| 170 | (child, vubd_socket_path) |
| 171 | } |
| 172 | |
| 173 | pub(crate) fn temp_vsock_path(tmp_dir: &TempDir) -> String { |
| 174 | String::from(tmp_dir.as_path().join("vsock").to_str().unwrap()) |
nothing calls this directly
no test coverage detected