01_save_basic_pos.py

来自「xen虚拟机源代码安装包」· Python 代码 · 共 38 行

PY
38
字号
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Dan Smith <danms@us.ibm.com>import timefrom XmTestLib import *if ENABLE_HVM_SUPPORT:    SKIP("Save currently not supported for HVM domains")domain = XmTestDomain()try:    console = domain.start()except DomainError, e:    if verbose:        print "Failed to create test domain because:"        print e.extra    FAIL(str(e))domain.closeConsole()# Save it outtry:    s, o = traceCommand("xm save %s /tmp/test.state" % domain.getName(),                        timeout=30)except TimeoutError, e:    FAIL(str(e))    if s != 0:    FAIL("save command exited %i != 0" % s)# Make sure it's goneif isDomainRunning(domain.getName()):    FAIL("Domain still running after save!")

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?