summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-03-16 23:28:59 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-03-16 23:28:59 +0100
commit4c74173c15d2bf2ff498dba6ce88728978f42a72 (patch)
tree34a85cefe6bdc7269000b1cdc62ced6a1f7ee637 /hw
parent4d7e03e61d7a27f0a80e837f945d896c4a7f0cce (diff)
downloadqemu-4c74173c15d2bf2ff498dba6ce88728978f42a72.tar.gz
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 <peter@lekensteyn.nl>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/dump.c5
1 files changed, 2 insertions, 3 deletions
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;
}