All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Wu <wudxw@linux.vnet.ibm.com>
To: "Hervé Poussineau" <hpoussin@reactos.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] net: store correct timestamp in dump file
Date: Mon, 07 Nov 2011 14:44:04 +0800	[thread overview]
Message-ID: <4EB77E34.7080802@linux.vnet.ibm.com> (raw)
In-Reply-To: <1320616325-22073-2-git-send-email-hpoussin@reactos.org>

On 11/07/2011 05:52 AM, Hervé Poussineau wrote:
> Signed-off-by: Hervé Poussineau<hpoussin@reactos.org>
> ---
>   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;

  reply	other threads:[~2011-11-07  6:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-06 21:52 [Qemu-devel] [PATCH 1/2] net: truncate output file when using dump backend Hervé Poussineau
2011-11-06 21:52 ` [Qemu-devel] [PATCH 2/2] net: store correct timestamp in dump file Hervé Poussineau
2011-11-07  6:44   ` Mark Wu [this message]
2011-11-07 10:08 ` [Qemu-devel] [PATCH 1/2] net: truncate output file when using dump backend Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EB77E34.7080802@linux.vnet.ibm.com \
    --to=wudxw@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=hpoussin@reactos.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.