1. 18 3月, 2016 1 次提交
    • E
      qapi: Don't special-case simple union wrappers · 32bafa8f
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Message-Id: <1458254921-17042-13-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      32bafa8f
  2. 09 3月, 2016 1 次提交
  3. 01 3月, 2016 1 次提交
  4. 25 2月, 2016 1 次提交
  5. 05 2月, 2016 1 次提交
    • P
      ui: Clean up includes · e16f4c87
      Peter Maydell 提交于
      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: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-2-git-send-email-peter.maydell@linaro.org
      e16f4c87
  6. 03 2月, 2016 1 次提交
  7. 16 1月, 2016 1 次提交
    • D
      qemu-char: add logfile facility to all chardev backends · d0d7708b
      Daniel P. Berrange 提交于
      Typically a UNIX guest OS will log boot messages to a serial
      port in addition to any graphical console. An admin user
      may also wish to use the serial port for an interactive
      console. A virtualization management system may wish to
      collect system boot messages by logging the serial port,
      but also wish to allow admins interactive access.
      
      Currently providing such a feature forces the mgmt app
      to either provide 2 separate serial ports, one for
      logging boot messages and one for interactive console
      login, or to proxy all output via a separate service
      that can multiplex the two needs onto one serial port.
      While both are valid approaches, they each have their
      own downsides. The former causes confusion and extra
      setup work for VM admins creating disk images. The latter
      places an extra burden to re-implement much of the QEMU
      chardev backends logic in libvirt or even higher level
      mgmt apps and adds extra hops in the data transfer path.
      
      A simpler approach that is satisfactory for many use
      cases is to allow the QEMU chardev backends to have a
      "logfile" property associated with them.
      
       $QEMU -chardev socket,host=localhost,port=9000,\
                      server=on,nowait,id-charserial0,\
      		logfile=/var/log/libvirt/qemu/test-serial0.log
             -device isa-serial,chardev=charserial0,id=serial0
      
      This patch introduces a 'ChardevCommon' struct which
      is setup as a base for all the ChardevBackend types.
      Ideally this would be registered directly as a base
      against ChardevBackend, rather than each type, but
      the QAPI generator doesn't allow that since the
      ChardevBackend is a non-discriminated union. The
      ChardevCommon struct provides the optional 'logfile'
      parameter, as well as 'logappend' which controls
      whether QEMU truncates or appends (default truncate).
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1452516281-27519-1-git-send-email-berrange@redhat.com>
      [Call qemu_chr_parse_common if cd->parse is NULL. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d0d7708b
  8. 08 1月, 2016 1 次提交
    • O
      ui/curses: Fix color attribute of monitor for curses · 4083733d
      OGAWA Hirofumi 提交于
      Current text_console_update() writes totally broken color attributes
      to console_write_ch(). The format now is writing,
      
      [WRONG]
      	bold << 21 | fg << 12 | bg << 8 | char
      	fg == 3bits curses color number
      	bg == 3bits curses color number
      
      I can't see this format is where come from. Anyway, this doesn't work
      at all.
      
      What curses expects is actually (and vga.c is using),
      
      [RIGHT]
      	bold << 21 | bg << 11 | fg << 8 | char
      	fg == 3bits vga color number
      	bg == 3bits vga color number
      
      And curses set COLOR_PAIR() up to match this format, and curses's
      chtype. I.e,
      
      	bold | color_pair | char
      	color_pair == (bg << 3 | fg)
      
      To fix, this simply uses VGA color number everywhere except curses.c
      internal. Then, convert it to above [RIGHT] format to write by
      console_write_ch(). And as bonus, this reduces to expose curses define
      to other parts (removes COLOR_* from console.c).
      
      [Tested the first line is displayed as white on blue back for monitor
      in curses console]
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Message-id: 87r3j95407.fsf@mail.parknet.co.jp
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      4083733d
  9. 17 12月, 2015 1 次提交
    • E
      qapi: Don't let implicit enum MAX member collide · 7fb1cf16
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      [Rebased to current master, commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      7fb1cf16
  10. 06 11月, 2015 1 次提交
  11. 02 11月, 2015 1 次提交
    • E
      input: Convert to new qapi union layout · 568c73a4
      Eric Blake 提交于
      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: NEric Blake <eblake@redhat.com>
      Message-Id: <1445898903-12082-20-git-send-email-eblake@redhat.com>
      [Commit message tweaked slightly]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      568c73a4
  12. 19 10月, 2015 1 次提交
  13. 14 10月, 2015 1 次提交
  14. 08 10月, 2015 1 次提交
  15. 05 6月, 2015 1 次提交
    • P
      ui/console: remove dpy_gfx_update_dirty · 42af3e3a
      Paolo Bonzini 提交于
      dpy_gfx_update_dirty expects DIRTY_MEMORY_VGA logging to be always on,
      but that will not be the case soon.  Because it computes the memory
      region on the fly for every update (with memory_region_find), it cannot
      enable/disable logging by itself.
      
      We could always treat updates as invalidations if dirty logging is
      not enabled, assuming that the board will enable logging on the
      RAM region that includes the framebuffer.
      
      However, the function is unused, so just drop it.
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      42af3e3a
  16. 06 5月, 2015 2 次提交
  17. 30 4月, 2015 1 次提交
  18. 22 4月, 2015 1 次提交
  19. 12 3月, 2015 1 次提交
  20. 10 3月, 2015 1 次提交
  21. 19 1月, 2015 1 次提交
  22. 29 9月, 2014 1 次提交
    • G
      console: add graphic_console_set_hwops · 1c1f9498
      Gerd Hoffmann 提交于
      Add a function to allow display emulations to switch the hwops
      function pointers.  This is useful for devices which have two
      completely different operation modes.  Typical case is the vga
      compatibility mode vs. native mode in qxl and the upcoming
      virtio-vga device.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      1c1f9498
  23. 17 9月, 2014 1 次提交
  24. 05 9月, 2014 5 次提交
  25. 23 6月, 2014 1 次提交
  26. 10 6月, 2014 2 次提交
  27. 02 6月, 2014 2 次提交
  28. 26 5月, 2014 5 次提交
    • G
      console: add kbd_put_keysym_console · 3f9a6e85
      Gerd Hoffmann 提交于
      So you can send keysyms to a specific (text terminal) console.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3f9a6e85
    • G
      console: rework text terminal cursor logic · aea7947c
      Gerd Hoffmann 提交于
      Have a global timer.  Update all visible terminal windows syncronously.
      Right now this can be the active_console only, but that will change
      soon.  The global timer will disable itself if not needed, so we only
      have to care start it if needed.  Which might be at console switch time
      or when a new displaychangelistener is registered.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      aea7947c
    • G
      console: update text terminal surface unconditionally · b35e3ba0
      Gerd Hoffmann 提交于
      These days each QemuConsole has its own private DisplaySurface,
      so we can simply render updates all the time.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      b35e3ba0
    • G
      console: nicer initial screen · 521a580d
      Gerd Hoffmann 提交于
      Now that we have a function to create a fancy DisplaySurface with a
      message for the user, to handle non-existing graphics hardware, we
      can make it more generic and use it for other things too.
      
      This patch adds a text line to the in initial DisplaySurface, notifying
      the user that the display isn't initialized yet by the guest.
      
      You can see this in action when starting qemu with '-S'.  Also when
      booting ovmf in qemu (which needs a few moments to initialize itself
      before it initializes the vga).
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      521a580d
    • K
      console: Abort on property access errors · afff2b15
      Kirill Batuzov 提交于
      All defined properties of QemuConsole are mandatory and no access to them
      should fail. Nevertheless not checking returned errors is bad because in case
      of unexpected failure it will hide the bug and cause a memory leak.
      
      Abort in case of unexpected property access errors. This change exposed a bug
      where an attempt was made to write to a read-only property "head".
      
      Set "head" property's value at creation time and do not attempt to change it
      later. This fixes the bug mentioned above.
      Signed-off-by: NKirill Batuzov <batuzovk@ispras.ru>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      afff2b15
  29. 08 5月, 2014 1 次提交