Commit 29309860 authored by Antoine Millet's avatar Antoine Millet
Browse files

Set/unset autostart when VM is started/stopped

parent c2ca672d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -155,6 +155,10 @@ class CliHandler(RegisteredCCHandler):
                    except Exception as err:
                        errs.error(vm['id'], str(err))
                    else:
                        if method == 'vm_start':
                            hvclient.vm_action('vm_set_autostart', vm['h'], True)
                        elif method in ('vm_stop', 'vm_destroy'):
                            hvclient.vm_action('vm_set_autostart', vm['h'], False)
                        errs.success(vm['id'], 'ok')
        return errs.get_dict()