[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v8 21/21] replay: recording of the user inpu
From: |
Pavel Dovgaluk |
Subject: |
Re: [Qemu-devel] [RFC PATCH v8 21/21] replay: recording of the user input |
Date: |
Thu, 12 Feb 2015 11:08:33 +0300 |
> From: Paolo Bonzini [mailto:address@hidden On Behalf Of Paolo Bonzini
> On 22/01/2015 09:53, Pavel Dovgalyuk wrote:
> > + if (replay_mode != REPLAY_MODE_PLAY) {
> > + evt = 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 != REPLAY_MODE_RECORD) {
> > + qapi_free_InputEvent(evt);
> > + }
>
> 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