From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47625 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ON6Vg-0000QG-NA for qemu-devel@nongnu.org; Fri, 11 Jun 2010 11:51:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ON6Ve-0004EP-UO for qemu-devel@nongnu.org; Fri, 11 Jun 2010 11:51:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46943) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ON6Ve-0004E3-NR for qemu-devel@nongnu.org; Fri, 11 Jun 2010 11:51:06 -0400 Subject: Re: [Qemu-devel] [RFC PATCH 3/6] RAMBlock: Add a name field From: Alex Williamson In-Reply-To: <4C11F858.4050904@redhat.com> References: <20100608191447.4451.47795.stgit@localhost.localdomain> <4C10A106.1050108@redhat.com> <1276180408.2992.12.camel@x201> <201006101549.14094.paul@codesourcery.com> <1276183304.3100.9.camel@x201> <4C11F858.4050904@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 11 Jun 2010 09:50:31 -0600 Message-ID: <1276271431.3100.26.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: chrisw@redhat.com, kvm@vger.kernel.org, quintela@redhat.com, qemu-devel@nongnu.org, Paul Brook On Fri, 2010-06-11 at 10:48 +0200, Gerd Hoffmann wrote: > On 06/10/10 17:21, Alex Williamson wrote: > > On Thu, 2010-06-10 at 15:49 +0100, Paul Brook wrote: > >>> Ok, we can certainly doname>.instance>\. > >>> It seems like this highlights a deficiency in the vmstate matching > >> > >> Why are you forcing this to be a string? > > > > It seemed like a good way to send an identifier. What do you suggest? > > Do it the same way savevm handles device state? I think it simply puts > a u32 for the instance id. I see, so then we'd have: uint8 - string length (should we decide to go with a variable length) buffer - "name>\" uint32 - instance_id I'm not sure I see the benefit to that since then we'd have to do both a strcmp and an instance_id match. It's unlikely we'll have instance_ids large enough that even make it a space savings in the protocol stream versus "name.id" ("e1000.0"). The trouble I'm running into is that the SaveStateEntry.instance_id is effectively private, and there's no easy way to associate a SaveStateEntry to a device since it passes an opaque pointer, which could be whatever the driver decides it wants. I'm wondering if we should pass the DeviceState pointer in when registering the vmstate so that we can stuff the instance_id into the DeviceInfo. Or maybe DeviceInfo should include a pointer to the SaveStateEntry. It all seems pretty messy. Any thoughts? Alex