Received: from eggs.gnu.org ([2001:4830:134:3::10]:53965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLopB-0006ck-91 for qemu-devel@nongnu.org; Thu, 12 Feb 2015 03:08:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLop6-00079g-A0 for qemu-devel@nongnu.org; Thu, 12 Feb 2015 03:08:37 -0500 Received: from mail.ispras.ru ([83.149.199.45]:36183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLop6-00079V-2r for qemu-devel@nongnu.org; Thu, 12 Feb 2015 03:08:32 -0500 From: "Pavel Dovgaluk" References: <20150122085127.5276.53895.stgit@PASHA-ISP.def.inno> <20150122085328.5276.86561.stgit@PASHA-ISP.def.inno> <54CB69BE.20803@redhat.com> In-Reply-To: <54CB69BE.20803@redhat.com> Date: Thu, 12 Feb 2015 11:08:33 +0300 Message-ID: <000601d0469b$18e96ad0$4abc4070$@Dovgaluk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: ru Subject: Re: [Qemu-devel] [RFC PATCH v8 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, mark.burton@greensocs.com, real@ispras.ru, batuzovk@ispras.ru, maria.klimushenkova@ispras.ru, alex.bennee@linaro.org, afaerber@suse.de, fred.konrad@greensocs.com > From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of = Paolo Bonzini > On 22/01/2015 09:53, Pavel Dovgalyuk wrote: > > + if (replay_mode !=3D REPLAY_MODE_PLAY) { > > + evt =3D qemu_input_event_new_key(key, down); > > + if (QTAILQ_EMPTY(&kbd_queue)) { > > + qemu_input_event_send(src, evt); > > + qemu_input_event_sync(); > > + if (replay_mode !=3D REPLAY_MODE_RECORD) { > > + qapi_free_InputEvent(evt); > > + } >=20 > This is wrong. You have different lifetimes for different modes. = Please > make a copy of the event in the implementation of record mode. What is the correct way for cloning the QAPI type? I should invent the cloning visitor or just create a switch for correct = cloning of the InputEvent union? Pavel Dovgalyuk