手机版
你好,游客 登录 注册
背景:
阅读新闻

用C++编程调用libvirt的API来创建KVM虚拟机

[日期:2013-08-23] 来源:Linux社区  作者:蒋国宝 [字体:大 中 小]

3. 附stand.xml文件内容

<domain type='kvm'>
 <name>rheltest3</name>
 <uuid>32b95fab-6d78-4e28-beca-2d3988ff8c8f</uuid>
 <memory unit='KiB'>1048576</memory>
 <currentMemory unit='KiB'>1048576</currentMemory>
 <vcpu placement='static'>1</vcpu>
 <os>
  <type arch='x86_64' machine='pc-1.2'>hvm</type>
  <boot dev='hd'/>
  <boot dev='cdrom'/>
 </os>
 <features>
  <acpi/>
  <apic/>
  <pae/>
 </features>
 <clock offset='utc'/>
 <on_poweroff>destroy</on_poweroff>
 <on_reboot>restart</on_reboot>
 <on_crash>restart</on_crash>
 <devices>
  <emulator>/usr/bin/qemu</emulator>
  <disk type='file' device='disk'>
   <driver name='qemu' type='qcow2'/>
   <source file='/home/lisp/code/auto-rhel/virt/rheltest3.img'/>
   <target dev='hda' bus='ide'/>
   <address type='drive' controller='0' buss='0' target='0' unit='0'/>
  </disk>
  <disk type='file' device='cdrom'>
   <driver name='qemu' type='raw'/>
   <source file='/home/lisp/code/auto-rhel/rhelcustom.iso'/>
   <target dev='hdc' bus='ide'/>
   <readonly/>
  </disk>
  <controller type='usb' index='0'>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
  </controller>
  <controller type='ide' index='0'>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
  </controller>
  <interface type='bridge'>
   <mac address='52:54:00:78:f9:98'/>
   <source bridge='virbr0'/>
   <model type='virtio'/>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
  </interface>
  <input type='mouse' bus='ps2'/>
  <graphics type='vnc' port='-1' autoprot='yes'/>
  <memballoon model='virtio'>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
  </memballoon>
 </devices>
</domain>

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款