On Mon, Dec 25, 2023 at 12:25:56AM +0300, Artem Chernyshev wrote:
virTimeMillisNowRaw() function are invariant now,
so, quite a few checks, dependent on it are become
irrelevant.
Fixes: f5e9bdb87f ("src: replace clock_gettime()/gettimeofday() with
g_get_real_time()")
Signed-off-by: Artem Chernyshev <artem.chernyshev(a)red-soft.ru>
---
src/conf/virdomainjob.c | 7 ++--
src/libxl/libxl_domain.c | 10 ++---
src/libxl/libxl_domain.h | 2 +-
src/libxl/libxl_driver.c | 6 +--
src/nwfilter/nwfilter_dhcpsnoop.c | 18 +++-----
src/qemu/qemu_agent.c | 6 +--
src/qemu/qemu_backup.c | 3 +-
src/qemu/qemu_dbus.c | 3 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domainjob.c | 22 ++++------
src/qemu/qemu_domainjob.h | 4 +-
src/qemu/qemu_driver.c | 10 ++---
src/qemu/qemu_hotplug.c | 6 +--
src/qemu/qemu_migration.c | 4 +-
src/qemu/qemu_nbdkit.c | 3 +-
src/qemu/qemu_process.c | 9 ++--
src/qemu/qemu_tpm.c | 3 +-
src/storage/storage_backend_iscsi_direct.c | 4 +-
src/util/virfdstream.c | 3 +-
src/util/virhostuptime.c | 3 +-
src/util/virtime.c | 48 +++++-----------------
src/yutil/virtime.h | 14 +++----
src/vz/vz_driver.c | 15 +++----
src/vz/vz_utils.c | 16 +++-----
src/vz/vz_utils.h | 2 +-
tools/virsh-domain.c | 12 ++----
26 files changed, 82 insertions(+), 153 deletions(-)
diff --git a/src/util/virtime.c b/src/util/virtime.c
index baf4ce5db7..3d62494109 100644
--- a/src/util/virtime.c
+++ b/src/util/virtime.c
@@ -208,17 +198,10 @@ int virTimeStringThenRaw(unsigned long long when, char *buf)
*
* Retrieves the current system time, in milliseconds since the
* epoch
- *
- * Returns 0 on success, -1 on error with error reported
*/
-int virTimeMillisNow(unsigned long long *now)
+void virTimeMillisNow(unsigned long long *now)
{
- if (virTimeMillisNowRaw(now) < 0) {
- virReportSystemError(errno, "%s",
- _("Unable to get current time"));
- return -1;
- }
- return 0;
+ virTimeMillisNowRaw(now);
This makes this function just a dumb caller to virTimeMillisNowRaw().
That means we can remove that function and change all the callers to
just call virTimeMillisNow.
Also this series does not apply after that long of a time (sorry for the
delay), so please rebase and repost this if you want to get this in.
Thanks,
Martin