From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNIxo-0003pt-QZ for qemu-devel@nongnu.org; Mon, 07 Nov 2011 01:45:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RNIxl-0003SE-Oc for qemu-devel@nongnu.org; Mon, 07 Nov 2011 01:45:47 -0500 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:41198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RNIxl-0003Ry-87 for qemu-devel@nongnu.org; Mon, 07 Nov 2011 01:45:45 -0500 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Nov 2011 06:34:02 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA76i6n92584642 for ; Mon, 7 Nov 2011 17:44:13 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA76i6RQ028707 for ; Mon, 7 Nov 2011 17:44:06 +1100 Message-ID: <4EB77E34.7080802@linux.vnet.ibm.com> Date: Mon, 07 Nov 2011 14:44:04 +0800 From: Mark Wu MIME-Version: 1.0 References: <1320616325-22073-1-git-send-email-hpoussin@reactos.org> <1320616325-22073-2-git-send-email-hpoussin@reactos.org> In-Reply-To: <1320616325-22073-2-git-send-email-hpoussin@reactos.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/2] net: store correct timestamp in dump file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= Cc: Anthony Liguori , qemu-devel@nongnu.org On 11/07/2011 05:52 AM, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau > --- > net/dump.c | 7 ++++++- > 1 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/net/dump.c b/net/dump.c > index 8132411..4b48d48 100644 > --- a/net/dump.c > +++ b/net/dump.c > @@ -30,6 +30,7 @@ > > typedef struct DumpState { > VLANClientState nc; > + int64_t start_ts; > int fd; > int pcap_caplen; > } DumpState; > @@ -70,7 +71,7 @@ static ssize_t dump_receive(VLANClientState *nc, const uint8_t *buf, size_t size > ts = muldiv64(qemu_get_clock_ns(vm_clock), 1000000, get_ticks_per_sec()); I agree that using host time as timestamp is more reasonable than the virtual clock because in most cases rtc for guest is based on host time not virtual clock. I think we can simply use "host_clock" instead of "vm_clock" to achieve that. It will use the same time as host no matter what option is specified for guest's rtc. With your patch, the time stamp will keep the same as the choice of guest rtc, which is utc default. - ts = muldiv64(qemu_get_clock_ns(vm_clock), 1000000, get_ticks_per_sec()); + ts = muldiv64(qemu_get_clock_ns(host_clock), 1000000, get_ticks_per_sec()); caplen = size > s->pcap_caplen ? s->pcap_caplen : size;