qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v7 21/21] replay: recording of the user inpu


From: Pavel Dovgaluk
Subject: Re: [Qemu-devel] [RFC PATCH v7 21/21] replay: recording of the user input
Date: Fri, 16 Jan 2015 10:23:26 +0300

> From: Paolo Bonzini [mailto:address@hidden
> 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

[Prev in Thread] Current Thread [Next in Thread]