From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKTZU-00032b-R2 for qemu-devel@nongnu.org; Mon, 03 Mar 2014 09:10:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKTZN-0004SK-Gl for qemu-devel@nongnu.org; Mon, 03 Mar 2014 09:10:20 -0500 Received: from cantor2.suse.de ([195.135.220.15]:37881 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKTZN-0004SF-AP for qemu-devel@nongnu.org; Mon, 03 Mar 2014 09:10:13 -0500 Message-ID: <53148D3F.70906@suse.de> Date: Mon, 03 Mar 2014 15:10:07 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1393765632-2753-1-git-send-email-marcel.a@redhat.com> <53145E5D.30704@redhat.com> <1393848446.11589.90.camel@localhost.localdomain> <53147BF2.4020108@redhat.com> <1393852662.3882.26.camel@localhost.localdomain> In-Reply-To: <1393852662.3882.26.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC V2 0/9] qemu-machine as a QOM object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , Paolo Bonzini Cc: peter.maydell@linaro.org, peter.crosthwaite@petalogix.com, ehabkost@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, mtosatti@redhat.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com, blauwirbel@gmail.com, quintela@redhat.com, agraf@suse.de, aliguori@amazon.com, edgar.iglesias@gmail.com, scottwood@freescale.com, imammedo@redhat.com, lcapitulino@redhat.com, rth@twiddle.net Am 03.03.2014 14:17, schrieb Marcel Apfelbaum: > On Mon, 2014-03-03 at 13:56 +0100, Paolo Bonzini wrote: >> Il 03/03/2014 13:07, Marcel Apfelbaum ha scritto: >>> I see no reason why not, the main problem I see is the use of those w= rappers >>> or setters/getters, I suspect that the usage will be: >>> 1. global QOM query to get the machine >>> 2. Use this wrappers(getters/setters) to do query/alter the machine. >> >> I think setters should appear only in vl.c. > Conclusion: > 1. It is OK to add getters for QemuMachineState fields in the correspon= ding > header file. They can be used when the caller "knows" the object typ= e. > 2. In order to populate the fields, static setters that access the inte= rnal fields > are also OK - as long as their scope is very small(e.g: vl.c) and no= t code wide. +1 QOM does not prohibit writing methods that are in fact getters or setters. The question we have used as guideline is whether the information of that field is relevant for QMP-based management tools (e.g., ACPI) or duplicating QOM getters/setters needed for internal infrastructure (s390x). Cheers, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg