一、vdagent与server交互
- 在server端(qemu/spice)添加VDIPORT设备:
-device virtio-serial-pci, id=virtio-serial0,max_ports=16,bus=pci.0
-chardev spicevmc,name=vdagent,id=vdagent –device virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0
2.在guest安装VDIPORT驱动(PCI驱动);
3.安装vdagent程序。
二、通过vdagent与server交互方式,添加特有功能:
- QEMU:
Vi hmp-commands.hx 添加命令执行函数do_spice_command
格式:
HXCOMM dirty hack to add qemu monitor command for spice server
If defined (CONFIG_SPICE)
{
.name = “spice_command”,
.args_type = “cmd:s,param:s”,
.params = “cmd param”,
.help = “spice commands”,
.user_print = “monitor_user_noop”,
.mhandler.cmd_new =”do_spice_command”,
}
#endif