Removes a vCPU from the guest. The corresponding vCPU thread will be gracefully stopped and joined.
(cpu_id: u32, state: &mut VcpuState)
| 3186 | /// |
| 3187 | /// The corresponding vCPU thread will be gracefully stopped and joined. |
| 3188 | fn remove_vcpu(cpu_id: u32, state: &mut VcpuState) -> Result<()> { |
| 3189 | info!("Removing vCPU: cpu_id = {cpu_id}"); |
| 3190 | state.kill.store(true, Ordering::SeqCst); |
| 3191 | state.signal_thread(); |
| 3192 | state.wait_until_signal_acknowledged()?; |
| 3193 | state.join_thread()?; |
| 3194 | state.handle = None; |
| 3195 | |
| 3196 | // Once the thread has exited, clear the "kill" so that it can reused |
| 3197 | state.kill.store(false, Ordering::SeqCst); |
| 3198 | state.pending_removal.store(false, Ordering::SeqCst); |
| 3199 | |
| 3200 | Ok(()) |
| 3201 | } |
| 3202 | } |
| 3203 | |
| 3204 | impl BusDevice for AcpiCpuHotplugController { |
nothing calls this directly
no test coverage detected