From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48831 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcQlW-0007tD-BN for qemu-devel@nongnu.org; Mon, 10 Jan 2011 18:03:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcQlR-0002pK-7D for qemu-devel@nongnu.org; Mon, 10 Jan 2011 18:03:06 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]:40285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcQlR-0002p9-4e for qemu-devel@nongnu.org; Mon, 10 Jan 2011 18:03:01 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e6.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p0AMmMcY009183 for ; Mon, 10 Jan 2011 17:48:24 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 1FEE04DE803E for ; Mon, 10 Jan 2011 17:59:59 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0AN2w58312126 for ; Mon, 10 Jan 2011 18:02:58 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0AN2wkJ031306 for ; Mon, 10 Jan 2011 18:02:58 -0500 Message-ID: <4D2B8FF8.7070600@linux.vnet.ibm.com> Date: Mon, 10 Jan 2011 17:02:16 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 28/35] kvm: x86: Introduce kvmclock device to save/restore its state References: <4D2B6CB5.9050602@codemonkey.ws> <4D2B74D8.4080309@web.de> <4D2B8662.9060909@web.de> In-Reply-To: <4D2B8662.9060909@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Glauber Costa , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org On 01/10/2011 04:21 PM, Jan Kiszka wrote: > Am 10.01.2011 22:06, Jan Kiszka wrote: > >>> kvmclock should be created with >>> kvm_state as a parameter and kvm_vm_ioctl() is passed the stored >>> reference. Taking a global reference to kvm_state in machine_init is >>> not a bad thing, obviously the machine initialization function needs >>> access to the kvm_state. >>> >> This would also require changing sysbus interfaces for the sake of KVM's >> "abstraction". If this is the only way forward, I could look into this. >> > Actually, there is already a channel to pass pointers to qdev devices: > the pointer property hack. I'm not sure we should contribute to its user > base or take the chance for a cleanup, but we are not alone with this > requirement. Point below remains valid, though. > It probably makes sense to have a KVMBus and not pass it as a property but rather have it access it from the KvmBusState. Regards, Anthony Liguori > >> Still, I do not see any benefit for the affected code. You then either >> need to "steal" a kvm_state reference from the first cpu or introduce a >> marvelous interface like kvm_get_state() to make this work from outside >> of the KVM core. >> >> > Jan >