From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c438b-0000za-Cp for qemu-devel@nongnu.org; Tue, 08 Nov 2016 04:56:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c438X-0006tW-HN for qemu-devel@nongnu.org; Tue, 08 Nov 2016 04:56:17 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:32813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c438X-0006tB-99 for qemu-devel@nongnu.org; Tue, 08 Nov 2016 04:56:13 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA89sAGT047372 for ; Tue, 8 Nov 2016 04:56:11 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 26kaq669d2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 08 Nov 2016 04:56:11 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Nov 2016 09:56:09 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6AAE71B08023 for ; Tue, 8 Nov 2016 09:58:19 +0000 (GMT) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA89u6Cj29163556 for ; Tue, 8 Nov 2016 09:56:06 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA89u6OU029250 for ; Tue, 8 Nov 2016 02:56:06 -0700 From: Halil Pasic Date: Tue, 8 Nov 2016 10:55:55 +0100 Message-Id: <20161108095603.72301-1-pasic@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v2 0/8] VMS_ARRAY_OF_POINTER with null pointers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah , Juan Quintela , Guenther Hutzl , "Dr. David Alan Gilbert" , Halil Pasic Make VMS_ARRAY_OF_POINTER cope with null pointers. Currently the reward for trying to migrate an array with some null pointers in it is an illegal memory access, that is a swift and painless death of the process. Let's make vmstate cope with this scenario at least for pointers to structs. We need this functionality for the migration of the channel subsystem (hw/s390x/css.c). The first 2 patches (1-2) are basically from a different series. Both received favorable reviews and no criticism yet. Since things are progressing slow there (understandably, its rather a cleanup than the killer feature) but things are nicer with these I decided to include them in this series to ease review. Then 3 more cleanup patches (3,5,6) and a test coverage for the existing functionality in patch 4 follow. Patches 3 and 4 are already included by Juan but still not in master I'm including them here as well (for reference see https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg00335.html https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg00329.html ). I ended up with an RFC again because of these cleanup patches 5 and 6. Last time they were one patch with the new functionality patch which made things messy, and I did not receive enough feedback regarding if these are welcomed by the community or should be dismissed as not worth it. Here I want to point out that IMHO "split up vmstate_base_addr" also fixes a latent bug so its not pure cleanup. The new functionality is introduced by patch 7 and test coverage for it in patch 8. v1 --> v2: * Added Reviewed-by tags * Fixed marker for null pointer as suggested by Dave * Split out the cleanup patches as suggested by Dave Guenther Hutzl (1): tests/test-vmstate.c: add vBuffer test Halil Pasic (7): migration: drop unused VMStateField.start tests/test-vmstate.c: add save_buffer util func tests/test-vmstate.c: add array of pointer to struct migration/vmstate: renames in (load|save)_state migration/vmstate: split up vmstate_base_addr migration/vmstate: fix array of pointers to struct tests/test-vmstate.c: add array of pointers to struct with NULL hw/char/exynos4210_uart.c | 2 +- hw/display/g364fb.c | 2 +- hw/dma/pl330.c | 8 +- hw/intc/exynos4210_gic.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 4 +- hw/ipmi/isa_ipmi_kcs.c | 4 +- hw/net/vmxnet3.c | 2 +- hw/nvram/mac_nvram.c | 2 +- hw/nvram/spapr_nvram.c | 2 +- hw/sd/sdhci.c | 2 +- hw/timer/m48t59.c | 2 +- include/migration/vmstate.h | 27 +++-- migration/savevm.c | 2 +- migration/vmstate.c | 91 ++++++++++------ target-s390x/machine.c | 2 +- tests/test-vmstate.c | 250 +++++++++++++++++++++++++++++++++++++++++--- util/fifo8.c | 2 +- 17 files changed, 327 insertions(+), 79 deletions(-) -- 2.8.4