From: Filip Navara <filip.navara@gmail.com>
To: qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <E1MJ6Ki-00049a-CR@lists.gnu.org> (raw)
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
reply other threads:[~2009-06-23 13:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1MJ6Ki-00049a-CR@lists.gnu.org \
--to=filip.navara@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).