Skip to content
Snippets Groups Projects
  1. Aug 16, 2019
  2. Aug 06, 2019
  3. Jul 15, 2019
  4. Jun 24, 2019
  5. Jun 21, 2019
  6. Jun 12, 2019
    • Markus Armbruster's avatar
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster authored
      
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-5-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c
      block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c
      target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h
      target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h
      target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h
      target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and
      net/tap-bsd.c fixed up]
      a8d25326
  7. Jun 11, 2019
  8. Jun 06, 2019
  9. May 29, 2019
  10. May 22, 2019
  11. May 10, 2019
  12. May 07, 2019
  13. May 03, 2019
    • Daniel P. Berrangé's avatar
      sockets: avoid string truncation warnings when copying UNIX path · 2d2023c3
      Daniel P. Berrangé authored
      
      In file included from /usr/include/string.h:494,
                       from include/qemu/osdep.h:101,
                       from util/qemu-sockets.c:18:
      In function ‘strncpy’,
          inlined from ‘unix_connect_saddr.isra.0’ at util/qemu-sockets.c:925:5:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In function ‘strncpy’,
          inlined from ‘unix_listen_saddr.isra.0’ at util/qemu-sockets.c:880:5:
      /usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Wstringop-truncation]
        106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      We are already validating the UNIX socket path length earlier in
      the functions. If we save this string length when we first check
      it, then we can simply use memcpy instead of strcpy later, avoiding
      the gcc truncation warnings.
      
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Message-Id: <20190501145052.12579-1-berrange@redhat.com>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      2d2023c3
  14. Apr 30, 2019
  15. Apr 25, 2019
  16. Apr 18, 2019
    • Markus Armbruster's avatar
      qemu-print: New qemu_fprintf(), qemu_vfprintf() · 19aaa4c3
      Markus Armbruster authored
      
      Code that doesn't want to know about current monitor vs. stdout
      vs. stderr takes an fprintf_function callback and a FILE * argument to
      pass to it.  Actual arguments are either fprintf() and stdout or
      stderr, or monitor_fprintf() and the current monitor cast to FILE *.
      monitor_fprintf() casts it right back, and is otherwise identical to
      monitor_printf().  The type-punning is ugly.
      
      New qemu_fprintf() and qemu_vprintf() address this need without type
      punning: they are like fprintf() and vfprintf(), except they print to
      the current monitor when passed a null FILE *.  The next commits will
      put them to use.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417191805.28198-14-armbru@redhat.com>
      19aaa4c3
    • Markus Armbruster's avatar
      qsp: Simplify how qsp_report() prints · ac7ff4cf
      Markus Armbruster authored
      
      qsp_report() takes an fprintf()-like callback and a FILE * to pass to
      it.
      
      Its only caller hmp_sync_profile() passes monitor_fprintf() and the
      current monitor cast to FILE *.  monitor_fprintf() casts it right
      back, and is otherwise identical to monitor_printf().  The
      type-punning is ugly.
      
      Drop the callback, and call qemu_printf() instead.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417191805.28198-7-armbru@redhat.com>
      ac7ff4cf
    • Markus Armbruster's avatar
      qemu-print: New qemu_printf(), qemu_vprintf() etc. · 637de4db
      Markus Armbruster authored
      
      We commonly want to print to the current monitor if we have one, else
      to stdout/stderr.  For stderr, have error_printf().  For stdout, all
      we have is monitor_vfprintf(), which is rather unwieldy.  We often
      print to stderr just because error_printf() is easier.
      
      New qemu_printf() and qemu_vprintf() do exactly what's needed.  The
      next commits will put them to use.
      
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417190641.26814-12-armbru@redhat.com>
      637de4db
    • Markus Armbruster's avatar
      monitor error: Make printf()-like functions return a value · 679cb8e1
      Markus Armbruster authored
      
      printf() & friends return the number of characters written on success,
      negative value on error.
      
      monitor_printf(), monitor_vfprintf(), monitor_vprintf(),
      error_printf(), error_printf_unless_qmp(), error_vprintf(), and
      error_vprintf_unless_qmp() return void.  Some of them carry a TODO
      comment asking for int instead.
      
      Improve them to return int like printf() does.
      
      This makes our use of monitor_printf() as fprintf_function slightly
      less dirty: the function cast no longer adds a return value that isn't
      there.  It still changes a parameter's pointer type.  That will be
      addressed in a future commit.
      
      monitor_vfprintf() always returns zero.  Improve it to return the
      proper value.
      
      Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20190417190641.26814-11-armbru@redhat.com>
      679cb8e1
  17. Apr 17, 2019
    • Vladimir Sementsov-Ogievskiy's avatar
      util/error: do not free error on error_abort · b922c050
      Vladimir Sementsov-Ogievskiy authored
      
      It would be nice to have Error object not freed away when debugging a
      coredump.
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20190415142519.73060-1-vsementsov@virtuozzo.com>
      [error_printf_unless_qmp() replaced by error_printf()]
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      b922c050
    • Markus Armbruster's avatar
      error: Fix error_report_err(), warn_report_err() hint printing · 4c8b7c8b
      Markus Armbruster authored
      
      Before the from qerror_report() to error_setg(), hints looked like
      this:
      
          qerror_report(QERR_MACRO, ... arguments ...);
          error_printf_unless_qmp(... hint ...);
      
      error_printf_unless_qmp() made perfect sense: it printed exactly when
      qerror_report() did.
      
      After the conversion to error_setg():
      
          error_setg(errp, QERR_MACRO, ... arguments ...);
          error_printf_unless_qmp(... hint ...);
      
      The "unless QMP part" still made some sense; in QMP context, the
      caller generally uses the error as QMP response instead of printing
      it.
      
      However, everything else is wrong.  If the caller handles the error,
      the hint gets printed anyway (unless QMP).  If the caller reports the
      error, the hint gets printed *before* the report (unless QMP) or not
      at all (if QMP).
      
      Commit 50b7b000 fixed this by making hints a member of Error.  It
      kept printing hints with error_printf_unless_qmp():
      
           void error_report_err(Error *err)
           {
      	 error_report("%s", error_get_pretty(err));
          +    if (err->hint) {
          +        error_printf_unless_qmp("%s\n", err->hint->str);
          +    }
      	 error_free(err);
           }
      
      This is wrong.  We should (and now can) print the hint exactly when we
      print the error.
      
      The mistake has since been copied to warn_report_err() in commit
      e43ead1d.
      
      Fix both to use error_printf().
      
      Reported-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Cc: Eric Blake <eblake@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190416153850.5186-1-armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      [Commit message tweaked]
      4c8b7c8b
    • Christophe Fergeau's avatar
      log: Make glib logging go through QEMU · f5852efa
      Christophe Fergeau authored
      
      This commit adds a error_init() helper which calls
      g_log_set_default_handler() so that glib logs (g_log, g_warning, ...)
      are handled similarly to other QEMU logs. This means they will get a
      timestamp if timestamps are enabled, and they will go through the
      HMP monitor if one is configured.
      
      This commit also adds a call to error_init() to the binaries
      installed by QEMU. Since error_init() also calls error_set_progname(),
      this means that *-linux-user, *-bsd-user and qemu-pr-helper messages
      output with error_report, info_report, ... will slightly change: they
      will be prefixed by the binary name.
      
      glib debug messages are enabled through G_MESSAGES_DEBUG similarly to
      the glib default log handler.
      
      At the moment, this change will mostly impact SPICE logging if your
      spice version is >= 0.14.1. With older spice versions, this is not going
      to work as expected, but will not have any ill effect, so this call is
      not conditional on the SPICE version.
      
      Signed-off-by: default avatarChristophe Fergeau <cfergeau@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20190131164614.19209-3-cfergeau@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      f5852efa
  18. Apr 02, 2019
  19. Mar 26, 2019
  20. Mar 22, 2019
Loading