qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/2] Remove special Win32 code and replace it with osdep functions.
@ 2009-06-23 13:46 Filip Navara
  0 siblings, 0 replies; only message in thread
From: Filip Navara @ 2009-06-23 13:46 UTC (permalink / raw)
  To: qemu-devel

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 <filip.navara@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-23 13:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-23 13:46 [Qemu-devel] [PATCH 2/2] Remove special Win32 code and replace it with osdep functions Filip Navara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).