From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukl5U-0005Bm-3n for qemu-devel@nongnu.org; Thu, 06 Jun 2013 21:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ukl5T-0002gZ-6z for qemu-devel@nongnu.org; Thu, 06 Jun 2013 21:03:28 -0400 Received: from mail-qe0-f45.google.com ([209.85.128.45]:51538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ukl5T-0002gQ-28 for qemu-devel@nongnu.org; Thu, 06 Jun 2013 21:03:27 -0400 Received: by mail-qe0-f45.google.com with SMTP id q19so2380140qeb.18 for ; Thu, 06 Jun 2013 18:03:26 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51B13151.10709@redhat.com> Date: Thu, 06 Jun 2013 21:03:13 -0400 From: Paolo Bonzini MIME-Version: 1.0 References: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> <51AF09FC.50308@suse.de> In-Reply-To: <51AF09FC.50308@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit 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: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: qemu-devel@nongnu.org, mst@redhat.com Il 05/06/2013 05:50, Andreas Färber ha scritto: > 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? I can add it to the queue, but I have at least 4 pending series. > Also I notice some patches are accessing parent fields directly - please > use BUS(), PCI_DEVICE() etc. to hide this. I'm always using them. For example: +static void intel_hda_instance_finalize(Object *obj) +{ + PCIDevice *pci = PCI_DEVICE(obj); + IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci); What I'm not doing, is adding new cast macros---one thing at a time. Paolo