Re: [Qemu-devel] [PATCH v2 12/12] replay: assert time only goes forward

2017-04-05 Thread Alex Bennée
Paolo Bonzini writes: > On 05/04/2017 15:33, Pavel Dovgalyuk wrote: >>> + >>> +/* Time can only go forward */ >>> +assert(diff >= 0); >>> + >>> if (diff > 0) { >> This "if" is useless then. >> > > It isn't, "diff == 0" can happen. In my previous patchset I actually outp

Re: [Qemu-devel] [PATCH v2 12/12] replay: assert time only goes forward

2017-04-05 Thread Paolo Bonzini
On 05/04/2017 15:33, Pavel Dovgalyuk wrote: >> + >> +/* Time can only go forward */ >> +assert(diff >= 0); >> + >> if (diff > 0) { > This "if" is useless then. > It isn't, "diff == 0" can happen. Paolo

Re: [Qemu-devel] [PATCH v2 12/12] replay: assert time only goes forward

2017-04-05 Thread Pavel Dovgalyuk
> From: Alex Bennée [mailto:alex.ben...@linaro.org] > > If we find ourselves trying to add an event to the log where time has > gone backwards it is because a vCPU event has occurred and the > main-loop is not yet aware of time moving forward. This should not > happen and if it does its better to

[Qemu-devel] [PATCH v2 12/12] replay: assert time only goes forward

2017-04-05 Thread Alex Bennée
If we find ourselves trying to add an event to the log where time has gone backwards it is because a vCPU event has occurred and the main-loop is not yet aware of time moving forward. This should not happen and if it does its better to fail early than generate a log that will have weird behaviour.