From 340ab1c91c71b029309e3a03af375ac0ad2616b4 Mon Sep 17 00:00:00 2001 From: Dipankar Sarma Date: Tue, 19 Jun 2012 15:51:47 +0530 Subject: [PATCH] Fix default USB controller for ppc64 Fix the default usb controller for pseries systems if none specified. Signed-off-by: Dipankar Sarma (cherry picked from commit d1778b71480ff76e22be3ab47936b919deb27145) --- AUTHORS | 1 + src/qemu/qemu_command.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 068f24beaa..9efac2e29f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -236,6 +236,7 @@ Patches have also been contributed by: Radu Caragea Beat Jörg Gao feng + Dipankar Sarma [....send patches to get your name here....] diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 55e772fd1c..af5ff5b929 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2555,7 +2555,8 @@ qemuControllerModelUSBToCaps(int model) static int -qemuBuildUSBControllerDevStr(virDomainControllerDefPtr def, +qemuBuildUSBControllerDevStr(virDomainDefPtr domainDef, + virDomainControllerDefPtr def, virBitmapPtr qemuCaps, virBuffer *buf) { @@ -2564,8 +2565,12 @@ qemuBuildUSBControllerDevStr(virDomainControllerDefPtr def, model = def->model; - if (model == -1) - model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + if (model == -1) { + if (STREQ(domainDef->os.arch, "ppc64")) + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; + else + model = VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI; + } smodel = qemuControllerModelUSBTypeToString(model); caps = qemuControllerModelUSBToCaps(model); @@ -2651,7 +2656,7 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef, break; case VIR_DOMAIN_CONTROLLER_TYPE_USB: - if (qemuBuildUSBControllerDevStr(def, qemuCaps, &buf) == -1) + if (qemuBuildUSBControllerDevStr(domainDef, def, qemuCaps, &buf) == -1) goto error; if (nusbcontroller)