From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLuxi-0005E3-Ac for qemu-devel@nongnu.org; Thu, 12 Feb 2015 09:41:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLuxe-0006fH-5c for qemu-devel@nongnu.org; Thu, 12 Feb 2015 09:41:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLuxd-0006f1-SY for qemu-devel@nongnu.org; Thu, 12 Feb 2015 09:41:46 -0500 Message-ID: <54DCBB97.90409@redhat.com> Date: Thu, 12 Feb 2015 15:41:27 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20150122085127.5276.53895.stgit@PASHA-ISP.def.inno> <20150122085328.5276.86561.stgit@PASHA-ISP.def.inno> <54CB69BE.20803@redhat.com> <000601d0469b$18e96ad0$4abc4070$@Dovgaluk@ispras.ru> In-Reply-To: <000601d0469b$18e96ad0$4abc4070$@Dovgaluk@ispras.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Pavel Dovgaluk , 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 On 12/02/2015 09:08, Pavel Dovgaluk wrote: >> > >> > 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? You can use the existing visitors to clone objects, see qapi_copy_SocketAddress in qemu-char.c. Paolo