[libvirt] [PATCH 11/12] src: replace gmtime_r/localtime_r/strftime with GDateTime

Pavel Hrdina phrdina at redhat.com
Tue Jan 14 15:22:39 UTC 2020


On Fri, Jan 10, 2020 at 03:41:15PM +0000, Daniel P. Berrangé wrote:
> gmtime_r/localtime_r are mostly used in combination with
> strftime to format timestamps in libvirt. This can all
> be replaced with GDateTime resulting in simpler code
> that is also more portable.
> 
> There is some boundary condition problem in parsing POSIX
> timezone offsets in GLib which tickles our test suite.
> The test suite is hacked to avoid the problem. The upsteam
> GLib bug report is

Missing link to the bug report, it's only in the comment in
virtimetest.c.

> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  src/conf/domain_conf.c       | 11 ++++----
>  src/libxl/libxl_domain.c     | 10 +++----
>  src/qemu/qemu_command.c      | 17 ++++-------
>  src/qemu/qemu_driver.c       | 10 +++----
>  src/util/virtime.c           | 35 ++++-------------------
>  tests/qemuxml2argvmock.c     | 12 ++++----
>  tests/virtimetest.c          | 39 +++++++++++++------------
>  tools/virsh-checkpoint.c     | 20 +++++--------
>  tools/virsh-domain-monitor.c | 14 ++++-----
>  tools/virsh-domain.c         | 13 ++++-----
>  tools/virsh-network.c        | 11 ++++----
>  tools/virsh-snapshot.c       | 19 ++++---------
>  tools/virt-admin.c           | 55 ++++++++----------------------------
>  tools/vsh.c                  | 16 ++++-------
>  14 files changed, 96 insertions(+), 186 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200114/f5df97fd/attachment-0001.sig>


More information about the libvir-list mailing list