ping...

On 2014年04月09日 16:18, Li Zhang wrote:
From: Li Zhang <zhlci...@linux.vnet.ibm.com>

PPC64 prefers to set pci-ohci controller as default USB controller.
Currently, libvirt is using legacy USB controller as default. There
are problems with VGA which can't work correctly with USB Keyboard and
USB Mouse.

While providing -nodefaults, ppc64 should be specifying the usb
controller explicitly in place of using the legacy
controller(-usb). Qemu spapr initialization code when sees "-usb" adds a
USB Keyboard and USB Mouse by default. And libvirt has added a USB
keyboard and USB mouse.

A recent fix in the in qemu VGA code uncoverd this problem, which
resulted in addition of extra keyboard and mouse to the qemu machine.

This patch is to set pci-ohci as USB default controller.

Signed-off-by: Li Zhang <zhlci...@linux.vnet.ibm.com>
---
  v2 -> v1:
   * Rephrase the commit message. (Nikunj A Dadhania)

  src/qemu/qemu_command.c                                      | 5 +++--
  tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args | 2 +-
  2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 379c094..46e851a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8466,8 +8466,9 @@ qemuBuildCommandLine(virConnectPtr conn,
                  } else if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
                             cont->model == -1 &&
                             !qemuDomainMachineIsQ35(def) &&
-                           (!virQEMUCapsGet(qemuCaps, 
QEMU_CAPS_PIIX3_USB_UHCI) ||
-                            def->os.arch == VIR_ARCH_PPC64)) {
+                           (!virQEMUCapsGet(qemuCaps, 
QEMU_CAPS_PIIX3_USB_UHCI) ||
+                            (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI) &&
+                             def->os.arch == VIR_ARCH_PPC64))) {
                      if (usblegacy) {
                          virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                         _("Multiple legacy USB controllers are 
"
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args 
b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
index 3a21b76..eac7c56 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-default.args
@@ -3,5 +3,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test 
QEMU_AUDIO_DRV=none \
  -nographic -nodefconfig -nodefaults \
  -chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
  -mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \
--usb -chardev pty,id=charserial0 \
+-device pci-ohci,id=usb,bus=pci,addr=0x1 -chardev pty,id=charserial0 \
  -device spapr-vty,chardev=charserial0,reg=0x30000000

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to