Displaying 5 results from an estimated 5 matches for "nbdkit_tvdiff_h".
2019 Sep 30
1
Re: [PATCH nbdkit v2 1/4] common/include: Add function for subtracting struct timeval.
...c inline void
> +subtract_timeval (const struct timeval *x, const struct timeval *y,
> + struct timeval *z)
> +{
> + int64_t usec = tvdiff_usec (x, y);
> +
> + z->tv_sec = usec / 1000000;
> + z->tv_usec = usec % 1000000;
> +}
> +
> #endif /* NBDKIT_TVDIFF_H */
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
2019 Sep 28
0
[PATCH nbdkit v2 1/4] common/include: Add function for subtracting struct timeval.
...nce as another struct timeval. z = y - x. */
+static inline void
+subtract_timeval (const struct timeval *x, const struct timeval *y,
+ struct timeval *z)
+{
+ int64_t usec = tvdiff_usec (x, y);
+
+ z->tv_sec = usec / 1000000;
+ z->tv_usec = usec % 1000000;
+}
+
#endif /* NBDKIT_TVDIFF_H */
--
2.23.0
2020 Oct 17
0
[PATCH nbdkit] common/include/tvdiff.h: Add formal specification.
...struct timeval *z)
{
- int64_t usec = tvdiff_usec (x, y);
+ int64_t usec;
+ if (tvdiff_usec (x, y, &usec) == -1) {
+ z->tv_sec = z->tv_usec = 0;
+ return -1;
+ }
z->tv_sec = usec / 1000000;
z->tv_usec = usec % 1000000;
+ return 0;
}
#endif /* NBDKIT_TVDIFF_H */
diff --git a/filters/rate/bucket.c b/filters/rate/bucket.c
index b3addac6..2accb810 100644
--- a/filters/rate/bucket.c
+++ b/filters/rate/bucket.c
@@ -127,9 +127,7 @@ bucket_run (struct bucket *bucket, uint64_t n, struct timespec *ts)
/* Work out how much time has elapsed since we last added...
2019 Sep 28
9
[PATCH nbdkit v2 0/4] info: Add mode for sending back server time.
v1 was:
https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00361
v2:
- Adds a patch to rename the reflection plugin to the info plugin.
- Adds tests.
Rich.
2019 Sep 28
2
[PATCH nbdkit 1/2] common/include: Add function for subtracting struct timeval.
...nce as another struct timeval. z = y - x. */
+static inline void
+subtract_timeval (const struct timeval *x, const struct timeval *y,
+ struct timeval *z)
+{
+ int64_t usec = tvdiff_usec (x, y);
+
+ z->tv_sec = usec / 1000000;
+ z->tv_usec = usec % 1000000;
+}
+
#endif /* NBDKIT_TVDIFF_H */
--
2.23.0