From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YC1Fj-0001pL-Qy for qemu-devel@nongnu.org; Fri, 16 Jan 2015 02:23:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YC1Fg-0007Iy-Lj for qemu-devel@nongnu.org; Fri, 16 Jan 2015 02:23:31 -0500 Received: from mail.ispras.ru ([83.149.199.45]:57585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YC1Fg-0007HO-7I for qemu-devel@nongnu.org; Fri, 16 Jan 2015 02:23:28 -0500 From: "Pavel Dovgaluk" References: <20150112115944.3504.66763.stgit@PASHA-ISP> <20150112120146.3504.82181.stgit@PASHA-ISP> <54B3BD30.9080407@redhat.com> In-Reply-To: <54B3BD30.9080407@redhat.com> Date: Fri, 16 Jan 2015 10:23:26 +0300 Message-ID: <000001d0315d$5313a3e0$f93aeba0$@Dovgaluk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [RFC PATCH v7 21/21] replay: recording of the user input List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Paolo Bonzini' , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, alex.bennee@linaro.org, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, afaerber@suse.de, fred.konrad@greensocs.com > From: Paolo Bonzini [mailto:pbonzini@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