Commit 4c279bdf3ae80ab194c2f8b9d27680fb4e6841a8
1 parent
3dc1cb34
win32 compilation fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2111 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
10 additions
and
0 deletions
vl.c
| ... | ... | @@ -4539,7 +4539,11 @@ void do_savevm(const char *name) |
| 4539 | 4539 | BlockDriverInfo bdi1, *bdi = &bdi1; |
| 4540 | 4540 | QEMUFile *f; |
| 4541 | 4541 | int saved_vm_running; |
| 4542 | +#ifdef _WIN32 | |
| 4543 | + struct _timeb tb; | |
| 4544 | +#else | |
| 4542 | 4545 | struct timeval tv; |
| 4546 | +#endif | |
| 4543 | 4547 | |
| 4544 | 4548 | bs = get_bs_snapshots(); |
| 4545 | 4549 | if (!bs) { |
| ... | ... | @@ -4567,9 +4571,15 @@ void do_savevm(const char *name) |
| 4567 | 4571 | } |
| 4568 | 4572 | |
| 4569 | 4573 | /* fill auxiliary fields */ |
| 4574 | +#ifdef _WIN32 | |
| 4575 | + _ftime(&tb); | |
| 4576 | + sn->date_sec = tb.time; | |
| 4577 | + sn->date_nsec = tb.millitm * 1000000; | |
| 4578 | +#else | |
| 4570 | 4579 | gettimeofday(&tv, NULL); |
| 4571 | 4580 | sn->date_sec = tv.tv_sec; |
| 4572 | 4581 | sn->date_nsec = tv.tv_usec * 1000; |
| 4582 | +#endif | |
| 4573 | 4583 | sn->vm_clock_nsec = qemu_get_clock(vm_clock); |
| 4574 | 4584 | |
| 4575 | 4585 | if (bdrv_get_info(bs, bdi) < 0 || bdi->vm_state_offset <= 0) { | ... | ... |