From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34869 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2RRO-0006a6-Jo for qemu-devel@nongnu.org; Wed, 23 Mar 2011 13:01:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2RRN-0002gL-GV for qemu-devel@nongnu.org; Wed, 23 Mar 2011 13:01:50 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:43037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2RRN-0002gH-Dp for qemu-devel@nongnu.org; Wed, 23 Mar 2011 13:01:49 -0400 Received: by ywl41 with SMTP id 41so4195172ywl.4 for ; Wed, 23 Mar 2011 10:01:48 -0700 (PDT) Message-ID: <4D8A276C.3000408@codemonkey.ws> Date: Wed, 23 Mar 2011 12:01:32 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 11/11] test-vmstate: add test case to verify we don't change VMState References: <1300839376-22520-1-git-send-email-aliguori@us.ibm.com> <1300839376-22520-12-git-send-email-aliguori@us.ibm.com> <4D89EABE.50204@codemonkey.ws> <4D8A0947.5080809@codemonkey.ws> <4D8A1F6F.8060003@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Jan Kiszka , qemu-devel@nongnu.org, quintela@redhat.com On 03/23/2011 11:45 AM, Peter Maydell wrote: > On 23 March 2011 16:27, Anthony Liguori wrote: >> Migration uses the VMStateDescription name as a section identifier. The >> section identifiers MUST be unique for a given device. Otherwise, if both >> devices are present, migration fails miserably. > So how does it work if you have two devices of the same type > in the system? I'd assumed that the unique identifier would > be one based on the actually instantiated devices. It's a combination of the section name + a device instance ID that has some magic behind making it unique and stable. But instance ID is not unique on it's own. >> It also means that if the >> wrong devices are created on the destination, instead of predictable >> failure, you get unpredictable guest corruption. >> >> The Right Way to support what you're describing above is to have a single >> VMStateField array and two VMStateDescriptions. IOW: > This doesn't make sense because it's decoupling the information > about minimum version ID etc (in the VMStateDescription) from > the information about which fields are in which version (which > is in the VMStateField array when it's initialised via > VMSTATE_*_V() macros). So although you get to avoid duplicating > all the fields in the arrangement you suggest you still end > up with version_id, minimum_version_id etc being duplicated > and needing to stay in sync. So maybe we just need to remove name from VMStateDescription and force it to come from DeviceInfo. Regards, Anthony Liguori > -- PMM >