From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkFsF-0008D4-Pn for qemu-devel@nongnu.org; Wed, 05 Jun 2013 11:43:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkFs8-00045z-Qm for qemu-devel@nongnu.org; Wed, 05 Jun 2013 11:43:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkFs8-00045u-Jy for qemu-devel@nongnu.org; Wed, 05 Jun 2013 11:43:36 -0400 Date: Wed, 5 Jun 2013 18:44:07 +0300 From: "Michael S. Tsirkin" Message-ID: <20130605154407.GA26579@redhat.com> References: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> <51AF09FC.50308@suse.de> <20130605111044.GL31830@redhat.com> <877gi867ny.fsf@codemonkey.ws> <20130605142718.GA20565@redhat.com> <8761xsr2ry.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <8761xsr2ry.fsf@codemonkey.ws> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= , qemu-devel@nongnu.org On Wed, Jun 05, 2013 at 10:33:05AM -0500, Anthony Liguori wrote: > "Michael S. Tsirkin" writes: >=20 > > On Wed, Jun 05, 2013 at 07:53:05AM -0500, Anthony Liguori wrote: > >> "Michael S. Tsirkin" writes: > >>=20 > >> > On Wed, Jun 05, 2013 at 11:50:52AM +0200, Andreas F=E4rber wrote: > >> >> Am 04.06.2013 20:51, schrieb Paolo Bonzini: > >> >> > This series changes all PCI devices (the sole to support hotplu= g > >> >> > _and_ use MemoryRegions) to do memory_region_del_subregion at > >> >> > unrealize time, and memory_region_destroy at instance_finalize > >> >> > time. > >> >>=20 > >> >> The general idea looks good. > >> >>=20 > >> >> Could you please follow-up with a patch that switches from exit t= o > >> >> unrealize? > >> > > >> > What do you guys think about changing the name to something > >> > else e.g. "free" or "destroy"? > >>=20 > >> exit/unrealize !=3D free/destroy. > >>=20 > >> You don't actually free anything. See 00/39 in this series for a > >> precise description. > > > > That's where I got this. It says: > > "instance_finalize will reclaim the memory" >=20 > I'm not sure what you're talking about. >=20 > There are two callbacks: exit and instance_finalize. >=20 > exit() is called to disconnect the device to the guest. Andreas is > proposing renaming it to unrealize. >=20 > Ideally, reset() would be implemented as a combination of calls to > unrealize() + realize() (or exit() + init() as they are named today). >=20 > Nothing should be freed in exit. >=20 > instance_finalize is only called once, before the object is freed(). I= t > should be used to release resources associated with the object. >=20 > Paolo is using this to destroy memory regions. Normally this callback > is never used because child objects are automatically handled by QOM. > > "finalize" is the standard name of the hook that gets called before > garbage collection as Andreas previously pointed out. I am simply asking for function names to tell us what they do, not when they are called. > It's this way in > Java, Python, C#, etc. Well bringing in idioms from more languages just serves to confuse readers even more. > Regards, >=20 > Anthony Liguori >=20 > > > >> > http://dictionary.cambridge.org/spellcheck/american-english/?q=3Du= nrealize > >>=20 > >> English is a fluid language. I wouldn't worry too much about that. > >>=20 > >> Regards, > >>=20 > >> Anthony Liguori > > > > Well I am not worried about English at all. > > I'm just confused by the function naming, and > > I think it can be improved. > > > > Can we have names actually say what a function is > > doing? There's no need to use ambiguous terms and then > > document what they mean. > > > > > >> > I can do it easily if people agree. > >> > > >> >> use BUS(), PCI_DEVICE() etc. to hide this. > >> >>=20 > >> >> Andreas > >> >>=20 > >> >> --=20 > >> >> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, German= y > >> >> GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG = N=FCrnberg