how to use domxml-from-native

来源:互联网 发布:java compareto易错点 编辑:程序博客网 时间:2024/05/17 06:12

test


#gedit argv.txt

qemu-system-x86_64 -m 512 -smp 2 drive file=/root/tiny/ubuntu.img -nographic


#virsh domxml-from-native qemu-argv argv.txt > peipei.xml


#cat peipei.xml
<domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>unnamed</name>
  <uuid>63478def-a8f0-446f-8a7d-fa6a8e97281a</uuid>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
  </os>
  <features>
    <acpi/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>qemu-system-x86_64</emulator>
    <controller type='usb' index='0'/>
    <controller type='pci' index='0' model='pci-root'/>
    <memballoon model='none'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='drive'/>
    <qemu:arg value='file=/root/tiny/ubuntu.img'/>
  </qemu:commandline>
</domain>

#virsh define peipei.xml

定义域 unnamed(从 peipei.xml)

#virsh start unnamed

域 unnamed已开始

#

0 0
原创粉丝点击