From 4c74173c15d2bf2ff498dba6ce88728978f42a72 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 16 Mar 2014 23:28:59 +0100 Subject: usbdump: fix start time offset of capture There is still a discrepancy (seen 300 ms and 600 ms), but it is better than completely a difference equal to the uptime. Signed-off-by: Peter Wu --- hw/usb/dump.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hw') diff --git a/hw/usb/dump.c b/hw/usb/dump.c index 26af6dff59..2c94c6426d 100644 --- a/hw/usb/dump.c +++ b/hw/usb/dump.c @@ -432,10 +432,9 @@ int usb_dump_init(UsbDumpState *s, const char *filename) s->fd = fd; s->pcap_caplen = snaplen; - // FIXME: timing is incorrect, this should be set to the start time of the - // host, not the current time. Otherwise the clock is completely off when - // adding a device in the monitor. s->start_ts = qemu_clock_get_us(QEMU_CLOCK_HOST); + /* make the timestamp really point to the moment where the VM booted */ + s->start_ts -= qemu_clock_get_us(QEMU_CLOCK_VIRTUAL); return 0; } -- cgit v1.2.1