提交 4813b3f0 编写于 作者: M Marc-André Lureau 提交者: Daniel Veillard

Learn to use spicevmc as a redirection type for usb-redir

上级 162efa1a
...@@ -290,7 +290,8 @@ VIR_ENUM_IMPL(virDomainChrTcpProtocol, VIR_DOMAIN_CHR_TCP_PROTOCOL_LAST, ...@@ -290,7 +290,8 @@ VIR_ENUM_IMPL(virDomainChrTcpProtocol, VIR_DOMAIN_CHR_TCP_PROTOCOL_LAST,
VIR_ENUM_IMPL(virDomainChrSpicevmc, VIR_DOMAIN_CHR_SPICEVMC_LAST, VIR_ENUM_IMPL(virDomainChrSpicevmc, VIR_DOMAIN_CHR_SPICEVMC_LAST,
"vdagent", "vdagent",
"smartcard") "smartcard",
"usbredir")
VIR_ENUM_IMPL(virDomainSmartcard, VIR_DOMAIN_SMARTCARD_TYPE_LAST, VIR_ENUM_IMPL(virDomainSmartcard, VIR_DOMAIN_SMARTCARD_TYPE_LAST,
"host", "host",
...@@ -5513,6 +5514,10 @@ virDomainRedirdevDefParseXML(const xmlNodePtr node, ...@@ -5513,6 +5514,10 @@ virDomainRedirdevDefParseXML(const xmlNodePtr node,
cur = cur->next; cur = cur->next;
} }
if (def->source.chr.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC) {
def->source.chr.data.spicevmc = VIR_DOMAIN_CHR_SPICEVMC_USBREDIR;
}
cleanup: cleanup:
VIR_FREE(bus); VIR_FREE(bus);
VIR_FREE(type); VIR_FREE(type);
......
...@@ -538,6 +538,7 @@ enum virDomainChrTcpProtocol { ...@@ -538,6 +538,7 @@ enum virDomainChrTcpProtocol {
enum virDomainChrSpicevmcName { enum virDomainChrSpicevmcName {
VIR_DOMAIN_CHR_SPICEVMC_VDAGENT, VIR_DOMAIN_CHR_SPICEVMC_VDAGENT,
VIR_DOMAIN_CHR_SPICEVMC_SMARTCARD, VIR_DOMAIN_CHR_SPICEVMC_SMARTCARD,
VIR_DOMAIN_CHR_SPICEVMC_USBREDIR,
VIR_DOMAIN_CHR_SPICEVMC_LAST, VIR_DOMAIN_CHR_SPICEVMC_LAST,
}; };
......
...@@ -5,4 +5,6 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc ...@@ -5,4 +5,6 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M pc
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,multifunction=on,addr=0x4.0x2 \ -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,multifunction=on,addr=0x4.0x2 \
-chardev socket,id=charredir0,host=localhost,port=4000 \ -chardev socket,id=charredir0,host=localhost,port=4000 \
-device usb-redir,chardev=charredir0,id=redir0 \ -device usb-redir,chardev=charredir0,id=redir0 \
-chardev spicevmc,id=charredir1,name=usbredir \
-device usb-redir,chardev=charredir1,id=redir1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,multifunction=on,addr=0x3.0x0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,multifunction=on,addr=0x3.0x0
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
<source mode='connect' host='localhost' service='4000'/> <source mode='connect' host='localhost' service='4000'/>
<protocol type='raw'/> <protocol type='raw'/>
</redirdev> </redirdev>
<redirdev bus='usb' type='spicevmc'>
</redirdev>
<memballoon model='virtio'/> <memballoon model='virtio'/>
</devices> </devices>
</domain> </domain>
...@@ -510,7 +510,8 @@ mymain(void) ...@@ -510,7 +510,8 @@ mymain(void)
DO_TEST("usb-redir", false, DO_TEST("usb-redir", false,
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB, QEMU_CAPS_PCI_MULTIFUNCTION, QEMU_CAPS_USB_HUB,
QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR); QEMU_CAPS_ICH9_USB_EHCI1, QEMU_CAPS_USB_REDIR,
QEMU_CAPS_SPICE, QEMU_CAPS_CHARDEV_SPICEVMC);
DO_TEST("smbios", false, QEMU_CAPS_SMBIOS_TYPE); DO_TEST("smbios", false, QEMU_CAPS_SMBIOS_TYPE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册