From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUWY5-00023v-Br for qemu-devel@nongnu.org; Tue, 02 Aug 2016 06:03:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUWXz-0001d7-9F for qemu-devel@nongnu.org; Tue, 02 Aug 2016 06:03:44 -0400 Received: from mx4-phx2.redhat.com ([209.132.183.25]:59809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUWXz-0001ck-15 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 06:03:39 -0400 Date: Tue, 2 Aug 2016 06:03:32 -0400 (EDT) From: Paolo Bonzini Message-ID: <587982650.13014038.1470132212957.JavaMail.zimbra@redhat.com> In-Reply-To: <57A060EC.8080305@cn.fujitsu.com> References: <1469523803-12194-1-git-send-email-caoj.fnst@cn.fujitsu.com> <71a5de12-993f-4e45-9201-797710cb5638@redhat.com> <20160801152905.GB24341@grmbl.mre> <57A060EC.8080305@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] mptsas: Fix a migration compatible issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin Cc: Amit Shah , qemu-devel@nongnu.org, Markus Armbruster , Marcel Apfelbaum , "Michael S. Tsirkin" > Before I send the fix, I did a quick test on linux as following: > > #include > #include > > int main() > { > printf("bool size = %d\n", sizeof(bool)); > } > > > then: > ./a.out > bool size = 1 > > and there is mptsas.c #include "qemu/osdep.h", osdep.h #include > > So, am I missing something? You are missing that the patch is: 1) not portable, because there's no guarantee that sizeof(bool)==1; 2) wrong, because using sizeof within VMSTATE_UNUSED would suggest a dependency of the migration stream on the host---and such a dependency should not be there at all. In fact, the patch is also wrong because old versions of QEMU _do_ need msi_in_use so you need to either generate it or bump the migration version. I'm sending a patch now. Paolo