我正在尝试类似的东西http://wiki.libvirt.org/page/QEMUSwitchToLibvirt#-s。这是我的 xml 文件:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>rubis_ws</name>
<uuid>1a474ca9-604f-aceb-2fed-792fe1e9f900</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='rhel5.4.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'>
<timer name='pit' tickpolicy='delay'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/root/incremental.img'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
<interface type='bridge'>
<mac address='00:16:3e:98:78:04'/>
<source bridge='br0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
</video>
</devices>
<qemu:commandline>
<qemu:arg value='-s'/>
</qemu:commandline>
</domain>
我从这个 xml 文件启动虚拟机。现在当我执行“ps aux | grep rubis”时,我得到:
根 13496 59.1 3.5 1266168 292112? Sl 16:50 0:23 /usr/libexec/qemu-kvm -S -M rhel5.4.0 -m 1024 -smp 2,sockets=2,cores=1,threads=1 -name rubis_ws -uuid 1a474ca9-604f-aceb-2fed-792fe1e9f900 -monitor unix:/var/lib/libvirt/qemu/rubis_ws.monitor,server,nowait -no-kvm-pit-reinjection -boot c -drive file=/root/incremental.img,if=ide,bus=0,unit=0,boot=on,format=qcow2,cache=none -net nic,macaddr=00:16:3e:98:78:04,vlan=0 -net tap,fd=18,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -k en-us -vga cirrus -balloon virtio
root 13531 0.0 0.0 61192 760 pts/5 S+ 16:51 0:00 grep rubis
我找不到该命令中的 -s。您能否告诉我我是否犯了错误。我被这个问题困扰了很长时间,却不知道如何解决它。我的最终目标是使这个命令参数起作用,并使用 qemu 命令行参数和 libvirt 将其用于 -incoming 标签。
感谢您的帮助。
- 问候,Sethu
答案1
你在哪个发行版上执行此操作?可能是你的 libvirt 版本太旧,无法支持此选项