From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX6MH-0003S5-Tx for qemu-devel@nongnu.org; Mon, 07 Apr 2014 06:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX6MA-0001m8-2p for qemu-devel@nongnu.org; Mon, 07 Apr 2014 06:00:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX6M9-0001kt-Hl for qemu-devel@nongnu.org; Mon, 07 Apr 2014 06:00:46 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s37A0hDB027713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 Apr 2014 06:00:45 -0400 From: Juan Quintela In-Reply-To: <20140407093543.GI2400@work-vm> (David Alan Gilbert's message of "Mon, 7 Apr 2014 10:35:44 +0100") References: <1396840915-10384-1-git-send-email-quintela@redhat.com> <20140407093543.GI2400@work-vm> Date: Mon, 07 Apr 2014 12:00:30 +0200 Message-ID: <87d2gtfoht.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH for 2.1 00/97] VMState simplification (massive) Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: qemu-devel@nongnu.org "Dr. David Alan Gilbert" wrote: > * Juan Quintela (quintela@redhat.com) wrote: >> Hi >> >> Look at the diffstat. Almost all the additions are at >> test-vmstate.c. That is the reason why it is called a simplification. >> >> What this series does: >> - peter removal of version_minimum_id_old field when not needed (Peter) >> - cleanup: based on the previous one, I removed all the unneeded >> the uses on the tree. This should make your compiles >> a couple of nanoseconds faster. >> - once there, fixed the indentation of the .fields line, to a canonical >> .fields = (VMStateField[]) >> - mst simplifications for vmstate engine >> >> And now, the big cleanup. >> - Patches only do one thing, to make easy the review. >> >> - Added test for all VMSTATE_FOO() definitions >> (well, I am lying, VMSTATE_STRUCT* are still missing, will come soon) >> - We had two ways to make a field optional >> VMSTATE_INT64_V(field, state, version) >> and >> VMSTATE_INT64_TEST(field, state, test) >> >> We can do the version one with one test like: >> >> static inline bool vmstate_5_plus(void *opaque, int version_id) >> { >> return version_id >= 5; >> } >> >> and then change: >> VMSTATE_INT64_V(field, state, 5); >> >> into >> VMSTATE_INT64_TEST(field, state, vmstate_5_plus); > > I'm not sure if I like this; while I'm OK with the idea of changing the > implementation of VMSTATE_INT64_V to use that function trick internally, > it seems like we're discouraging providing easy to parse/record versionining > info out of the tree. That information is not exported Today. And if we want to export them, export v = 5 or test == vmstat_5_plus is exactly the same dificulty. The information is still there, what has changed is the removal of one mechanism. #define VMSTATE_UINT64_V(field, state, X) \ VMSTATE_UINT64_TEST(field, state, vmstate_##X##_plus) The same that we could do for maintaining the macro, we can do to export the information to whatever format we want. I just wanted to remove one of the mechanism (the less powerful one). Later, Juan.