From 02aa4b2203ea682d6d91fc0e1edbd6f980d11115 Mon Sep 17 00:00:00 2001 Message-Id: <02aa4b2203ea682d6d91fc0e1edbd6f980d11115.1367947969.git.minovotn@redhat.com> In-Reply-To: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> References: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> From: Michal Novotny Date: Tue, 7 May 2013 18:36:30 +0200 Subject: [PATCH 013/114] Revert "qga: add windows implementation for guest-get-time" This reverts commit 8c11cf94f8b05deac0a8122859de025aac6eb5ce. Reverting as asked by Laszlo in message <51892739.2030807@redhat.com> because of the ordering issue (most likely) related to supersed testing. Signed-off-by: Michal Novotny --- qga/commands-win32.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 92dd7ab..da3eb2a 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -22,12 +22,6 @@ #define SHTDN_REASON_FLAG_PLANNED 0x80000000 #endif -/* multiple of 100 nanoseconds elapsed between windows baseline - * (1/1/1601) and Unix Epoch (1/1/1970), accounting for leap years */ -#define W32_FT_OFFSET (10000000ULL * 60 * 60 * 24 * \ - (365 * (1970 - 1601) + \ - (1970 - 1601) / 4 - 3)) - static void acquire_privilege(const char *name, Error **err) { HANDLE token; @@ -286,25 +280,8 @@ GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **err) int64_t qmp_guest_get_time(Error **errp) { - SYSTEMTIME ts = {0}; - int64_t time_ns; - 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; - } - - time_ns = ((((int64_t)tf.dwHighDateTime << 32) | tf.dwLowDateTime) - - W32_FT_OFFSET) * 100; - - return time_ns; + error_set(errp, QERR_UNSUPPORTED); + return -1; } void qmp_guest_set_time(int64_t time_ns, Error **errp) -- 1.7.11.7