From mboxrd@z Thu Jan 1 00:00:00 1970 From: Blue Swirl Subject: Re: [Qemu-devel] [PATCH 28/35] kvm: x86: Introduce kvmclock device to save/restore its state Date: Fri, 21 Jan 2011 16:37:08 +0000 Message-ID: References: <4D2B6CB5.9050602@codemonkey.ws> <4D2B74D8.4080309@web.de> <4D2B8662.9060909@web.de> <4D2C60FB.7030009@linux.vnet.ibm.com> <4D2D80ED.8030405@redhat.com> <4D2D82EE.20002@siemens.com> <4D35A39A.8000801@siemens.com> <4D35ABF8.9050700@linux.vnet.ibm.com> <4D35B521.3090601@siemens.com> <4D35B6DD.1020005@linux.vnet.ibm.com> <4D3717E7.3010105@linux.vnet.ibm.com> <4D38017D.2020401@siemens.com> <4D3947D2.7070802@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jan Kiszka , Anthony Liguori , Markus Armbruster , "kvm@vger.kernel.org" , Glauber Costa , Marcelo Tosatti , "qemu-devel@nongnu.org" , Avi Kivity To: Gerd Hoffmann Return-path: Received: from mail-px0-f174.google.com ([209.85.212.174]:60552 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754166Ab1AUQh3 convert rfc822-to-8bit (ORCPT ); Fri, 21 Jan 2011 11:37:29 -0500 Received: by pxi15 with SMTP id 15so319719pxi.19 for ; Fri, 21 Jan 2011 08:37:28 -0800 (PST) In-Reply-To: <4D3947D2.7070802@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jan 21, 2011 at 8:46 AM, Gerd Hoffmann wrot= e: > =C2=A0Hi, > >> By the way, we don't have a QEMUState but instead use globals. > > /me wants to underline this. > > IMO it is absolutely pointless to worry about ways to pass around kvm= _state. > =C2=A0There never ever will be a serious need for that. > > We can stick with the current model of keeping global state in global > variables. =C2=A0And just do the same with kvm_state. > > Or we can move to have all state in a QEMUState struct which we'll pa= ss > around basically everywhere. =C2=A0Then we can simply embed or refere= nce > kvm_state there. > > I'd tend to stick with the global variables as I don't see the point = in > having a QEMUstate. =C2=A0I doubt we'll ever see two virtual machines= driven by a > single qemu process. =C2=A0YMMV. Global variables are signs of a poor design. QEMUState would not help that, instead more specific structures should be designed, much like what I've proposed for KVMState. Some of these new structures should be even passed around when it makes sense. But I'd not start kvm_state redesign around global variables or QEMUSta= te. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36804 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PgJzP-0006Jd-FH for qemu-devel@nongnu.org; Fri, 21 Jan 2011 11:37:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PgJzO-0000xk-2k for qemu-devel@nongnu.org; Fri, 21 Jan 2011 11:37:31 -0500 Received: from mail-px0-f173.google.com ([209.85.212.173]:44811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PgJzN-0000xb-TE for qemu-devel@nongnu.org; Fri, 21 Jan 2011 11:37:30 -0500 Received: by pxi16 with SMTP id 16so366909pxi.4 for ; Fri, 21 Jan 2011 08:37:28 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4D3947D2.7070802@redhat.com> References: <4D2B6CB5.9050602@codemonkey.ws> <4D2B74D8.4080309@web.de> <4D2B8662.9060909@web.de> <4D2C60FB.7030009@linux.vnet.ibm.com> <4D2D80ED.8030405@redhat.com> <4D2D82EE.20002@siemens.com> <4D35A39A.8000801@siemens.com> <4D35ABF8.9050700@linux.vnet.ibm.com> <4D35B521.3090601@siemens.com> <4D35B6DD.1020005@linux.vnet.ibm.com> <4D3717E7.3010105@linux.vnet.ibm.com> <4D38017D.2020401@siemens.com> <4D3947D2.7070802@redhat.com> From: Blue Swirl Date: Fri, 21 Jan 2011 16:37:08 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 28/35] kvm: x86: Introduce kvmclock device to save/restore its state Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "kvm@vger.kernel.org" , Jan Kiszka , Glauber Costa , Marcelo Tosatti , Markus Armbruster , "qemu-devel@nongnu.org" , Anthony Liguori , Avi Kivity On Fri, Jan 21, 2011 at 8:46 AM, Gerd Hoffmann wrote: > =C2=A0Hi, > >> By the way, we don't have a QEMUState but instead use globals. > > /me wants to underline this. > > IMO it is absolutely pointless to worry about ways to pass around kvm_sta= te. > =C2=A0There never ever will be a serious need for that. > > We can stick with the current model of keeping global state in global > variables. =C2=A0And just do the same with kvm_state. > > Or we can move to have all state in a QEMUState struct which we'll pass > around basically everywhere. =C2=A0Then we can simply embed or reference > kvm_state there. > > I'd tend to stick with the global variables as I don't see the point in > having a QEMUstate. =C2=A0I doubt we'll ever see two virtual machines dri= ven by a > single qemu process. =C2=A0YMMV. Global variables are signs of a poor design. QEMUState would not help that, instead more specific structures should be designed, much like what I've proposed for KVMState. Some of these new structures should be even passed around when it makes sense. But I'd not start kvm_state redesign around global variables or QEMUState.