⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 11_block_attach_shared_dom0.py

📁 xen虚拟机源代码安装包
💻 PY
字号:
#!/usr/bin/python# Copyright (C) International Business Machines Corp., 2005# Author: Dan Smith <danms@us.ibm.com>from XmTestLib import *if ENABLE_HVM_SUPPORT:    SKIP("Block-attach not supported for HVM domains")# Mount /dev/ram0s, o = traceCommand("mkfs /dev/ram0")if s != 0:    FAIL("Unable to mkfs /dev/ram0")s, o = traceCommand("mkdir -p mnt");if s != 0:    FAIL("Unable to create ./mnt")s, o = traceCommand("mount /dev/ram0 mnt -o rw")if s != 0:    FAIL("Unable to mount /dev/ram0 on ./mnt")# Now try to start a DomU with write access to /dev/ram0config = {"disk":"phy:/dev/ram0,xvda1,w"}domain = XmTestDomain(extraConfig=config);try:    domain.start()    s, o = traceCommand("umount mnt")    FAIL("Bug #331: Started a DomU with write access to a rw mounted block device")except DomainError, e:    s, o = traceCommand("umount mnt")domain.destroy()

⌨️ 快捷键说明

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