Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 305035 Details for
Bug 435060
QEMU driver rejects input device bus type of 'xen' with xenner based guests
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Support xen input bus for xenner
xen-input (text/plain), 8.36 KB, created by
Daniel Berrangé
on 2008-05-10 17:26:20 UTC
(
hide
)
Description:
Support xen input bus for xenner
Filename:
MIME Type:
Creator:
Daniel Berrangé
Created:
2008-05-10 17:26:20 UTC
Size:
8.36 KB
patch
obsolete
>diff -r f00771a60241 src/qemu_conf.c >--- a/src/qemu_conf.c Sat May 10 12:57:47 2008 -0400 >+++ b/src/qemu_conf.c Sat May 10 13:00:01 2008 -0400 >@@ -1365,6 +1365,7 @@ > > /* Parse the XML definition for a network interface */ > static int qemudParseInputXML(virConnectPtr conn, >+ struct qemud_vm_def *vm, > struct qemud_vm_input_def *input, > xmlNodePtr node) { > xmlChar *type = NULL; >@@ -1391,26 +1392,46 @@ > } > > if (bus) { >- if (STREQ((const char*)bus, "ps2")) { /* Only allow mouse */ >- if (input->type == QEMU_INPUT_TYPE_TABLET) { >- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, >- _("ps2 bus does not support %s input device"), >- (const char*)type); >- goto error; >- } >- input->bus = QEMU_INPUT_BUS_PS2; >- } else if (STREQ((const char *)bus, "usb")) { /* Allow mouse & keyboard */ >- input->bus = QEMU_INPUT_BUS_USB; >- } else { >- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, >- _("unsupported input bus %s"), (const char*)bus); >- goto error; >- } >- } else { >- if (input->type == QEMU_INPUT_TYPE_MOUSE) >- input->bus = QEMU_INPUT_BUS_PS2; >- else >- input->bus = QEMU_INPUT_BUS_USB; >+ if (STREQ(vm->os.type, "hvm")) { >+ if (STREQ((const char*)bus, "ps2")) { /* Only allow mouse */ >+ if (input->type == QEMU_INPUT_TYPE_TABLET) { >+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, >+ _("ps2 bus does not support %s input device"), >+ (const char*)type); >+ goto error; >+ } >+ input->bus = QEMU_INPUT_BUS_PS2; >+ } else if (STREQ((const char *)bus, "usb")) { /* Allow mouse & tablet */ >+ input->bus = QEMU_INPUT_BUS_USB; >+ } else { >+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, >+ _("unsupported input bus %s"), (const char*)bus); >+ goto error; >+ } >+ } else { >+ if (STREQ((const char *)bus, "xen")) { /* Allow mouse only */ >+ input->bus = QEMU_INPUT_BUS_XEN; >+ if (input->type == QEMU_INPUT_TYPE_TABLET) { >+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, >+ _("xen bus does not support %s input device"), >+ (const char*)type); >+ goto error; >+ } >+ } else { >+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, >+ _("unsupported input bus %s"), (const char*)bus); >+ goto error; >+ } >+ } >+ } else { >+ if (!strcmp(vm->os.type, "hvm")) { >+ if (input->type == QEMU_INPUT_TYPE_MOUSE) >+ input->bus = QEMU_INPUT_BUS_PS2; >+ else >+ input->bus = QEMU_INPUT_BUS_USB; >+ } else { >+ input->bus = QEMU_INPUT_BUS_XEN; >+ } > } > > xmlFree(type); >@@ -1998,7 +2019,7 @@ > "%s", _("failed to allocate space for input string")); > goto error; > } >- if (qemudParseInputXML(conn, input, obj->nodesetval->nodeTab[i]) < 0) { >+ if (qemudParseInputXML(conn, def, input, obj->nodesetval->nodeTab[i]) < 0) { > free(input); > goto error; > } >@@ -2852,7 +2873,7 @@ > > struct qemud_vm_device_def * > qemudParseVMDeviceDef(virConnectPtr conn, >- struct qemud_driver *driver ATTRIBUTE_UNUSED, >+ struct qemud_vm_def *def, > const char *xmlStr) > { > xmlDocPtr xml; >@@ -2880,7 +2901,7 @@ > qemudParseInterfaceXML(conn, &(dev->data.net), node); > } else if (xmlStrEqual(node->name, BAD_CAST "input")) { > dev->type = QEMUD_DEVICE_DISK; >- qemudParseInputXML(conn, &(dev->data.input), node); >+ qemudParseInputXML(conn, def, &(dev->data.input), node); > } else if (xmlStrEqual(node->name, BAD_CAST "sound")) { > dev->type = QEMUD_DEVICE_SOUND; > qemudParseSoundXML(conn, &(dev->data.sound), node); >@@ -3950,14 +3971,15 @@ > > input = def->inputs; > while (input) { >- if (input->bus != QEMU_INPUT_BUS_PS2) >+ if (input->bus == QEMU_INPUT_BUS_USB) > virBufferVSprintf(&buf, " <input type='%s' bus='usb'/>\n", > input->type == QEMU_INPUT_TYPE_MOUSE ? "mouse" : "tablet"); > input = input->next; > } > /* If graphics is enable, add implicit mouse */ > if (def->graphicsType != QEMUD_GRAPHICS_NONE) >- virBufferAddLit(&buf, " <input type='mouse' bus='ps2'/>\n"); >+ virBufferVSprintf(&buf, " <input type='mouse' bus='%s'/>\n", >+ STREQ(def->os.type, "hvm") ? "ps2" : "xen"); > > switch (def->graphicsType) { > case QEMUD_GRAPHICS_VNC: >diff -r f00771a60241 src/qemu_conf.h >--- a/src/qemu_conf.h Sat May 10 12:57:47 2008 -0400 >+++ b/src/qemu_conf.h Sat May 10 13:00:01 2008 -0400 >@@ -189,6 +189,7 @@ > enum qemu_vm_input_bus { > QEMU_INPUT_BUS_PS2, > QEMU_INPUT_BUS_USB, >+ QEMU_INPUT_BUS_XEN, > }; > > struct qemud_vm_input_def { >@@ -474,7 +475,7 @@ > > struct qemud_vm_device_def * > qemudParseVMDeviceDef (virConnectPtr conn, >- struct qemud_driver *driver, >+ struct qemud_vm_def *def, > const char *xmlStr); > > struct qemud_vm_def * >diff -r f00771a60241 src/qemu_driver.c >--- a/src/qemu_driver.c Sat May 10 12:57:47 2008 -0400 >+++ b/src/qemu_driver.c Sat May 10 13:00:01 2008 -0400 >@@ -2516,7 +2516,7 @@ > return -1; > } > >- dev = qemudParseVMDeviceDef(dom->conn, driver, xml); >+ dev = qemudParseVMDeviceDef(dom->conn, vm->def, xml); > if (dev == NULL) { > return -1; > } >diff -r f00771a60241 tests/qemuxml2argvdata/qemuxml2argv-input-xen.args >--- /dev/null Thu Jan 01 00:00:00 1970 +0000 >+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.args Sat May 10 13:00:01 2008 -0400 >@@ -0,0 +1,1 @@ >+/usr/bin/xenner -M xenner -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc :-5901 >\ No newline at end of file >diff -r f00771a60241 tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml >--- /dev/null Thu Jan 01 00:00:00 1970 +0000 >+++ b/tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml Sat May 10 13:00:01 2008 -0400 >@@ -0,0 +1,24 @@ >+<domain type='kvm'> >+ <name>QEMUGuest1</name> >+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> >+ <memory>219200</memory> >+ <currentMemory>219200</currentMemory> >+ <vcpu>1</vcpu> >+ <os> >+ <type>xen</type> >+ <boot dev='hd'/> >+ </os> >+ <clock offset='utc'/> >+ <on_poweroff>destroy</on_poweroff> >+ <on_reboot>restart</on_reboot> >+ <on_crash>destroy</on_crash> >+ <devices> >+ <emulator>/usr/bin/xenner</emulator> >+ <disk type='block' device='disk'> >+ <source dev='/dev/HostVG/QEMUGuest1'/> >+ <target dev='hda' bus='ide'/> >+ </disk> >+ <input type='mouse' bus='xen'/> >+ <graphics type='vnc' port='-1'/> >+ </devices> >+</domain> >diff -r f00771a60241 tests/qemuxml2argvtest.c >--- a/tests/qemuxml2argvtest.c Sat May 10 12:57:47 2008 -0400 >+++ b/tests/qemuxml2argvtest.c Sat May 10 13:00:01 2008 -0400 >@@ -153,10 +153,12 @@ > DO_TEST("disk-floppy", 0); > DO_TEST("disk-many", 0); > DO_TEST("disk-virtio", 1); >+ DO_TEST("disk-xenvbd", 1); > DO_TEST("graphics-vnc", 0); > DO_TEST("graphics-sdl", 0); > DO_TEST("input-usbmouse", 0); > DO_TEST("input-usbtablet", 0); >+ DO_TEST("input-xen", 0); > DO_TEST("misc-acpi", 0); > DO_TEST("misc-no-reboot", 0); > DO_TEST("net-user", 0); >diff -r f00771a60241 tests/qemuxml2xmltest.c >--- a/tests/qemuxml2xmltest.c Sat May 10 12:57:47 2008 -0400 >+++ b/tests/qemuxml2xmltest.c Sat May 10 13:00:01 2008 -0400 >@@ -107,6 +107,7 @@ > DO_TEST("graphics-sdl"); > DO_TEST("input-usbmouse"); > DO_TEST("input-usbtablet"); >+ DO_TEST("input-xen"); > DO_TEST("misc-acpi"); > DO_TEST("misc-no-reboot"); > DO_TEST("net-user");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435060
: 305035