Remove special Win32 code and replace it with osdep functions.
PATCH 2/2 Remove special Win32 code and replace it with osdep functions.
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 <[email protected]>
--- savevm.c | 23 ++--------------------- 1 files changed, 2 insertions(+), 21 deletions(-)
savevm.c +2 -21
@@ -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 ) {
Signature · 1 line
1.6.3.msysgit.0