@@ -23,7 +23,6 @@ module Vm.Actions
2323 , trashUnusedServiceVms
2424 , createVm , CreateVmPms (.. ), defaultCreateVmPms
2525 , removeVm
26- , restartVm
2726 , startVm
2827 , startVmInternal
2928 , rebootVm
@@ -505,16 +504,11 @@ getVhdReferences vhd = concat <$> (mapM (diskVhdReferences vhd) =<< getVms) wher
505504 references vhd disk = diskPath disk == vhd
506505
507506startVm :: Uuid -> XM ()
508- startVm uuid = _startVm False uuid
509-
510- restartVm :: Uuid -> XM ()
511- restartVm uuid = _startVm True uuid
512-
513- _startVm :: Bool -> Uuid -> XM ()
514- _startVm is_reboot uuid = do
507+ startVm uuid = do
508+ info $ " Starting " ++ show uuid
515509 withPreCreationState uuid $ do
516510 ran <- liftRpc $ runEventScript HardFail uuid getVmRunInsteadofStart [uuidStr uuid]
517- when (not ran) $ startVmInternal uuid is_reboot
511+ when (not ran) $ startVmInternal uuid
518512
519513-- Add a passthrough rule to vm config
520514add_pt_rule_bdf uuid dev = modifyVmPciPtRules uuid $ pciAddRule (form_rule_bdf (show (devAddr dev)))
@@ -523,14 +517,14 @@ form_rule_bdf = rule . fromMaybe (error "error parsing rule") . pciAndSlotFromSt
523517 rule (addr,sl) = PciPtRuleBDF addr sl
524518
525519-- Start a VM! (maybe, because stuff can happen not)
526- startVmInternal :: Uuid -> Bool -> XM ()
527- startVmInternal uuid is_reboot = do
520+ startVmInternal :: Uuid -> XM ()
521+ startVmInternal uuid = do
528522 unlessM (dbExists $ " /vm/" ++ show uuid) $ error (" vm does not have a database entry: " ++ show uuid)
529523 info $ " starting VM " ++ show uuid
530524 liftRpc $ maybePtGpuFuncs uuid
531525 config <- prepareAndCheckConfig uuid
532526 case config of
533- Just c -> info (" done checks for VM " ++ show uuid) >> bootVm c is_reboot
527+ Just c -> info (" done checks for VM " ++ show uuid) >> bootVm c
534528 Nothing -> return ()
535529 where
536530
@@ -833,8 +827,8 @@ checkAndPerformSnapshotIfReq uuid disks = do
833827 _ -> return disk -- other Snapshot types unimplemented for now since UI can't set them
834828
835829
836- bootVm :: VmConfig -> Bool -> XM ()
837- bootVm config reboot
830+ bootVm :: VmConfig -> XM ()
831+ bootVm config
838832 = do
839833 monitor <- vm_monitor <$> xmRunVm uuid vmContext
840834
@@ -1026,7 +1020,7 @@ rebootVm uuid = do
10261020 debug $ " reboot done issuing shutdown to " ++ show uuid
10271021 done <- liftIO $ Xl. waitForState uuid Shutdown (Just 60 )
10281022 debug $ " reboot waitForState returned " ++ show done
1029- when done $ restartVm uuid
1023+ when done $ startVm uuid
10301024
10311025shutdownVm :: Uuid -> Rpc ()
10321026shutdownVm uuid = do
0 commit comments