1. 08 4月, 2013 1 次提交
    • D
      Rewrite keycode map to avoid a struct · d27efd8e
      Daniel P. Berrange 提交于
      Playing games with field offsets in a struct causes all sorts
      of alignment warnings on ARM platforms
      
      util/virkeycode.c: In function '__virKeycodeValueFromString':
      util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
           (*(typeof(field_type) *)((char *)(object) + field_offset))
             ^
      util/virkeycode.c:91:28: note: in expansion of macro 'getfield'
               const char *name = getfield(virKeycodes + i, const char *, name_offset);
                                  ^
      util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
           (*(typeof(field_type) *)((char *)(object) + field_offset))
             ^
      util/virkeycode.c:94:20: note: in expansion of macro 'getfield'
                   return getfield(virKeycodes + i, unsigned short, code_offset);
                          ^
      util/virkeycode.c: In function '__virKeycodeValueTranslate':
      util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
           (*(typeof(field_type) *)((char *)(object) + field_offset))
             ^
      util/virkeycode.c:127:13: note: in expansion of macro 'getfield'
               if (getfield(virKeycodes + i, unsigned short, from_offset) == key_value)
                   ^
      util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
           (*(typeof(field_type) *)((char *)(object) + field_offset))
             ^
      util/virkeycode.c:128:20: note: in expansion of macro 'getfield'
                   return getfield(virKeycodes + i, unsigned short, to_offset);
      
      There is no compelling reason to use a struct for the keycode
      tables. It can easily just use an array of arrays instead,
      avoiding all alignment problems
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d27efd8e
  2. 26 8月, 2011 1 次提交
    • D
      Fix keymap used to talk with QEMU · ce93f64b
      Daniel P. Berrange 提交于
      The QEMU 'sendkey' command expects keys to be encoded in the same
      way as the RFB extended keycode set. Specifically it wants extended
      keys to have the high bit of the first byte set, while the Linux
      XT KBD driver codeset uses the low bit of the second byte. To deal
      with this we introduce a new keymap 'RFB' and use that in the QEMU
      driver
      
      * include/libvirt/libvirt.h.in: Add VIR_KEYCODE_SET_RFB
      * src/qemu/qemu_driver.c: Use RFB keycode set instead of XT KBD
      * src/util/virkeycode-mapgen.py: Auto-generate the RFB keycode
        set from the XT KBD set
      * src/util/virkeycode.c: Add RFB keycode entry to table. Add a
        verify check on cardinality of the codeOffset table
      ce93f64b
  3. 22 7月, 2011 1 次提交
  4. 21 7月, 2011 1 次提交
    • L
      util: add virtkeycode module · 0bbf87e9
      Lai Jiangshan 提交于
      Add virtkey lib for usage-improvment and keycode translating.
      Add 4 internal API for the aim
      
      const char *virKeycodeSetTypeToString(int codeset);
      int virKeycodeSetTypeFromString(const char *name);
      int virKeycodeValueFromString(virKeycodeSet codeset, const char *keyname);
      int virKeycodeValueTranslate(virKeycodeSet from_codeset,
                                   virKeycodeSet to_offset,
                                   int key_value);
      
      * include/libvirt/libvirt.h.in: extend virKeycodeSet enum
      * src/Makefile.am: add new virtkeycode module and rule to generate
        virkeymaps.h
      * src/util/virkeycode.c src/util/virkeycode.h: new module
      * src/util/virkeycode-mapgen.py: python generator for virkeymaps.h
        out of keymaps.csv
      * src/libvirt_private.syms: extend private symbols for new module
      * .gitignore: add generated virkeymaps.h
      0bbf87e9