aboutsummaryrefslogtreecommitdiff
path: root/qga/commands-win32.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-07 11:03:59 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-06 10:50:37 +0200
commit287698e50fb2340d9f6436976ac701512cb7c383 (patch)
tree06e5cc5529ee879f76cbf1c6d3154f719188e4cf /qga/commands-win32.c
parent20e4ae117a868c77e3e84147bd1708cdf159f8be (diff)
qga: replace qemu_gettimeofday() with g_get_real_time()
GLib g_get_real_time() is an alternative to gettimeofday() which allows to simplify our code. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220307070401.171986-4-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qga/commands-win32.c')
-rw-r--r--qga/commands-win32.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 3c428213db..15b451f0a4 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -1751,25 +1751,6 @@ static int64_t filetime_to_ns(const FILETIME *tf)
- W32_FT_OFFSET) * 100;
}
-int64_t qmp_guest_get_time(Error **errp)
-{
- SYSTEMTIME ts = {0};
- FILETIME tf;
-
- GetSystemTime(&ts);
- if (ts.wYear < 1601 || ts.wYear > 30827) {
- error_setg(errp, "Failed to get time");
- return -1;
- }
-
- if (!SystemTimeToFileTime(&ts, &tf)) {
- error_setg(errp, "Failed to convert system time: %d", (int)GetLastError());
- return -1;
- }
-
- return filetime_to_ns(&tf);
-}
-
void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp)
{
Error *local_err = NULL;