[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to in
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize |
Date: |
Wed, 5 Jun 2013 15:36:44 +0300 |
On Wed, Jun 05, 2013 at 02:23:03PM +0200, Andreas Färber wrote:
> Am 05.06.2013 14:06, schrieb Michael S. Tsirkin:
> > On Wed, Jun 05, 2013 at 01:32:17PM +0200, Andreas Färber wrote:
> >> Am 05.06.2013 13:10, schrieb Michael S. Tsirkin:
> >>> On Wed, Jun 05, 2013 at 11:50:52AM +0200, Andreas Färber wrote:
> >>>> Am 04.06.2013 20:51, schrieb Paolo Bonzini:
> >>>>> This series changes all PCI devices (the sole to support hotplug
> >>>>> _and_ use MemoryRegions) to do memory_region_del_subregion at
> >>>>> unrealize time, and memory_region_destroy at instance_finalize
> >>>>> time.
> >>>>
> >>>> The general idea looks good.
> >>>>
> >>>> Could you please follow-up with a patch that switches from exit to
> >>>> unrealize?
> >>>
> >>> What do you guys think about changing the name to something
> >>> else e.g. "free" or "destroy"?
> >>
> >> I'm not generally opposed to renaming things, but current unrealize is a
> >> pair with realize, and destroy or free doesn't really fit it's purpose -
> >> that's instance_finalize. Let's CC Anthony.
> >
> > So @instance_init -> instance_alloc
>
> No, allocation happens before instance_init, it only initializes fields
> of the instance, so that name seems good to me.
>
> My ISA realize patches (need to respin after Paolo enabled gus) worked
> towards resolving the DeviceClass::init vs. instance_init ambiguity, so
> once completed only instance_init and class_init would remain as
> "init"s. PCI is a bit more involved, and would collide with this series;
> Jesse's virtio-net config size issue is calling for converting
> VirtioDevice, which might be quicker.
>
> > instance_finalize -> @instance_free?
>
> /me misunderstandable, sorry. It doesn't free the instance either, and
> Java uses "finalize" too and so does .NET iirc.
Well the do not have initialize though, so if someone comes from .NET
background that person will *still* be confused.
I think we should use names that pair well and are not ambiguous:
alloc/free create/destroy init/cleanup (some people do init/uninit)
get/put ...
These are all standard C things with no ambiguity.
> Anyway, my point was, when moving stuff out of exit, we should also
> change the signature to the new one - DeviceState* and (unused) Error**.
> Then we're getting closer to removing the old exit field, and at that
> point renaming individual hooks - if desired - becomes a trivial patch.
>
> Andreas
Why is renaming new hooks related to getting rid of old ones?
> --
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 36/39] virtio-pci: split exit and instance_finalize, (continued)
- [Qemu-devel] [PATCH 36/39] virtio-pci: split exit and instance_finalize, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 37/39] wdt_i6300esb: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 38/39] xen_pt: use instance_finalize instead of exit, Paolo Bonzini, 2013/06/04
- [Qemu-devel] [PATCH 39/39] tpm: move add/del_subregion to realize/unrealize, Paolo Bonzini, 2013/06/04
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Andreas Färber, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Peter Maydell, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Michael S. Tsirkin, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Michael S. Tsirkin, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Anthony Liguori, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Michael S. Tsirkin, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Anthony Liguori, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Michael S. Tsirkin, 2013/06/05
- Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Peter Maydell, 2013/06/05
Re: [Qemu-devel] [PATCH 00/39] Delay destruction of memory regions to instance_finalize, Paolo Bonzini, 2013/06/06