virtualbox.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:AerisCloud 作者: AerisCloud 项目源码 文件源码
def vm_suspend(name):
    """
    Save the state of a running VM, raises an InvalidState exception
    if the VM is not in a state where it can be saved
    :param name: str
    :return: None
    """
    try:
        VBoxManage('controlvm', name, 'savestate')
    except ErrorReturnCode_1 as e:
        # if the VM was not found
        if 'VBOX_E_OBJECT_NOT_FOUND' in e.stderr:
            raise VMNotFound(name)
        if 'Machine in invalid state' in e.stderr:
            raise InvalidState(e.stderr[17:])
        # something else happened, just let it go
        raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号