1. 14 3月, 2017 1 次提交
    • C
      build: include sys/sysmacros.h for major() and minor() · 4d04351f
      Christopher Covington 提交于
      The definition of the major() and minor() macros are moving within glibc to
      <sys/sysmacros.h>. Include this header when it is available to avoid the
      following sorts of build-stopping messages:
      
      qga/commands-posix.c: In function ‘dev_major_minor’:
      qga/commands-posix.c:656:13: error: In the GNU C Library, "major" is defined
       by <sys/sysmacros.h>. For historical compatibility, it is
       currently defined by <sys/types.h> as well, but we plan to
       remove this soon. To use "major", include <sys/sysmacros.h>
       directly. If you did not intend to use a system-defined macro
       "major", you should undefine it after including <sys/types.h>. [-Werror]
               *devmajor = major(st.st_rdev);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      
      qga/commands-posix.c:657:13: error: In the GNU C Library, "minor" is defined
       by <sys/sysmacros.h>. For historical compatibility, it is
       currently defined by <sys/types.h> as well, but we plan to
       remove this soon. To use "minor", include <sys/sysmacros.h>
       directly. If you did not intend to use a system-defined macro
       "minor", you should undefine it after including <sys/types.h>. [-Werror]
               *devminor = minor(st.st_rdev);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      
      The additional include allows the build to complete on Fedora 26 (Rawhide)
      with glibc version 2.24.90.
      Signed-off-by: NChristopher Covington <cov@codeaurora.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      4d04351f
  2. 02 11月, 2016 1 次提交
    • R
      log: Add locking to large logging blocks · 1ee73216
      Richard Henderson 提交于
      Reuse the existing locking provided by stdio to keep in_asm, cpu,
      op, op_opt, op_ind, and out_asm as contiguous blocks.
      
      While it isn't possible to interleave e.g. in_asm or op_opt logs
      because of the TB lock protecting all code generation, it is
      possible to interleave cpu logs, or to interleave a cpu dump with
      an out_asm dump.
      
      For mingw32, we appear to have no viable solution for this.  The locking
      functions are not properly exported from the system runtime library.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      1ee73216
  3. 29 9月, 2016 1 次提交
  4. 17 6月, 2016 1 次提交
  5. 11 3月, 2016 3 次提交
    • D
      osdep: remove use of socket_error() from all code · b16a44e1
      Daniel P. Berrange 提交于
      Now that QEMU wraps the Win32 sockets methods to automatically
      set errno upon failure, there is no reason for callers to use
      the socket_error() method. They can rely on accessing errno
      even on Win32. Remove all use of socket_error() from general
      code, leaving it as a static method in oslib-win32.c only.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b16a44e1
    • D
      osdep: add wrappers for socket functions · a2d96af4
      Daniel P. Berrange 提交于
      The windows socket functions look identical to the normal POSIX
      sockets functions, but instead of setting errno, the caller needs
      to call WSAGetLastError(). QEMU has tried to deal with this
      incompatibility by defining a socket_error() method that callers
      must use that abstracts the difference between WSAGetLastError()
      and errno.
      
      This approach is somewhat error prone though - many callers of
      the sockets functions are just using errno directly because it
      is easy to forget the need use a QEMU specific wrapper. It is
      not always immediately obvious that a particular function will
      in fact call into Windows sockets functions, so the dev may not
      even realize they need to use socket_error().
      
      This introduces an alternative approach to portability inspired
      by the way GNULIB fixes portability problems. We use a macro to
      redefine the original socket function names to refer to a QEMU
      wrapper function. The wrapper function calls the original Win32
      sockets method and then sets errno from the WSAGetLastError()
      value.
      
      Thus all code can simply call the normal POSIX sockets APIs are
      have standard errno reporting on error, even on Windows. This
      makes the socket_error() method obsolete.
      
      We also bring closesocket & ioctlsocket into this approach. Even
      though they are non-standard Win32 names, we can't wrap the normal
      close/ioctl methods since there's no reliable way to distinguish
      between a file descriptor and HANDLE in Win32.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a2d96af4
    • D
      osdep: fix socket_error() to work with Mingw64 · c6196440
      Daniel P. Berrange 提交于
      Historically QEMU has had a socket_error() macro that was
      defined to map to WSASocketError(). The os-win32.h header
      file would define errno constants that mapped to the
      WSA error constants. This worked fine with Mingw32 since
      its header files never defined any errno values, nor did
      it even provide an errno.h.  So callers of socket_error()
      could match on traditional Exxxx constants and it would
      all "just work".
      
      With Mingw64 though, things work rather differently. First
      there is an errno.h file which defines all the traditional
      errno constants you'd expect from a UNIX platform. There
      is then a winerror.h which defined the WSA error constants.
      Crucially the WSAExxxx errno values in winerror.h do not
      match the Exxxx errno values in error.h.
      
      If QEMU had only imported winerror.h it would still work,
      but the qemu/osdep.h file unconditionally imports errno.h.
      So callers of socket_error() will get now WSAExxxx values
      back and compare them to the Exxx constants. This will
      always fail silently at runtime.
      
      To solve this QEMU needs to stop assuming the WSAExxxx
      constant values match the Exxx constant values. Thus the
      socket_error() macro is turned into a small function that
      re-maps WSAExxxx values into Exxx.
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c6196440
  6. 23 2月, 2016 1 次提交
    • P
      include: Clean up includes · 90ce6e26
      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.
      
      NB: If this commit breaks compilation for your out-of-tree
      patchseries or fork, then you need to make sure you add
      #include "qemu/osdep.h" to any new .c files that you have.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      90ce6e26
  7. 23 6月, 2014 1 次提交
  8. 22 4月, 2013 1 次提交
  9. 19 12月, 2012 1 次提交
  10. 23 9月, 2012 1 次提交
    • H
      curses: don't initialize curses when qemu is daemonized · 995ee2bf
      Hitoshi Mitake 提交于
      Current qemu initializes curses even if -daemonize option is
      passed. This cause problem because shell prompt appears without
      calling endwin().
      
      This patch adds new function, is_daemonized(), to OS dependent
      code. With this function, curses_display_init() can check that qemu is
      daemonized or not. If daemonized, curses_display_init() isn't called
      and the problem is avoided.
      
      Of course, -daemonize && -curses doesn't make sense. Users shouldn't
      pass the arguments at the same time. But the problem is very painful
      because Ctrl-C cannot be delivered to the terminal.
      
      Cc: Andrzej Zaborowski  <balrog@zabor.org>
      Cc: Stefan Hajnoczi <stefanha@gmail.com>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NHitoshi Mitake <h.mitake@gmail.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@gmail.com>
      995ee2bf
  11. 29 11月, 2011 1 次提交
  12. 22 10月, 2011 1 次提交
  13. 03 12月, 2010 1 次提交
    • H
      virtio-9p: fix build on !CONFIG_UTIMENSAT · 38671423
      Hidetoshi Seto 提交于
      This patch introduce a fallback mechanism for old systems that do not
      support utimensat().  This fix build failure with following warnings:
      
      hw/virtio-9p-local.c: In function 'local_utimensat':
      hw/virtio-9p-local.c:479: warning: implicit declaration of function 'utimensat'
      hw/virtio-9p-local.c:479: warning: nested extern declaration of 'utimensat'
      
      and:
      
      hw/virtio-9p.c: In function 'v9fs_setattr_post_chmod':
      hw/virtio-9p.c:1410: error: 'UTIME_NOW' undeclared (first use in this function)
      hw/virtio-9p.c:1410: error: (Each undeclared identifier is reported only once
      hw/virtio-9p.c:1410: error: for each function it appears in.)
      hw/virtio-9p.c:1413: error: 'UTIME_OMIT' undeclared (first use in this function)
      hw/virtio-9p.c: In function 'v9fs_wstat_post_chmod':
      hw/virtio-9p.c:2905: error: 'UTIME_OMIT' undeclared (first use in this function)
      
      [NOTE: At this time virtio-9p is only user of utimensat(), and is available
             only when host is linux and CONFIG_VIRTFS is defined.  So there are
             no similar warning for win32.  Please provide a wrapper for win32 in
             oslib-win32.c if new user really requires it.]
      
      v5:
        - Allow fallback on runtime
        - Move qemu_utimensat() to oslib-posix.c
        - Rebased on latest qemu.git
      v4:
        - Use tv_now.tv_usec
      v3:
        - Use better alternative handling for UTIME_NOW/OMIT
        - Move qemu_utimensat() to cutils.c
      V2:
        - Introduce qemu_utimensat()
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Acked-by: NM. Mohan Kumar <mohan@in.ibm.com>
      Acked-by: NJes Sorensen <Jes.Sorensen@redhat.com>
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Signed-off-by: NVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
      38671423
  14. 30 10月, 2010 1 次提交
  15. 12 6月, 2010 10 次提交
  16. 03 12月, 2009 4 次提交
  17. 04 3月, 2009 1 次提交
  18. 08 4月, 2008 1 次提交
  19. 01 2月, 2008 1 次提交
  20. 07 10月, 2007 1 次提交
  21. 17 9月, 2007 1 次提交
  22. 08 4月, 2007 1 次提交
  23. 02 2月, 2007 1 次提交
  24. 31 10月, 2005 1 次提交
  25. 08 11月, 2004 1 次提交