File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,12 @@ impl App {
142142 . app_compose ( )
143143 . context ( "Failed to read compose file" ) ?;
144144 {
145- let mut teapot = self . lock ( ) ;
146- let cid = teapot
145+ let mut states = self . lock ( ) ;
146+ let cid = states
147147 . get ( & vm_id)
148148 . map ( |vm| vm. config . cid )
149149 . or_else ( || cids_assigned. get ( & vm_id) . cloned ( ) )
150- . or_else ( || teapot . cid_pool . allocate ( ) )
150+ . or_else ( || states . cid_pool . allocate ( ) )
151151 . context ( "CID pool exhausted" ) ?;
152152 let vm_config = VmConfig {
153153 manifest,
@@ -163,7 +163,14 @@ impl App {
163163 self . config. cvm. max_disk_size
164164 ) ;
165165 }
166- teapot. add ( VmState :: new ( vm_config) ) ;
166+ match states. get_mut ( & vm_id) {
167+ Some ( vm) => {
168+ vm. config = vm_config. into ( ) ;
169+ }
170+ None => {
171+ states. add ( VmState :: new ( vm_config) ) ;
172+ }
173+ }
167174 } ;
168175 if auto_start && vm_work_dir. started ( ) . unwrap_or_default ( ) {
169176 self . start_vm ( & vm_id) . await ?;
You can’t perform that action at this time.
0 commit comments