> From: Paolo Bonzini [mailto:pbonz...@redhat.com]
> On 12/01/2015 13:01, Pavel Dovgalyuk wrote:
> > +void qemu_input_event_send(QemuConsole *src, InputEvent *evt)
> >  {
> > -    QemuInputHandlerState *s;
> > -
> >      if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
> >          return;
> >      }
> >
> > +    if (replay_mode == REPLAY_MODE_PLAY) {
> > +        /* Nothing */
> > +    } else if (replay_mode == REPLAY_MODE_RECORD) {
> > +        replay_add_input_event(evt);
> > +    } else {
> > +        qemu_input_event_send_impl(src, evt);
> > +    }
> 
> Similar to other cases, please wrap this into a single function,
> something like
> 
>     if (replay_handle_input_event(evt)) {
>         return;
>     }
> 
>     /* ... original contents of qemu_input_event_send ... */

I can wrap this, but cannot get rid of _impl function.
In replay mode we have to make two things:
 - Deny real user imput (qemu_input_event_send should do nothing)
 - Read input from the log (qemu_input_event_send should process read data)

Pavel Dovgalyuk


Reply via email to