From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu0hP-0000QF-3C for qemu-devel@nongnu.org; Tue, 11 Oct 2016 13:18:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bu0hJ-0007fp-Vi for qemu-devel@nongnu.org; Tue, 11 Oct 2016 13:18:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bu0hJ-0007fc-PH for qemu-devel@nongnu.org; Tue, 11 Oct 2016 13:18:37 -0400 From: "Dr. David Alan Gilbert (git)" Date: Tue, 11 Oct 2016 18:18:29 +0100 Message-Id: <20161011171833.20803-1-dgilbert@redhat.com> Subject: [Qemu-devel] [very-WIP 0/4] Migration: VMSTATE_WITH_TMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, amit.shah@redhat.com, quintela@redhat.com, duanj@linux.vnet.ibm.com, pasic@linux.vnet.ibm.com Cc: david@gibson.dropbear.id.au From: "Dr. David Alan Gilbert" Hi, I'm interested in comments on the idea here, it's certainly not ready to go in yet; and VERY untested. Here I've added a macro, VMSTATE_WITH_TMP which allows you to allocate a temporary structure, transmit that with a VMStateDescription and then free that temporary. A pointer to the parent structure is set up in the temporary allowing the pre_load/pre_save/post_load off the child vmsd to copy/calculate things to fill in the temporary. There are 4 patches: a) Add VMSTATE_WITH_TMP b) A test for (a) An easy read to see how (a) works c) Conversion of SLIRPs sbuf structure to a VMState This is a nice use of VMSTATE_WITH_TMP since it needs to calculate and send a couple of offsets based off the contents of the structure but not the raw fields. d) Conversion of virtio-net to VMState; this is pretty hairy, and the previous version I posted added a bunch of migration only variables into the structure; here I use 3 VMSTATE_WITH_TMP's to avoid it. Both (c) & (d) depend on a whole bunch of related patches I'm still cooking, but they should let people see how VMSTATE_WITH_TMP is used. I think it works OK; it's not exactly compact though, you often seem to end up with more VMStateDescription boiler plate and quite a few trivial pre_load/pre_save. Note this isn't standalone; it depends on Jianjun's patches that modify the .get/.put parameters and a bunch of smaller patches of mine. Comments welcome, Dave Dr. David Alan Gilbert (7): migration: Add VMSTATE_WITH_TMP tests/migration: Add test for VMSTATE_WITH_TMP virtio/migration: Migrate virtio-net to VMState slirp: VMStatify sbuf -- 2.9.3