From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmBc3-0006tz-HO for qemu-devel@nongnu.org; Fri, 11 Sep 2009 15:16:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmBbv-0006rd-4F for qemu-devel@nongnu.org; Fri, 11 Sep 2009 15:16:48 -0400 Received: from [199.232.76.173] (port=54674 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmBbu-0006rC-TK for qemu-devel@nongnu.org; Fri, 11 Sep 2009 15:16:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48826) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmBbt-0005WD-69 for qemu-devel@nongnu.org; Fri, 11 Sep 2009 15:16:41 -0400 Message-ID: <4AAAA214.4030204@redhat.com> Date: Fri, 11 Sep 2009 21:16:36 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1252672351-12937-1-git-send-email-kraxel@redhat.com> <1252672351-12937-6-git-send-email-kraxel@redhat.com> <4AAA5AFD.1020509@redhat.com> <4AAA6591.4030904@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 5/8] ide/pci: convert to qdev. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 09/11/09 17:16, Juan Quintela wrote: > But now we look at savevm.c::vmstate_load_state() > > if (field->flags& VMS_POINTER) { > base_addr = *(void **)base_addr; > } > > And you see this really nice piece of code. Each time that we follow a > pointer, we have to read something for a table, hope that value is > right, and follow it. > > Do you see know why I want to have the minimal amount of pointers > possible to follow? No. Sure, you have to dereference the pointer. I still don't see a problem here. You seem to think this is fragile. Why do you think so? Typechecking missing somewhere? > And yes, I understand why you don't want qdev_create_here() idea, I am > pointing this out to make sure that everybody agrees that not having > qdev_create_here() and having rest of code use more > pointers/malloc/... is the right compromise. I'm sure you'll need VMS_POINTER anyway. There will be corner cases which don't work without. I think the floppy fifo is one of them. It is perfectly fine to avoid the pointer indirection if possible. It isn't the most important thing on earth though. cheers, Gerd