1. 24 Dec, 2016 3 commits
  2. 01 Nov, 2016 1 commit
  3. 30 Oct, 2016 3 commits
  4. 28 Oct, 2016 2 commits
  5. 24 Oct, 2016 7 commits
  6. 17 Oct, 2016 2 commits
  7. 22 Sep, 2016 1 commit
    • Lin Ma's avatar
      msmouse: Fix segfault caused by free the chr before chardev cleanup. · 9e14037f
      Lin Ma authored
      Segfault happens when leaving qemu with msmouse backend:
      
       #0  0x00007fa8526ac975 in raise () at /lib64/libc.so.6
       #1  0x00007fa8526add8a in abort () at /lib64/libc.so.6
       #2  0x0000558be78846ab in error_exit (err=16, msg=0x558be799da10 ...
       #3  0x0000558be7884717 in qemu_mutex_destroy (mutex=0x558be93be750) at ...
       #4  0x0000558be7549951 in qemu_chr_free_common (chr=0x558be93be750) at ...
       #5  0x0000558be754999c in qemu_chr_free (chr=0x558be93be750) at ...
       #6  0x0000558be7549a20 in qemu_chr_delete (chr=0x558be93be750) at ...
       #7  0x0000558be754a8ef in qemu_chr_cleanup () at qemu-char.c:4643
       #8  0x0000558be755843e in main (argc=5, argv=0x7ffe925d7118, ...
      
      The chr was freed by msmouse close callback before chardev cleanup,
      Then qemu_mutex_destroy triggered raise().
      
      Because freeing chr is handled by qemu_chr_free_common, Remove the free from
      msmouse_chr_close to avoid double free.
      
      Fixes: c1111a24
      Cc: qemu-stable@nongnu.org
      Signed-off-by: 's avatarLin Ma <lma@suse.com>
      Message-Id: <20160915143158.4796-1-lma@suse.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      9e14037f
  8. 14 Sep, 2016 1 commit
  9. 13 Sep, 2016 1 commit
    • Daniel P. Berrange's avatar
      hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all · 6ab3fc32
      Daniel P. Berrange authored
      The qemu_chr_fe_write method will return -1 on EAGAIN if the
      chardev backend write would block. Almost no callers of the
      qemu_chr_fe_write() method check the return value, instead
      blindly assuming data was successfully sent. In most cases
      this will lead to silent data loss on interactive consoles,
      but in some cases (eg RNG EGD) it'll just cause corruption
      of the protocol being spoken.
      
      We unfortunately can't fix the virtio-console code, due to
      a bug in the Linux guest drivers, which would cause the
      entire Linux kernel to hang if we delay processing of the
      incoming data in any way. Fixing this requires first fixing
      the guest driver to not hold spinlocks while writing to the
      hvc device backend.
      
      Fixes bug: https://bugs.launchpad.net/qemu/+bug/1586756Signed-off-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1473170165-540-4-git-send-email-berrange@redhat.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      6ab3fc32
  10. 02 Aug, 2016 1 commit
  11. 13 Jul, 2016 2 commits
  12. 12 Jul, 2016 4 commits
  13. 23 May, 2016 1 commit
  14. 15 Apr, 2016 1 commit
  15. 07 Apr, 2016 1 commit
  16. 22 Mar, 2016 2 commits
    • Rutuja Shah's avatar
      Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND · 73bcb24d
      Rutuja Shah authored
      This patch replaces get_ticks_per_sec() calls with the macro
      NANOSECONDS_PER_SECOND. Also, as there are no callers, get_ticks_per_sec()
      is then removed.  This replacement improves the readability and
      understandability of code.
      
      For example,
      
          timer_mod(fdctrl->result_timer,
      	      qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (get_ticks_per_sec() / 50));
      
      NANOSECONDS_PER_SECOND makes it obvious that qemu_clock_get_ns
      matches the unit of the expression on the right side of the plus.
      Signed-off-by: 's avatarRutuja Shah <rutu.shah.26@gmail.com>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      73bcb24d
    • Markus Armbruster's avatar
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster authored
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  17. 18 Mar, 2016 1 commit
    • 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: 's avatarEric Blake <eblake@redhat.com>
      Message-Id: <1458254921-17042-13-git-send-email-eblake@redhat.com>
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      32bafa8f
  18. 08 Mar, 2016 1 commit
  19. 05 Mar, 2016 1 commit
  20. 03 Mar, 2016 4 commits