File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,14 @@ impl VmMachineRunningOps for VmMachineRunning {
1818 type Stopping = VmStatusStopping ;
1919
2020 fn stop ( self ) -> Self :: Stopping {
21- Self :: Stopping { }
21+ Self :: Stopping {
22+ vmspace : self . common . vmspace ,
23+ }
2224 }
2325}
2426
25- pub struct VmStatusStopping { }
27+ pub struct VmStatusStopping {
28+ vmspace : VmAddrSpace ,
29+ }
2630
2731impl VmMachineStoppingOps for VmStatusStopping { }
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ impl VmDataInner {
4141 VmMachineState :: Running ( running) => {
4242 let stopping = running. stop ( ) ;
4343 * status_guard = VmMachineState :: Stopping ( stopping) ;
44+ self . status . store ( VMStatus :: Stopping ) ;
4445 Ok ( ( ) )
4546 }
4647 other => {
@@ -51,7 +52,7 @@ impl VmDataInner {
5152 }
5253
5354 pub fn wait ( & self ) -> anyhow:: Result < ( ) > {
54- while self . is_active ( ) {
55+ while ! matches ! ( self . status ( ) , VMStatus :: Stopped ) {
5556 std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 50 ) ) ;
5657 }
5758 self . run_result ( )
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ impl VmMachineRunningCommon {
6767 }
6868 waiter. running_cpu_count . fetch_sub ( 1 , Ordering :: SeqCst ) ;
6969 if waiter. running_cpu_count . load ( Ordering :: SeqCst ) == 0 {
70+ info ! ( "All vCPUs have exited, VM set stopped." ) ;
7071 waiter. vm . set_stopped ( ) ;
7172 }
7273 } )
You can’t perform that action at this time.
0 commit comments