diff -r 8817a53c030f tools/ioemu/aes.c --- a/tools/ioemu/aes.c Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/aes.c Fri Sep 28 09:48:44 2007 +0000 @@ -30,7 +30,9 @@ #include "vl.h" #include "aes.h" +#ifndef NDEBUG #define NDEBUG +#endif #include typedef uint32_t u32; diff -r 8817a53c030f tools/ioemu/block-qcow2.c --- a/tools/ioemu/block-qcow2.c Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/block-qcow2.c Fri Sep 28 09:48:44 2007 +0000 @@ -1884,6 +1884,8 @@ static int grow_refcount_table(BlockDriv int new_table_size, new_table_size2, refcount_table_clusters, i, ret; uint64_t *new_table; int64_t table_offset; + int old_table_size; + int64_t old_table_offset; uint64_t data64; uint32_t data32; @@ -1931,10 +1933,14 @@ static int grow_refcount_table(BlockDriv &data32, sizeof(data32)) != sizeof(data32)) goto fail; qemu_free(s->refcount_table); + old_table_offset = s->refcount_table_offset; + old_table_size = s->refcount_table_size; s->refcount_table = new_table; s->refcount_table_size = new_table_size; + s->refcount_table_offset = table_offset; update_refcount(bs, table_offset, new_table_size2, 1); + free_clusters(bs, old_table_offset, old_table_size * sizeof(uint64_t)); return 0; fail: free_clusters(bs, table_offset, new_table_size2); diff -r 8817a53c030f tools/ioemu/cpu-all.h --- a/tools/ioemu/cpu-all.h Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/cpu-all.h Fri Sep 28 09:48:44 2007 +0000 @@ -1010,13 +1010,22 @@ static inline int64_t cpu_get_real_ticks #endif } #else -/* The host CPU doesn't have an easily accessible cycle counter. - Just return a monotonically increasing vlue. This will be totally wrong, - but hopefully better than nothing. */ + +#include +#include + static inline int64_t cpu_get_real_ticks (void) { - static int64_t ticks = 0; - return ticks++; + struct timeval tv; + static int64_t i = 0; + int64_t j; + + gettimeofday(&tv, NULL); + do { + j = (tv.tv_sec * (uint64_t) 1000000) + tv.tv_usec; + } while (i == j); + i = j; + return j; } #endif diff -r 8817a53c030f tools/ioemu/dis-asm.h --- a/tools/ioemu/dis-asm.h Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/dis-asm.h Fri Sep 28 09:48:44 2007 +0000 @@ -13,6 +13,7 @@ #include #include #include +#include "config.h" #define PARAMS(x) x typedef void *PTR; diff -r 8817a53c030f tools/ioemu/hw/acpi.c --- a/tools/ioemu/hw/acpi.c Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/hw/acpi.c Fri Sep 28 09:48:44 2007 +0000 @@ -473,7 +473,7 @@ void piix4_pm_init(PCIBus *bus, int devf { PIIX4PMState *s; uint8_t *pci_conf; - uint32_t pm_io_base, smb_io_base; + uint32_t smb_io_base; s = (PIIX4PMState *)pci_register_device(bus, "PM", sizeof(PIIX4PMState), diff -r 8817a53c030f tools/ioemu/hw/fdc.c --- a/tools/ioemu/hw/fdc.c Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/hw/fdc.c Fri Sep 28 09:48:44 2007 +0000 @@ -176,7 +176,7 @@ typedef struct fd_format_t { uint8_t last_sect; uint8_t max_track; uint8_t max_head; - const unsigned char *str; + const char *str; } fd_format_t; static fd_format_t fd_formats[] = { diff -r 8817a53c030f tools/ioemu/hw/ne2000.c --- a/tools/ioemu/hw/ne2000.c Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/hw/ne2000.c Fri Sep 28 09:48:44 2007 +0000 @@ -207,7 +207,7 @@ static int ne2000_buffer_full(NE2000Stat index = s->curpag << 8; boundary = s->boundary << 8; - if (index <= boundary) + if (index < boundary) avail = boundary - index; else avail = (s->stop - s->start) - (index - boundary); diff -r 8817a53c030f tools/ioemu/hw/pc.c --- a/tools/ioemu/hw/pc.c Thu Sep 27 18:08:11 2007 +0100 +++ b/tools/ioemu/hw/pc.c Fri Sep 28 09:48:44 2007 +0000 @@ -480,7 +480,9 @@ static void pc_init1(uint64_t ram_size, int piix3_devfn = -1; CPUState *env; NICInfo *nd; +#ifdef CONFIG_PASSTHROUGH int rc; +#endif linux_boot = (kernel_filename != NULL);