Skip to content
Snippets Groups Projects
  1. Aug 31, 2023
    • Peter Maydell's avatar
      rtc: Use time_t for passing and returning time offsets · 5ec008a2
      Peter Maydell authored
      
      The functions qemu_get_timedate() and qemu_timedate_diff() take
      and return a time offset as an integer. Coverity points out that
      means that when an RTC device implementation holds an offset
      as a time_t, as the m48t59 does, the time_t will get truncated.
      (CID 1507157, 1517772).
      
      The functions work with time_t internally, so make them use that type
      in their APIs.
      
      Note that this won't help any Y2038 issues where either the device
      model itself is keeping the offset in a 32-bit integer, or where the
      hardware under emulation has Y2038 or other rollover problems.  If we
      missed any cases of the former then hopefully Coverity will warn us
      about them since after this patch we'd be truncating a time_t in
      assignments from qemu_timedate_diff().)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      5ec008a2
  2. Feb 23, 2023
    • Markus Armbruster's avatar
      replay: Simplify setting replay blockers · 0ec8384f
      Markus Armbruster authored
      
      replay_add_blocker() takes an Error *.  All callers pass one created
      like this:
      
          error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, "some feature");
      
      Folding this into replay_add_blocker() simplifies the callers, losing
      a bit of generality we haven't needed in more than six years.
      
      Since there are no other uses of macro QERR_REPLAY_NOT_SUPPORTED,
      replace the remaining one by its expansion, and drop the macro.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20230207075115.1525-10-armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      0ec8384f
  3. Jan 13, 2023
  4. Jan 28, 2022
    • Peter Maydell's avatar
      rtc: Move RTC function prototypes to their own header · 2f93d8b0
      Peter Maydell authored
      
      softmmu/rtc.c defines two public functions: qemu_get_timedate() and
      qemu_timedate_diff().  Currently we keep the prototypes for these in
      qemu-common.h, but most files don't need them.  Move them to their
      own header, a new include/sysemu/rtc.h.
      
      Since the C files using these two functions did not need to include
      qemu-common.h for any other reason, we can remove those include lines
      when we add the include of the new rtc.h.
      
      The license for the .h file follows that of the softmmu/rtc.c
      where both the functions are defined.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      2f93d8b0
  5. Feb 08, 2021
  6. Dec 10, 2020
Loading