Skip to content
Snippets Groups Projects
  1. Aug 21, 2020
    • Paolo Bonzini's avatar
      meson: rename included C source files to .c.inc · 139c1837
      Paolo Bonzini authored
      
      With Makefiles that have automatically generated dependencies, you
      generated includes are set as dependencies of the Makefile, so that they
      are built before everything else and they are available when first
      building the .c files.
      
      Alternatively you can use a fine-grained dependency, e.g.
      
              target/arm/translate.o: target/arm/decode-neon-shared.inc.c
      
      With Meson you have only one choice and it is a third option, namely
      "build at the beginning of the corresponding target"; the way you
      express it is to list the includes in the sources of that target.
      
      The problem is that Meson decides if something is a source vs. a
      generated include by looking at the extension: '.c', '.cc', '.m', '.C'
      are sources, while everything else is considered an include---including
      '.inc.c'.
      
      Use '.c.inc' to avoid this, as it is consistent with our other convention
      of using '.rst.inc' for included reStructuredText files.  The editorconfig
      file is adjusted.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      139c1837
  2. Aug 16, 2019
    • Markus Armbruster's avatar
      Clean up inclusion of sysemu/sysemu.h · d5938f29
      Markus Armbruster authored
      
      In my "build everything" tree, changing sysemu/sysemu.h triggers a
      recompile of some 5400 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      Almost a third of its inclusions are actually superfluous.  Delete
      them.  Downgrade two more to qapi/qapi-types-run-state.h, and move one
      from char/serial.h to char/serial.c.
      
      hw/semihosting/config.c, monitor/monitor.c, qdev-monitor.c, and
      stubs/semihost.c define variables declared in sysemu/sysemu.h without
      including it.  The compiler is cool with that, but include it anyway.
      
      This doesn't reduce actual use much, as it's still included into
      widely included headers.  The next commit will tackle that.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-27-armbru@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      d5938f29
  3. Jun 14, 2018
  4. Jun 01, 2018
  5. Jan 29, 2018
    • Daniel P. Berrangé's avatar
      ui: fix alphabetical ordering of keymaps · 5a15e6b1
      Daniel P. Berrangé authored
      
      The qcode-to-linux keymaps was accidentally added in the wrong place
      by
      
        commit de80d785
        Author: Owen Smith <owen.smith@citrix.com>
        Date:   Fri Nov 3 11:56:28 2017 +0000
      
          ui: generate qcode to linux mappings
      
      breaking the alphabetical ordering of keymaps
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20180117164118.8510-4-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      5a15e6b1
    • Daniel P. Berrangé's avatar
      hw: convert the escc device to keycodemapdb · e709a61a
      Daniel P. Berrangé authored
      
      Replace the qcode_to_keycode table with automatically
      generated tables.
      
      Missing entries in qcode_to_keycode now fixed:
      
       - Q_KEY_CODE_KP_COMMA -> 0x2d
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20180117164118.8510-3-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      e709a61a
    • Daniel P. Berrangé's avatar
      hw: convert ps2 device to keycodemapdb · ab8f9d49
      Daniel P. Berrangé authored
      
      Replace the qcode_to_keycode_set1, qcode_to_keycode_set2,
      and qcode_to_keycode_set3 tables with automatically
      generated tables.
      
      Missing entries in qcode_to_keycode_set1 now fixed:
      
       - Q_KEY_CODE_SYSRQ -> 0x54
       - Q_KEY_CODE_PRINT -> 0x54 (NB ignored due to special case)
       - Q_KEY_CODE_AGAIN -> 0xe005
       - Q_KEY_CODE_PROPS -> 0xe006
       - Q_KEY_CODE_UNDO -> 0xe007
       - Q_KEY_CODE_FRONT -> 0xe00c
       - Q_KEY_CODE_COPY -> 0xe078
       - Q_KEY_CODE_OPEN -> 0x64
       - Q_KEY_CODE_PASTE -> 0x65
       - Q_KEY_CODE_CUT -> 0xe03c
       - Q_KEY_CODE_LF -> 0x5b
       - Q_KEY_CODE_HELP -> 0xe075
       - Q_KEY_CODE_COMPOSE -> 0xe05d
       - Q_KEY_CODE_PAUSE -> 0xe046
       - Q_KEY_CODE_KP_EQUALS -> 0x59
      
      And some mistakes corrected:
      
       - Q_KEY_CODE_HIRAGANA was mapped to 0x70 (Katakanahiragana)
         instead of of 0x77 (Hirigana)
       - Q_KEY_CODE_MENU was incorrectly mapped to the compose
         scancode (0xe05d) and is now mapped to 0xe01e
       - Q_KEY_CODE_FIND was mapped to 0xe065 (Search) instead
         of to 0xe041 (Find)
       - Q_KEY_CODE_POWER, SLEEP & WAKE had 0x0e instead of 0xe0
         as the prefix
      
      Missing entries in qcode_to_keycode_set2 now fixed:
      
       - Q_KEY_CODE_PRINT -> 0x7f (NB ignored due to special case)
       - Q_KEY_CODE_COMPOSE -> 0xe02f
       - Q_KEY_CODE_PAUSE -> 0xe077
       - Q_KEY_CODE_KP_EQUALS -> 0x0f
      
      And some mistakes corrected:
      
       - Q_KEY_CODE_HIRAGANA was mapped to 0x13 (Katakanahiragana)
         instead of of 0x62 (Hirigana)
       - Q_KEY_CODE_MENU was incorrectly mapped to the compose
         scancode (0xe02f) and is now not mapped
       - Q_KEY_CODE_FIND was mapped to 0xe010 (Search) and is now
         not mapped.
       - Q_KEY_CODE_POWER, SLEEP & WAKE had 0x0e instead of 0xe0
         as the prefix
      
      Missing entries in qcode_to_keycode_set3 now fixed:
      
       - Q_KEY_CODE_ASTERISK -> 0x7e
       - Q_KEY_CODE_SYSRQ -> 0x57
       - Q_KEY_CODE_LESS -> 0x13
       - Q_KEY_CODE_STOP -> 0x0a
       - Q_KEY_CODE_AGAIN -> 0x0b
       - Q_KEY_CODE_PROPS -> 0x0c
       - Q_KEY_CODE_UNDO -> 0x10
       - Q_KEY_CODE_COPY -> 0x18
       - Q_KEY_CODE_OPEN -> 0x20
       - Q_KEY_CODE_PASTE -> 0x28
       - Q_KEY_CODE_FIND -> 0x30
       - Q_KEY_CODE_CUT -> 0x38
       - Q_KEY_CODE_HELP -> 0x09
       - Q_KEY_CODE_COMPOSE -> 0x8d
       - Q_KEY_CODE_AUDIONEXT -> 0x93
       - Q_KEY_CODE_AUDIOPREV -> 0x94
       - Q_KEY_CODE_AUDIOSTOP -> 0x98
       - Q_KEY_CODE_AUDIOMUTE -> 0x9c
       - Q_KEY_CODE_VOLUMEUP -> 0x95
       - Q_KEY_CODE_VOLUMEDOWN -> 0x9d
       - Q_KEY_CODE_CALCULATOR -> 0xa3
       - Q_KEY_CODE_AC_HOME -> 0x97
      
      And some mistakes corrected:
      
       - Q_KEY_CODE_MENU was incorrectly mapped to the compose
         scancode (0x8d) and is now 0x91
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20180117164118.8510-2-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      ab8f9d49
  6. Jan 25, 2018
    • Daniel P. Berrangé's avatar
      ui: convert GTK and SDL1 frontends to keycodemapdb · 2ec78706
      Daniel P. Berrangé authored
      
      The x_keycode_to_pc_keycode and evdev_keycode_to_pc_keycode
      tables are replaced with automatically generated tables.
      In addition the X11 heuristics are improved to detect running
      on XQuartz and XWin X11 servers, to activate the correct OS-X
      and Win32 keycode maps.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20180117164717.15855-3-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      2ec78706
    • Daniel P. Berrangé's avatar
      ui: convert the SDL2 frontend to keycodemapdb · ed7b2624
      Daniel P. Berrangé authored
      
      The SDL2 scancodes are conveniently identical to the USB
      scancodes. Replace the sdl2_scancode_to_qcode table with
      an automatically generated table.
      
      Missing entries in sdl2_scancode_to_qcode now fixed:
      
        - 0x32 -> Q_KEY_CODE_BACKSLASH
        - 0x66 -> Q_KEY_CODE_POWER
        - 0x67 -> Q_KEY_CODE_KP_EQUALS
        - 0x74 -> Q_KEY_CODE_OPEN
        - 0x77 -> Q_KEY_CODE_FRONT
        - 0x7f -> Q_KEY_CODE_AUDIOMUTE
        - 0x80 -> Q_KEY_CODE_VOLUMEUP
        - 0x81 -> Q_KEY_CODE_VOLUMEDOWN
        - 0x85 -> Q_KEY_CODE_KP_COMMA
        - 0x87 -> Q_KEY_CODE_RO
        - 0x89 -> Q_KEY_CODE_YEN
        - 0x8a -> Q_KEY_CODE_HENKAN
        - 0x93 -> Q_KEY_CODE_HIRAGANA
        - 0xe8 -> Q_KEY_CODE_AUDIOPLAY
        - 0xe9 -> Q_KEY_CODE_AUDIOSTOP
        - 0xea -> Q_KEY_CODE_AUDIOPREV
        - 0xeb -> Q_KEY_CODE_AUDIONEXT
        - 0xed -> Q_KEY_CODE_VOLUMEUP
        - 0xee -> Q_KEY_CODE_VOLUMEDOWN
        - 0xef -> Q_KEY_CODE_AUDIOMUTE
        - 0xf1 -> Q_KEY_CODE_AC_BACK
        - 0xf2 -> Q_KEY_CODE_AC_FORWARD
        - 0xf3 -> Q_KEY_CODE_STOP
        - 0xf4 -> Q_KEY_CODE_FIND
        - 0xf8 -> Q_KEY_CODE_SLEEP
        - 0xfa -> Q_KEY_CODE_AC_REFRESH
        - 0xfb -> Q_KEY_CODE_CALCULATOR
      
      And some mistakes corrected:
      
        - 0x65 -> Q_KEY_CODE_COMPOSE, not duplicating Q_KEY_CODE_MENU
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20180117164717.15855-2-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      ed7b2624
  7. Dec 14, 2017
  8. Oct 16, 2017
    • Daniel P. Berrangé's avatar
      ui: convert common input code to keycodemapdb · bcd5ac9b
      Daniel P. Berrangé authored
      
      Replace the number_to_qcode, qcode_to_number and linux_to_qcode
      tables with automatically generated tables.
      
      Missing entries in linux_to_qcode now fixed:
      
        KEY_LINEFEED -> Q_KEY_CODE_LF
        KEY_KPEQUAL -> Q_KEY_CODE_KP_EQUALS
        KEY_COMPOSE -> Q_KEY_CODE_COMPOSE
        KEY_AGAIN -> Q_KEY_CODE_AGAIN
        KEY_PROPS -> Q_KEY_CODE_PROPS
        KEY_UNDO -> Q_KEY_CODE_UNDO
        KEY_FRONT -> Q_KEY_CODE_FRONT
        KEY_COPY -> Q_KEY_CODE_COPY
        KEY_OPEN -> Q_KEY_CODE_OPEN
        KEY_PASTE -> Q_KEY_CODE_PASTE
        KEY_CUT -> Q_KEY_CODE_CUT
        KEY_HELP -> Q_KEY_CODE_HELP
        KEY_MEDIA -> Q_KEY_CODE_MEDIASELECT
      
      In addition, some fixes:
      
       - KEY_PLAYPAUSE now maps to Q_KEY_CODE_AUDIOPLAY, instead of
         KEY_PLAYCD. KEY_PLAYPAUSE is defined across almost all scancodes
         sets, while KEY_PLAYCD only appears in AT set1, so the former is
         a more useful mapping.
      
      Missing entries in qcode_to_number now fixed:
      
        Q_KEY_CODE_AGAIN -> 0x85
        Q_KEY_CODE_PROPS -> 0x86
        Q_KEY_CODE_UNDO -> 0x87
        Q_KEY_CODE_FRONT -> 0x8c
        Q_KEY_CODE_COPY -> 0xf8
        Q_KEY_CODE_OPEN -> 0x64
        Q_KEY_CODE_PASTE -> 0x65
        Q_KEY_CODE_CUT -> 0xbc
        Q_KEY_CODE_LF -> 0x5b
        Q_KEY_CODE_HELP -> 0xf5
        Q_KEY_CODE_COMPOSE -> 0xdd
        Q_KEY_CODE_KP_EQUALS -> 0x59
        Q_KEY_CODE_MEDIASELECT -> 0xed
      
      In addition, some fixes:
      
       - Q_KEY_CODE_MENU was incorrectly mapped to the compose
         scancode (0xdd) and is now mapped to 0x9e
       - Q_KEY_CODE_FIND was mapped to 0xe065 (Search) instead
         of to 0xe041 (Find)
       - Q_KEY_CODE_HIRAGANA was mapped to 0x70 (Katakanahiragana)
         instead of of 0x77 (Hirigana)
       - Q_KEY_CODE_PRINT was mapped to 0xb7 which is not a defined
         scan code in AT set 1, it is now mapped to 0x54 (sysrq)
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170929101201.21039-5-berrange@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      bcd5ac9b
  9. Jul 28, 2017
  10. Jul 27, 2017
  11. Jan 10, 2017
  12. Mar 18, 2016
    • Eric Blake's avatar
      qapi: Don't special-case simple union wrappers · 32bafa8f
      Eric Blake authored
      
      Simple unions were carrying a special case that hid their 'data'
      QMP member from the resulting C struct, via the hack method
      QAPISchemaObjectTypeVariant.simple_union_type().  But by using
      the work we started by unboxing flat union and alternate
      branches, coupled with the ability to visit the members of an
      implicit type, we can now expose the simple union's implicit
      type in qapi-types.h:
      
      | struct q_obj_ImageInfoSpecificQCow2_wrapper {
      |     ImageInfoSpecificQCow2 *data;
      | };
      |
      | struct q_obj_ImageInfoSpecificVmdk_wrapper {
      |     ImageInfoSpecificVmdk *data;
      | };
      ...
      | struct ImageInfoSpecific {
      |     ImageInfoSpecificKind type;
      |     union { /* union tag is @type */
      |         void *data;
      |-        ImageInfoSpecificQCow2 *qcow2;
      |-        ImageInfoSpecificVmdk *vmdk;
      |+        q_obj_ImageInfoSpecificQCow2_wrapper qcow2;
      |+        q_obj_ImageInfoSpecificVmdk_wrapper vmdk;
      |     } u;
      | };
      
      Doing this removes asymmetry between QAPI's QMP side and its
      C side (both sides now expose 'data'), and means that the
      treatment of a simple union as sugar for a flat union is now
      equivalent in both languages (previously the two approaches used
      a different layer of dereferencing, where the simple union could
      be converted to a flat union with equivalent C layout but
      different {} on the wire, or to an equivalent QMP wire form
      but with different C representation).  Using the implicit type
      also lets us get rid of the simple_union_type() hack.
      
      Of course, now all clients of simple unions have to adjust from
      using su->u.member to using su->u.member.data; while this touches
      a number of files in the tree, some earlier cleanup patches
      helped minimize the change to the initialization of a temporary
      variable rather than every single member access.  The generated
      qapi-visit.c code is also affected by the layout change:
      
      |@@ -7393,10 +7393,10 @@ void visit_type_ImageInfoSpecific_member
      |     }
      |     switch (obj->type) {
      |     case IMAGE_INFO_SPECIFIC_KIND_QCOW2:
      |-        visit_type_ImageInfoSpecificQCow2(v, "data", &obj->u.qcow2, &err);
      |+        visit_type_q_obj_ImageInfoSpecificQCow2_wrapper_members(v, &obj->u.qcow2, &err);
      |         break;
      |     case IMAGE_INFO_SPECIFIC_KIND_VMDK:
      |-        visit_type_ImageInfoSpecificVmdk(v, "data", &obj->u.vmdk, &err);
      |+        visit_type_q_obj_ImageInfoSpecificVmdk_wrapper_members(v, &obj->u.vmdk, &err);
      |         break;
      |     default:
      |         abort();
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <1458254921-17042-13-git-send-email-eblake@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      32bafa8f
  13. Feb 04, 2016
    • Peter Maydell's avatar
      ui: Clean up includes · e16f4c87
      Peter Maydell authored
      
      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: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-2-git-send-email-peter.maydell@linaro.org
      e16f4c87
  14. Dec 17, 2015
    • Eric Blake's avatar
      qapi: Don't let implicit enum MAX member collide · 7fb1cf16
      Eric Blake authored
      
      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: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      [Rebased to current master, commit message tweaked]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      7fb1cf16
  15. Nov 02, 2015
    • Eric Blake's avatar
      input: Convert to new qapi union layout · 568c73a4
      Eric Blake authored
      
      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: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <1445898903-12082-20-git-send-email-eblake@redhat.com>
      [Commit message tweaked slightly]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      568c73a4
  16. May 29, 2015
    • Gerd Hoffmann's avatar
      kbd: add brazil kbd keys to qemu · b771f470
      Gerd Hoffmann authored
      
      The brazilian computer keyboard layout has two extra keys (compared to
      the usual 105-key intl ps/2 keyboard).  This patch makes these two keys
      known to qemu.
      
      For historic reasons qemu has two ways to specify a key:  A QKeyCode
      (name-based) or a number (ps/2 scancode based).  Therefore we have to
      update multiple places to make new keys known to qemu:
      
        (1) The QKeyCode definition in qapi-schema.json
        (2) The QKeyCode <-> number mapping table in ui/input-keymap.c
      
      This patch does just that.  With this patch applied you can send those
      two keys to the guest using the send-key monitor command.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      b771f470
  17. May 26, 2014
  18. May 16, 2014
Loading