From 048597dbe5e6f6cae1f371f06645047e5dc53e7e Mon Sep 17 00:00:00 2001 Message-Id: <048597dbe5e6f6cae1f371f06645047e5dc53e7e.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:27 +0200 Subject: [PATCH 012/114] Revert "qga: add windows implementation for guest-set-time" This reverts commit e6768c674f39ab54dd6e9abd64775f9af89953dd. 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 | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 59cc645..92dd7ab 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -309,34 +309,7 @@ int64_t qmp_guest_get_time(Error **errp) void qmp_guest_set_time(int64_t time_ns, Error **errp) { - SYSTEMTIME ts; - FILETIME tf; - LONGLONG time; - - if (time_ns < 0 || time_ns / 100 > INT64_MAX - W32_FT_OFFSET) { - error_setg(errp, "Time %" PRId64 "is invalid", time_ns); - return; - } - - time = time_ns / 100 + W32_FT_OFFSET; - - tf.dwLowDateTime = (DWORD) time; - tf.dwHighDateTime = (DWORD) (time >> 32); - - if (!FileTimeToSystemTime(&tf, &ts)) { - error_setg(errp, "Failed to convert system time %d", (int)GetLastError()); - return; - } - - acquire_privilege(SE_SYSTEMTIME_NAME, errp); - if (error_is_set(errp)) { - return; - } - - if (!SetSystemTime(&ts)) { - error_setg(errp, "Failed to set time to guest: %d", (int)GetLastError()); - return; - } + error_set(errp, QERR_UNSUPPORTED); } GuestLogicalProcessorList *qmp_guest_get_vcpus(Error **errp) -- 1.7.11.7