From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [Qemu-devel] [PATCH 28/35] kvm: x86: Introduce kvmclock device to save/restore its state Date: Tue, 11 Jan 2011 09:00:05 +0100 Message-ID: <4D2C0E05.605@redhat.com> References: <4D2B6CB5.9050602@codemonkey.ws> <4D2B74D8.4080309@web.de> <4D2B8662.9060909@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , Marcelo Tosatti , Anthony Liguori , Glauber Costa , qemu-devel@nongnu.org, kvm@vger.kernel.org To: Jan Kiszka Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:42326 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753947Ab1AKH7k (ORCPT ); Tue, 11 Jan 2011 02:59:40 -0500 Received: by wyb28 with SMTP id 28so20199120wyb.19 for ; Mon, 10 Jan 2011 23:59:39 -0800 (PST) In-Reply-To: <4D2B8662.9060909@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On 01/10/2011 11: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. The pointer property uses, at least last time I checked, were all: 1) for a CPU (apic, etrax interrupt controller) 2) for a device (sparc IIRC) 3) useless (smbus_eeprom.c) So adding a fourth kind is not really a good idea, I think. Paolo