qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/2] Remove special Win32 code and replace it with o


From: Filip Navara
Subject: [Qemu-devel] [PATCH 2/2] Remove special Win32 code and replace it with osdep functions.
Date: Tue, 23 Jun 2009 13:46:46 -0000

The whole code in the #ifndef _WIN32 block could probably be removed too. No 
socket or other included functions are used in the savevm.c file.

Signed-off-by: Filip Navara <address@hidden>
---
 savevm.c |   23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/savevm.c b/savevm.c
index 17da35a..f10d7f9 100644
--- a/savevm.c
+++ b/savevm.c
@@ -70,15 +70,6 @@
 #endif
 #endif
 
-#ifdef _WIN32
-#include <windows.h>
-#include <malloc.h>
-#include <sys/timeb.h>
-#include <mmsystem.h>
-#define getopt_long_only getopt_long
-#define memalign(align, size) malloc(size)
-#endif
-
 #include "qemu-common.h"
 #include "hw/hw.h"
 #include "net.h"
@@ -1073,11 +1064,7 @@ void do_savevm(Monitor *mon, const char *name)
     QEMUFile *f;
     int saved_vm_running;
     uint32_t vm_state_size;
-#ifdef _WIN32
-    struct _timeb tb;
-#else
-    struct timeval tv;
-#endif
+    qemu_timeval tv;
 
     bs = get_bs_snapshots();
     if (!bs) {
@@ -1108,15 +1095,9 @@ void do_savevm(Monitor *mon, const char *name)
     }
 
     /* fill auxiliary fields */
-#ifdef _WIN32
-    _ftime(&tb);
-    sn->date_sec = tb.time;
-    sn->date_nsec = tb.millitm * 1000000;
-#else
-    gettimeofday(&tv, NULL);
+    qemu_gettimeofday(&tv);
     sn->date_sec = tv.tv_sec;
     sn->date_nsec = tv.tv_usec * 1000;
-#endif
     sn->vm_clock_nsec = qemu_get_clock(vm_clock);
 
     if (bdrv_get_info(bs, bdi) < 0 || bdi->vm_state_offset <= 0) {
-- 
1.6.3.msysgit.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]