summaryrefslogtreecommitdiff
path: root/hw/input
AgeCommit message (Collapse)AuthorFilesLines
2016-02-11Adds keycode 86 to the hid_usage_keys translation table.Daniel Serpell1-1/+1
This key is present in international keyboards, between left shift and the 'Z' key, ant is described in the HID usage tables as "Keyboard Non-US \ and |": http://www.usb.org/developers/hidpage/Hut1_12v2.pdf This patch fixes the usb-kbd devices. Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-02-06virtio: move allocation to virtqueue_pop/vring_popPaolo Bonzini1-8/+16
The return code of virtqueue_pop/vring_pop is unused except to check for errors or 0. We can thus easily move allocation inside the functions and just return a pointer to the VirtQueueElement. The advantage is that we will be able to allocate only the space that is needed for the actual size of the s/g list instead of the full VIRTQUEUE_MAX_SIZE items. Currently VirtQueueElement takes about 48K of memory, and this kind of allocation puts a lot of stress on malloc. By cutting the size by two or three orders of magnitude, malloc can use much more efficient algorithms. The patch is pretty large, but changes to each device are testable more or less independently. Splitting it would mostly add churn. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2016-01-29hw: Clean up includesPeter Maydell6-0/+6
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-38-git-send-email-peter.maydell@linaro.org
2016-01-29arm devices: Clean up includesPeter Maydell2-0/+2
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-36-git-send-email-peter.maydell@linaro.org
2016-01-29virtio: Clean up includesPeter Maydell3-0/+3
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-15-git-send-email-peter.maydell@linaro.org
2016-01-29arm: Clean up includesPeter Maydell3-0/+3
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-13-git-send-email-peter.maydell@linaro.org
2016-01-29lm32: Clean up includesPeter Maydell1-0/+1
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1453832250-766-5-git-send-email-peter.maydell@linaro.org
2015-12-17qapi: Change munging of CamelCase enum valuesEric Blake3-6/+6
When munging enum values, the fact that we were passing the entire prefix + value through camel_to_upper() meant that enum values spelled with CamelCase could be turned into CAMEL_CASE. However, this provides a potential collision (both OneTwo and One-Two would munge into ONE_TWO) for enum types, when the same two names are valid side-by-side as QAPI member names. By changing the generation of enum constants to always be prefix + '_' + c_name(value, False).upper(), and ensuring that there are no case collisions (in the next patches), we no longer have to worry about names that would be distinct as QAPI members but collide as variant tag names, without having to think about what munging the heuristics in camel_to_upper() will actually perform on an enum value. Making the change will affect enums that did not follow coding conventions, using 'CamelCase' rather than desired 'lower-case'. Thankfully, there are only two culprits: InputButton and ErrorClass. We already tweaked ErrorClass to make it an alias of QapiErrorClass, where only the alias needs changing rather than the whole tree. So the bulk of this change is modifying INPUT_BUTTON_WHEEL_UP to the new INPUT_BUTTON_WHEELUP (and likewise for WHEELDOWN). That part of this commit may later need reverting if we rename the enum constants from 'WheelUp' to 'wheel-up' as part of moving x-input-send-event to a stable interface; but at least we have documentation bread crumbs in place to remind us (commit 513e7cd), and it matches the fact that SDL constants are also spelled SDL_BUTTON_WHEELUP. Suggested by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1447836791-369-27-git-send-email-eblake@redhat.com> [Commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-12-17qapi: Don't let implicit enum MAX member collideEric Blake3-6/+6
Now that we guarantee the user doesn't have any enum values beginning with a single underscore, we can use that for our own purposes. Renaming ENUM_MAX to ENUM__MAX makes it obvious that the sentinel is generated. This patch was mostly generated by applying a temporary patch: |diff --git a/scripts/qapi.py b/scripts/qapi.py |index e6d014b..b862ec9 100644 |--- a/scripts/qapi.py |+++ b/scripts/qapi.py |@@ -1570,6 +1570,7 @@ const char *const %(c_name)s_lookup[] = { | max_index = c_enum_const(name, 'MAX', prefix) | ret += mcgen(''' | [%(max_index)s] = NULL, |+// %(max_index)s | }; | ''', | max_index=max_index) then running: $ cat qapi-{types,event}.c tests/test-qapi-types.c | sed -n 's,^// \(.*\)MAX,s|\1MAX|\1_MAX|g,p' > list $ git grep -l _MAX | xargs sed -i -f list The only things not generated are the changes in scripts/qapi.py. Rejecting enum members named 'MAX' is now useless, and will be dropped in the next patch. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> [Rebased to current master, commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-11-06hw/input/tsc210x: Remove superfluous memsetThomas Huth1-6/+2
g_malloc0 already clears the memory, so no need for additional memsets here. And while we're at it, let's also remove the superfluous typecasts for the return values of g_malloc0 and use the type-safe g_new0 instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-11-02input: Convert to new qapi union layoutEric Blake3-41/+42
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This leads to spurious collisions if a tag value matches a non-variant member's name. Make the conversion to the new layout for input-related code. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1445898903-12082-20-git-send-email-eblake@redhat.com> [Commit message tweaked slightly] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-10-23adb: add to input categoryLaurent Vivier1-0/+2
The Apple Desktop Bus is used to connect a keyboard and a mouse, so add it to the input category. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-10-20virtio-input: ignore events until the guest driver is readyGerd Hoffmann1-0/+4
Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-10-09virtio-input: Fix device introspection on non-Linux hostsMarkus Armbruster1-1/+1
When CONFIG_LINUX is off, devices "virtio-keyboard-device", "virtio-mouse-device", "virtio-tablet-device" and "virtio-input-host-device" aren't compiled in, yet "virtio-keyboard-pci", "virtio-mouse-pci", "virtio-tablet-pci" and "virtio-input-host-pci" still are. Attempts to introspect them crash, e.g. $ qemu-system-x86_64 -device virtio-tablet-pci,help ** ERROR:/work/armbru/qemu/qom/object.c:333:object_initialize_with_type: assertion failed: (type != NULL) Broken in commit 710e2d9 and commit 006a5ed. Fix by compiling the "virtio-FOO-pci" exactly when compiling the "virtio-FOO-device": compile "virtio-keyboard-device", "virtio-mouse-device", "virtio-tablet-device" regardless of CONFIG_LINUX, and compile "virtio-input-host-pci" only for CONFIG_LINUX. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <1444320700-26260-3-git-send-email-armbru@redhat.com>
2015-09-18Fix bad error handling after memory_region_init_ram()Markus Armbruster1-2/+2
Symptom: $ qemu-system-x86_64 -m 10000000 Unexpected error in ram_block_add() at /work/armbru/qemu/exec.c:1456: upstream-qemu: cannot set up guest memory 'pc.ram': Cannot allocate memory Aborted (core dumped) Root cause: commit ef701d7 screwed up handling of out-of-memory conditions. Before the commit, we report the error and exit(1), in one place, ram_block_add(). The commit lifts the error handling up the call chain some, to three places. Fine. Except it uses &error_abort in these places, changing the behavior from exit(1) to abort(), and thus undoing the work of commit 3922825 "exec: Don't abort when we can't allocate guest memory". The three places are: * memory_region_init_ram() Commit 4994653 (right after commit ef701d7) lifted the error handling further, through memory_region_init_ram(), multiplying the incorrect use of &error_abort. Later on, imitation of existing (bad) code may have created more. * memory_region_init_ram_ptr() The &error_abort is still there. * memory_region_init_rom_device() Doesn't need fixing, because commit 33e0eb5 (soon after commit ef701d7) lifted the error handling further, and in the process changed it from &error_abort to passing it up the call chain. Correct, because the callers are realize() methods. Fix the error handling after memory_region_init_ram() with a Coccinelle semantic patch: @r@ expression mr, owner, name, size, err; position p; @@ memory_region_init_ram(mr, owner, name, size, ( - &error_abort + &error_fatal | err@p ) ); @script:python@ p << r.p; @@ print "%s:%s:%s" % (p[0].file, p[0].line, p[0].column) When the last argument is &error_abort, it gets replaced by &error_fatal. This is the fix. If the last argument is anything else, its position is reported. This lets us check the fix is complete. Four positions get reported: * ram_backend_memory_alloc() Error is passed up the call chain, ultimately through user_creatable_complete(). As far as I can tell, it's callers all handle the error sanely. * fsl_imx25_realize(), fsl_imx31_realize(), dp8393x_realize() DeviceClass.realize() methods, errors handled sanely further up the call chain. We're good. Test case again behaves: $ qemu-system-x86_64 -m 10000000 qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory [Exit 1 ] The next commits will repair the rest of commit ef701d7's damage. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1441983105-26376-3-git-send-email-armbru@redhat.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
2015-09-11typofixes - v4Veres Lajos1-1/+1
Signed-off-by: Veres Lajos <vlajos@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-09-07arm: Use g_new() & friends where that makes obvious senseMarkus Armbruster1-2/+2
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. This commit only touches allocations with size arguments of the form sizeof(T). Coccinelle semantic patch: @@ type T; @@ -g_malloc(sizeof(T)) +g_new(T, 1) @@ type T; @@ -g_try_malloc(sizeof(T)) +g_try_new(T, 1) @@ type T; @@ -g_malloc0(sizeof(T)) +g_new0(T, 1) @@ type T; @@ -g_try_malloc0(sizeof(T)) +g_try_new0(T, 1) @@ type T; expression n; @@ -g_malloc(sizeof(T) * (n)) +g_new(T, n) @@ type T; expression n; @@ -g_try_malloc(sizeof(T) * (n)) +g_try_new(T, n) @@ type T; expression n; @@ -g_malloc0(sizeof(T) * (n)) +g_new0(T, n) @@ type T; expression n; @@ -g_try_malloc0(sizeof(T) * (n)) +g_try_new0(T, n) @@ type T; expression p, n; @@ -g_realloc(p, sizeof(T) * (n)) +g_renew(T, p, n) @@ type T; expression p, n; @@ -g_try_realloc(p, sizeof(T) * (n)) +g_try_renew(T, p, n) @@ type T; expression n; @@ -(T *)g_new(T, n) +g_new(T, n) @@ type T; expression n; @@ -(T *)g_new0(T, n) +g_new0(T, n) @@ type T; expression p, n; @@ -(T *)g_renew(T, p, n) +g_renew(T, p, n) Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1440524394-15640-1-git-send-email-armbru@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-07-27virtio: get_features() can failJason Wang1-1/+2
Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
2015-07-17hid: clarify hid_keyboard_process_keycodePaolo Bonzini1-4/+28
Coverity thinks the fallthroughs are smelly. They are correct, but everything else in this function is like "wut?". Refer explicitly to bits 8 and 9 of hs->kbd.modifiers instead of shifting right first and using (1 << 7). Document what the scancode is when hid_code is 0xe0. And add plenty of comments. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-07-16virtio-input: move sys/ioctl.h includeGerd Hoffmann1-0/+1
Drop from include/standard-headers/linux/input.h Add to hw/input/virtio-input-host.c instead. That allows to build virtio-input (except pass-through) on windows. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-07-16virtio-input: fix segfault in virtio_input_hid_propertiesLin Ma1-0/+1
commit 5cce173 introduced virtio-input segfault, This patch fixes it. Signed-off-by: Lin Ma <lma@suse.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-07-03virtio-input: add input routing supportGerd Hoffmann1-0/+11
Add display and head properties for input routing to virtio-input devices, update multiseat documentation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-06-23virtio-input: evdev passthroughGerd Hoffmann2-0/+189
This allows to assign host input devices to the guest: qemu -device virtio-input-host-pci,evdev=/dev/input/event<nr> The guest gets exclusive access to the input device, so be careful with assigning the keyboard if you have only one connected to your machine. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-06-23virtio-input: move properties, use virtio_instance_init_commonGerd Hoffmann1-1/+7
Move properties from virtio-*-pci to virtio-*-device. Also make better use of QOM and attach common properties to the abstract parent classes (virtio-input-device and virtio-input-pci-device). Switch the hid device instance init functions over to use virtio_instance_init_common, so we get the properties of the virtio device aliased properly to the virtio pci proxy. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-06-12migration: Use normal VMStateDescriptions for SubsectionsJuan Quintela2-19/+14
We create optional sections with this patch. But we already have optional subsections. Instead of having two mechanism that do the same, we can just generalize it. For subsections we just change: - Add a needed function to VMStateDescription - Remove VMStateSubsection (after removal of the needed function it is just a VMStateDescription) - Adjust the whole tree, moving the needed function to the corresponding VMStateDescription Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-06-01virtio: make features 64bit wideGerd Hoffmann1-1/+1
Make features 64bit wide everywhere. On migration a full 64bit guest_features field is sent if one of the high bits is set, in addition to the lower 32bit guest_features field which must stay for compatibility reasons. That way we send the lower 32 feature bits twice, but the code is simpler because we don't have to split and compose the 64bit features into two 32bit fields. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-05-29virtio-input: emulated devices [device]Gerd Hoffmann2-0/+503
This patch adds the virtio-input-hid base class and virtio-{keyboard,mouse,tablet} subclasses building on the base class. They are hooked up to the qemu input core and deliver input events to the guest like all other hid devices (ps/2 kbd, usb tablet, ...). Using them is as simple as adding "-device virtio-tablet-device" to your command line, for use all transports except pci. virtio-pci support comes as separate patch, once virtio-pci got virtio 1.0 support. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-05-29virtio-input: core code & base class [device]Gerd Hoffmann2-0/+286
This patch adds virtio-input support to qemu. It brings a abstract base class providing core support, other classes can build on it to actually implement input devices. virtio-input basically sends linux input layer events (evdev) over virtio. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-03-09adb.c: include ADBDevice parent state in KBDState and MouseStateMark Cave-Ayland1-4/+18
The parent ADBDevice contains the device id on the ADB bus. Make sure that this state is included in both its subclasses since some clients (such as OpenBIOS) reprogram each device id after enumeration. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Alexander Graf <agraf@suse.de>
2015-02-10Add trace to ps2.c.Don Koch1-0/+16
Signed-off-by: Don Koch <dkoch@verizon.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2015-01-26vmstate: accept QEMUTimer in VMSTATE_TIMER*, add VMSTATE_TIMER_PTR*Paolo Bonzini1-1/+1
Old users of VMSTATE_TIMER* are mechanically changed to VMSTATE_TIMER_PTR variants. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-01-22hw/input/hid.c Fix capslock hid codeDinar Valeev1-1/+1
When ever USB keyboard is used, e.g. '-usbdevice keyboard' pressing caps lock key send 0x32 hid code, which is treated as backslash. Instead it should be 0x39 code. This affects sending uppercase keys, as they typed whith caps lock active. While on x86 this can be workarounded by using ps/2 protocol. On Power it is crusial as we don't have anything else than USB. This is fixes guest automation tasts over vnc. Signed-off-by: Dinar Valeev <dvaleev@suse.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2015-01-22hid: handle full ptr queues in post_loadGerd Hoffmann1-0/+21
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
2015-01-09Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell1-2/+8
More migration fixes and more record/replay preparations. Also moves the sdhci-pci device id to make space for the rocker device. # gpg: Signature made Sat 03 Jan 2015 08:22:36 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: pci: move REDHAT_SDHCI device ID to make room for Rocker block/iscsi: fix uninitialized variable pckbd: set bits 2-3-6-7 of the output port by default serial: refine serial_thr_ipending_needed gen-icount: check cflags instead of use_icount global translate: check cflags instead of use_icount global cpu-exec: add a new CF_USE_ICOUNT cflag target-ppc: pass DisasContext to SPR generator functions atomic: fix position of volatile qualifier Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-01-03pckbd: set bits 2-3-6-7 of the output port by defaultPaolo Bonzini1-2/+8
OSes typically write 0xdd/0xdf to turn the A20 line off and on. This has bits 2-3-6-7 on, so that the output port subsection is migrated. Change the reset value and migration default to include those four bits, thus avoiding that the subsection is migrated. This strictly speaking changes guest ABI, but the long time during which we have not migrated the value means that the guests really do not care much; so the change is for all machine types. Reported-by: Igor Mammedov <imammedo@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-29milkymist: softmmu: fix event handlingMichael Walle1-7/+12
Keys which send more than one scancode (esp. windows key) weren't handled correctly since commit 1ff5eedd. Two events were put into the input event queue but only one was processed. This fixes this by fetching all pending events in the callback handler. Signed-off-by: Michael Walle <michael@walle.cc> Cc: Gerd Hoffmann <kraxel@redhat.com>
2014-09-29hw/input/tsc210x.c: Delete unused array tsc2101_ratesPeter Maydell1-30/+0
The array tsc2101_rates[] is unused (and we don't implement the TSC2101 anyway, only the 2102); delete it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1410723223-17711-5-git-send-email-peter.maydell@linaro.org
2014-09-11pckbd: adding new fields to vmstatePavel Dovgalyuk1-0/+51
This patch adds outport to VMState to allow correct saving and restoring the state of PC keyboard controller. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-09memory: add parameter errp to memory_region_init_ramHu Tao1-2/+2
Add parameter errp to memory_region_init_ram and update all call sites to pass in &error_abort. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-09-02Fix debug print warningGonglei1-2/+2
Steps: 1.enable qemu debug print, using simply scprit as below: grep "//#define DEBUG" * -rl | xargs sed -i "s/\/\/#define DEBUG/#define DEBUG/g" 2. make -j 3. get some warning: hw/i2c/pm_smbus.c: In function 'smb_ioport_writeb': hw/i2c/pm_smbus.c:142: warning: format '%04x' expects type 'unsigned int', but argument 2 has type 'hwaddr' hw/i2c/pm_smbus.c:142: warning: format '%02x' expects type 'unsigned int', but argument 3 has type 'uint64_t' hw/i2c/pm_smbus.c: In function 'smb_ioport_readb': hw/i2c/pm_smbus.c:209: warning: format '%04x' expects type 'unsigned int', but argument 2 has type 'hwaddr' hw/intc/i8259.c: In function 'pic_ioport_read': hw/intc/i8259.c:373: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'hwaddr' hw/input/pckbd.c: In function 'kbd_write_command': hw/input/pckbd.c:232: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'uint64_t' hw/input/pckbd.c: In function 'kbd_write_data': hw/input/pckbd.c:333: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'uint64_t' hw/isa/apm.c: In function 'apm_ioport_writeb': hw/isa/apm.c:44: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'hwaddr' hw/isa/apm.c:44: warning: format '%02x' expects type 'unsigned int', but argument 3 has type 'uint64_t' hw/isa/apm.c: In function 'apm_ioport_readb': hw/isa/apm.c:67: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'hwaddr' hw/timer/mc146818rtc.c: In function 'cmos_ioport_write': hw/timer/mc146818rtc.c:394: warning: format '%02x' expects type 'unsigned int', but argument 3 has type 'uint64_t' hw/i386/pc.c: In function 'port92_write': hw/i386/pc.c:479: warning: format '%02x' expects type 'unsigned int', but argument 2 has type 'uint64_t' Fix them. Cc: qemu-trivial@nongnu.org Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-07-01input: fix jumpy mouse cursor with USB mouse emulationChristian Burger1-2/+2
Guest mouse pointer was jumpy, when moving host mouse in the vertical direction (see bug #1327800). Signed-off-by: Christian Burger <christian@krikkel.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-24Fix new typos (found by codespell)Stefan Weil1-1/+1
* accomodate -> accommodate * aquiring -> acquiring * beacuse -> because * loosing -> losing * prefering -> preferring * threshhold -> threshold Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-16savevm: Remove all the unneeded version_minimum_id_old (x86)Juan Quintela3-14/+7
After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong: .fields = (VMStateField []) { and .fields = (VMStateField []) { Change all the combinations to: .fields = (VMStateField[]){ The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another. Signed-off-by: Juan Quintela <quintela@redhat.com> Acked-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
2014-06-10hw/misc/milkymist-softusb: Remove unused softusb_{read, write}_pmem()Peter Maydell1-25/+0
The functions softusb_read_pmem() and softusb_write_pmem() are unused; remove them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-05-26input: switch hid mouse and tablet to the new input layer api.Gerd Hoffmann1-70/+123
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-26input: switch hid keyboard to new input layer api.Gerd Hoffmann1-7/+22
Minimal patch to get the switchover done. We continue processing ps/2 scancodes for now as they are part of the live migration stream. Fixing that, then mapping directly from QKeyValue to HID keycodes is left as excercise for another day. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-16input: switch ps/2 mouse to new input apiGerd Hoffmann1-15/+52
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-16input: switch ps/2 kbd to new input apiGerd Hoffmann1-1/+24
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-16ps2: set ps/2 output buffer size as the same as kernelGonglei1-6/+68
According to the PS/2 Mouse/Keyboard Protocol, the keyboard outupt buffer size is 16 bytes. And the PS2_QUEUE_SIZE 256 was introduced in Qemu from the very beginning. When I started a redhat5.6 32bit guest, meanwhile tapped the keyboard as quickly as possible, the screen would show me "i8042.c: No controller found". As a result, I couldn't use the keyboard in the VNC client. Previous discussion about the issue in maillist: http://thread.gmane.org/gmane.comp.emulators.qemu/43294/focus=47180 This patch has been tested on redhat5.6 32-bit/suse11sp3 64-bit guests. More easy meathod to reproduce: 1.boot a guest with libvirt. 2.connect to VNC client. 3.as you see the BIOS, bootloader, Linux booting, run the follow simply shell script: for((i=0;i<10000000;i++)) do virsh send-key redhat5.6 KEY_A; done Actual results: dmesg show "i8042.c: No controller found." And the keyboard is out of work. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-05-15Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140515' ↵Peter Maydell2-6/+3
into staging migration/next for 20140515 # gpg: Signature made Thu 15 May 2014 02:32:25 BST using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20140515: usb: fix up post load checks migration: show average throughput when migration finishes savevm: Remove all the unneeded version_minimum_id_old (rest) savevm: Remove all the unneeded version_minimum_id_old (usb) Split ram_save_block arch_init: Simplify code for load_xbzrle() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>