[PATCH v2 2/3] error-report: make real_time_iso8601() public

Vladimir Sementsov-Ogievskiy posted 3 patches 2 months, 1 week ago
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Markus Armbruster <armbru@redhat.com>, Eric Blake <eblake@redhat.com>
There is a newer version of this series
[PATCH v2 2/3] error-report: make real_time_iso8601() public
Posted by Vladimir Sementsov-Ogievskiy 2 months, 1 week ago
To be reused in the following commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
 include/qemu/error-report.h | 6 ++++++
 util/error-report.c         | 3 +--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h
index 3ae2357fda..bcd542a118 100644
--- a/include/qemu/error-report.h
+++ b/include/qemu/error-report.h
@@ -74,4 +74,10 @@ extern bool message_with_timestamp;
 extern bool error_with_guestname;
 extern const char *error_guest_name;
 
+/*
+ * Returns current datetime in ISO 8601 format.
+ * Caller is responsible to g_free() the returned string.
+ */
+char *real_time_iso8601(void);
+
 #endif
diff --git a/util/error-report.c b/util/error-report.c
index 1b17c11de1..d6b7448183 100644
--- a/util/error-report.c
+++ b/util/error-report.c
@@ -169,8 +169,7 @@ static void print_loc(void)
     }
 }
 
-static char *
-real_time_iso8601(void)
+char *real_time_iso8601(void)
 {
     g_autoptr(GDateTime) dt = g_date_time_new_now_utc();
     return g_date_time_format_iso8601(dt);
-- 
2.48.1
Re: [PATCH v2 2/3] error-report: make real_time_iso8601() public
Posted by Markus Armbruster 3 weeks, 1 day ago
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:

> To be reused in the following commit.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> ---
>  include/qemu/error-report.h | 6 ++++++
>  util/error-report.c         | 3 +--
>  2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h
> index 3ae2357fda..bcd542a118 100644
> --- a/include/qemu/error-report.h
> +++ b/include/qemu/error-report.h
> @@ -74,4 +74,10 @@ extern bool message_with_timestamp;
>  extern bool error_with_guestname;
>  extern const char *error_guest_name;
>  
> +/*
> + * Returns current datetime in ISO 8601 format.

Imperative mood, please: Return current ...

> + * Caller is responsible to g_free() the returned string.
> + */
> +char *real_time_iso8601(void);
> +
>  #endif
> diff --git a/util/error-report.c b/util/error-report.c
> index 1b17c11de1..d6b7448183 100644
> --- a/util/error-report.c
> +++ b/util/error-report.c
> @@ -169,8 +169,7 @@ static void print_loc(void)
>      }
>  }
>  
> -static char *
> -real_time_iso8601(void)
> +char *real_time_iso8601(void)
>  {
>      g_autoptr(GDateTime) dt = g_date_time_new_now_utc();
>      return g_date_time_format_iso8601(dt);

With the comment tweak:
Reviewed-by: Markus Armbruster <armbru@redhat.com>