Skip to content
Snippets Groups Projects
Commit e683dcf1 authored by Florent Gluck's avatar Florent Gluck
Browse files

usb-redirection working! Woohoo :-)

parent 66529627
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string, ...@@ -54,7 +54,7 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string,
if len(usbDevs) > 0 { if len(usbDevs) > 0 {
// A qemu-xhci device is required // A qemu-xhci device is required
usb = append(usb, "-device qemu-xhci") usb = append(usb, "-device", "qemu-xhci")
// Generate the USB devices' filter list, for instance: // Generate the USB devices' filter list, for instance:
// "-1:0x0781:0x5567:-1:1|-1:0x067b:0x2303:-1:1|-1:-1:-1:-1:0" // "-1:0x0781:0x5567:-1:1|-1:0x067b:0x2303:-1:1|-1:-1:-1:-1:0"
...@@ -71,10 +71,8 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string, ...@@ -71,10 +71,8 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string,
// Generate QEMU's arguments for the USB devices // Generate QEMU's arguments for the USB devices
for i, _ := range usbDevs { for i, _ := range usbDevs {
idx := strconv.Itoa(i+1) idx := strconv.Itoa(i+1)
usb = append(usb, "-chardev") usb = append(usb, "-chardev", "spicevmc,name=usbredir,id=usbredir"+idx)
usb = append(usb, "spicevmc,name=usbredir,id=usbredir"+idx) usb = append(usb, "-device", "usb-redir,filter="+filter.String()+",chardev=usbredir"+idx)
usb = append(usb, "-device")
usb = append(usb, "usb-redir,filter='"+filter.String()+"',chardev=usbredir"+idx)
} }
} }
...@@ -99,9 +97,8 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string, ...@@ -99,9 +97,8 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string,
// QEMU Guest Agent // QEMU Guest Agent
args = append(args, "-device", "virtio-serial", "-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0", "-chardev", "socket,path="+qgaSock+",server=on,wait=off,id=qga0") args = append(args, "-device", "virtio-serial", "-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0", "-chardev", "socket,path="+qgaSock+",server=on,wait=off,id=qga0")
// USB redirection // USB redirection
for _, u := range usb { args = append(args, usb...)
args = append(args, u)
}
// Sound support // Sound support
// args = append(args, "-soundhw", "hda") // args = append(args, "-soundhw", "hda")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment