一、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”,

本文详细介绍了vdagent如何与server进行交互,包括在QEMU中添加VDIPORT设备,安装驱动和vdagent程序,以及通过QEMU监控命令自定义功能。在server端,重点讲解了如何添加命令执行函数,解析并传递命令到spice-server,以及vdagent中处理命令的方法。
最低0.47元/天 解锁文章
2516

被折叠的 条评论
为什么被折叠?



