From patchwork Fri Dec 29 21:23:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 758849 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp4672495wrw; Fri, 29 Dec 2023 13:31:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+6KCv98ZNgAMwGgNal+yb8IHOZ46F28j6qHMQRZgpHovnm5gqNbrOzCLPBBQuzfTa2vyp X-Received: by 2002:a05:622a:429b:b0:427:93cd:95cc with SMTP id cr27-20020a05622a429b00b0042793cd95ccmr15899235qtb.105.1703885514111; Fri, 29 Dec 2023 13:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703885514; cv=none; d=google.com; s=arc-20160816; b=Q3Zp9LXhjOPxBJB6Jh89dJZkMub+vamUWRMp42TBZUeANea8tpzNXanCf/T4RoqXOL 27kd1vwR/GgjzST3u82kjzDoaK7oM3cTlVZa+T+NsIv+sYWbubmqP5g1XexVzHUqEArG q/QO9cOtxBK4fxXH9X4/OQYuoMgsXc1VJjK+aZR5N4uuoZHGQCuCPkrmlN1qkv1LRtYJ HB58iZ1iK0G3u2AFiESjxhiLGlog4ecDP8F84TF7kzvEUxg5sy/1HPqMzGQ7dUftMzbs mOxtVNoen5tovuEHpFCMLG6oKbB8HzzXphMsSt7p3bEASwZu2JLE0IaTCZAvwsk27pRd MjgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mzgKa1/pA1ntGqiY+yagzdj2Mu5EMKX54fTMIwsuDpQ=; fh=mwvDHFN5agD7OubUR/beMfLQeIMTgcU04wMZItNAU1M=; b=SPF/Nknk6r8DWsaTtil51OwLOZB+5HYLViIk1F1rTIx7AkHQh1HEhPId8l+p5BJfux dyMYYCDv2o2kPAeEWl/mtdb7cBnNOaqCxMj6KS+e4ZH0yYu55mPz6Mm4IHfrz8wL6/q3 +xEiHLqGPpIqa8V8Ukw+DGsKKz2sSHL6rwzjQ/H8FqiuUbjjz1gOHGMf64i58OlK8RRa zi1dHIhNv8MmOWINoI8E/787PozS7xi5apt/RWzsvhgL1I5Jli7ugHf+VnxbzCOH9vv0 zw5caxmpUm3JvySLMBIK/w1gqii5pepTxhW73XB5dynInqEr9wxkFmNCzgZ5xRln+shH htWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CSkohnfO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n1-20020a05622a11c100b0041985eb503csi20186783qtk.693.2023.12.29.13.31.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Dec 2023 13:31:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CSkohnfO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJKQJ-0000ud-Tb; Fri, 29 Dec 2023 16:29:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJKQH-0000bT-Ls for qemu-devel@nongnu.org; Fri, 29 Dec 2023 16:29:41 -0500 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJKQF-0000Rk-Mb for qemu-devel@nongnu.org; Fri, 29 Dec 2023 16:29:41 -0500 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6dc20b4595bso985912a34.0 for ; Fri, 29 Dec 2023 13:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703885378; x=1704490178; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mzgKa1/pA1ntGqiY+yagzdj2Mu5EMKX54fTMIwsuDpQ=; b=CSkohnfOc4UtpzlBPKRFFYZcjpbgD6j+kZqSIFYbICpjc//Af2GwvLXq81jhWYqK4b UbLzGdU8ts9jS+zSnUXbAX+9RpPEFHZ5A8l5NkLEpbubfPypmlPkOqgCK0HSOeGvTlnb Npwm+d5Yc/WF3ZmEScYR8oAYPCti8RJp4+DlqwDje6dGb1SwoTSWNR82eLVMkL4ihz8t /2zRYsBCuvdpsk0N1OhzlJSBm5CGgszSSlOcWQDepR0BLWog2bQfQ0wN6PpsOSmjr7sH kGm/wmXpH1cU5BIlLjaZYMU7fXqP3CBPyc64XwYYYUWMWFb2SD7I8wthMxo5PcC+8lDv Pmxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703885378; x=1704490178; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mzgKa1/pA1ntGqiY+yagzdj2Mu5EMKX54fTMIwsuDpQ=; b=pi8M+IeWMpXNtcpS8eBRSojPqczplcaiT3tSK69l5Hct30xv8CeiimqVeLgwa8pA4J cGgTYgCShYpnf+MDzD6USXGlInhQGtGFi4NBP0TLoeI8AZl7EUknkGLE4VXIwEvEiymq ueQPDxyD4DrCj9CoofsrXsHKocrApeoMxwex24xVpcrGaSDHklUtZObW46zc4bVCpMbI nBgp9F2BKMSC3LycfkFKAcVf+nvM1UMdpwV1NFvr8eq3ekJ4ceknyEi/WpjPL0buYfQs Q6yyuUOhuH+7jW3K9EYk2vl6A3d/+J9+EhjYw62ylQJvGZfZQXiHySSiNP+o73wH2oyc O5lQ== X-Gm-Message-State: AOJu0YzgS1UrGikeO8deUWzwMXnpfYnzQV9eD7peW+sSXcHw84gxVn07 l+/cx3fUXhgMo7yNs/gel/8F5iIic9L2TbeWjr0ms6wqclJbhQ== X-Received: by 2002:a9d:7d86:0:b0:6dc:379:b3f with SMTP id j6-20020a9d7d86000000b006dc03790b3fmr4972489otn.46.1703885378500; Fri, 29 Dec 2023 13:29:38 -0800 (PST) Received: from stoup.lan (203-217-28-32.perm.iinet.net.au. [203.217.28.32]) by smtp.gmail.com with ESMTPSA id bd33-20020a056a0027a100b006d9a96b7d0dsm11285396pfb.208.2023.12.29.13.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 13:29:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Juan Quintela Subject: [PULL 70/71] tests/unit/test-vmstate: Constify VMState Date: Sat, 30 Dec 2023 08:23:45 +1100 Message-Id: <20231229212346.147149-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231229212346.147149-1-richard.henderson@linaro.org> References: <20231229212346.147149-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org While const data in tests is not particularly important, this makes a grep test clear across the tree. Reviewed-by: Juan Quintela Signed-off-by: Richard Henderson Message-Id: <20231221031652.119827-71-richard.henderson@linaro.org> --- tests/unit/test-vmstate.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c index 0b7d5ecd68..c4f9faa273 100644 --- a/tests/unit/test-vmstate.c +++ b/tests/unit/test-vmstate.c @@ -197,7 +197,7 @@ static const VMStateDescription vmstate_simple_primitive = { .name = "simple/primitive", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_BOOL(b_1, TestSimple), VMSTATE_BOOL(b_2, TestSimple), VMSTATE_UINT8(u8_1, TestSimple), @@ -299,7 +299,7 @@ static const VMStateDescription vmstate_simple_arr = { .name = "simple/array", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_UINT16_ARRAY(u16_1, TestSimpleArray, 3), VMSTATE_END_OF_LIST() } @@ -341,7 +341,7 @@ static const VMStateDescription vmstate_versioned = { .name = "test/versioned", .version_id = 2, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_UINT32(a, TestStruct), VMSTATE_UINT32_V(b, TestStruct, 2), /* Versioned field in the middle, so * we catch bugs more easily. @@ -412,7 +412,7 @@ static const VMStateDescription vmstate_skipping = { .name = "test/skip", .version_id = 2, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_UINT32(a, TestStruct), VMSTATE_UINT32(b, TestStruct), VMSTATE_UINT32_TEST(c, TestStruct, test_skip), @@ -524,7 +524,7 @@ const VMStateDescription vmsd_tst = { .name = "test/tst", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_INT32(i, TestStructTriv), VMSTATE_END_OF_LIST() } @@ -542,7 +542,7 @@ const VMStateDescription vmsd_arps = { .name = "test/arps", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(ar, TestArrayOfPtrToStuct, AR_SIZE, 0, vmsd_tst, TestStructTriv), VMSTATE_END_OF_LIST() @@ -630,7 +630,7 @@ const VMStateDescription vmsd_arpp = { .name = "test/arps", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_ARRAY_OF_POINTER(ar, TestArrayOfPtrToInt, AR_SIZE, 0, vmstate_info_int32, int32_t*), VMSTATE_END_OF_LIST() @@ -685,7 +685,7 @@ static const VMStateDescription vmstate_q_element = { .name = "test/queue-element", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_BOOL(b, TestQtailqElement), VMSTATE_UINT8(u8, TestQtailqElement), VMSTATE_END_OF_LIST() @@ -696,7 +696,7 @@ static const VMStateDescription vmstate_q = { .name = "test/queue", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_INT16(i16, TestQtailq), VMSTATE_QTAILQ_V(q, TestQtailq, 1, vmstate_q_element, TestQtailqElement, next), @@ -821,7 +821,7 @@ typedef struct TestGTreeInterval { .name = "interval", \ .version_id = 1, \ .minimum_version_id = 1, \ - .fields = (VMStateField[]) { \ + .fields = (const VMStateField[]) { \ VMSTATE_UINT64(low, TestGTreeInterval), \ VMSTATE_UINT64(high, TestGTreeInterval), \ VMSTATE_END_OF_LIST() \ @@ -839,7 +839,7 @@ typedef struct TestGTreeMapping { .name = "mapping", \ .version_id = 1, \ .minimum_version_id = 1, \ - .fields = (VMStateField[]) { \ + .fields = (const VMStateField[]) { \ VMSTATE_UINT64(phys_addr, TestGTreeMapping), \ VMSTATE_UINT32(flags, TestGTreeMapping), \ VMSTATE_END_OF_LIST() \ @@ -915,7 +915,7 @@ static const VMStateDescription vmstate_domain = { .version_id = 1, .minimum_version_id = 1, .pre_load = domain_preload, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_INT32(id, TestGTreeDomain), VMSTATE_GTREE_V(mappings, TestGTreeDomain, 1, vmstate_interval_mapping, @@ -940,7 +940,7 @@ static const VMStateDescription vmstate_qlist_element = { .name = "test/queue list", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_UINT32(id, TestQListElement), VMSTATE_END_OF_LIST() } @@ -951,7 +951,7 @@ static const VMStateDescription vmstate_iommu = { .version_id = 1, .minimum_version_id = 1, .pre_load = iommu_preload, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_INT32(id, TestGTreeIOMMU), VMSTATE_GTREE_DIRECT_KEY_V(domains, TestGTreeIOMMU, 1, &vmstate_domain, TestGTreeDomain), @@ -963,7 +963,7 @@ static const VMStateDescription vmstate_container = { .name = "test/container/qlist", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_UINT32(id, TestQListContainer), VMSTATE_QLIST_V(list, TestQListContainer, 1, vmstate_qlist_element, TestQListElement, next), @@ -1414,7 +1414,7 @@ static int tmp_child_post_load(void *opaque, int version_id) static const VMStateDescription vmstate_tmp_back_to_parent = { .name = "test/tmp_child_parent", - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_UINT64(f, TestStruct), VMSTATE_END_OF_LIST() } @@ -1424,7 +1424,7 @@ static const VMStateDescription vmstate_tmp_child = { .name = "test/tmp_child", .pre_save = tmp_child_pre_save, .post_load = tmp_child_post_load, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_INT64(diff, TmpTestStruct), VMSTATE_STRUCT_POINTER(parent, TmpTestStruct, vmstate_tmp_back_to_parent, TestStruct), @@ -1435,7 +1435,7 @@ static const VMStateDescription vmstate_tmp_child = { static const VMStateDescription vmstate_with_tmp = { .name = "test/with_tmp", .version_id = 1, - .fields = (VMStateField[]) { + .fields = (const VMStateField[]) { VMSTATE_UINT32(a, TestStruct), VMSTATE_UINT64(d, TestStruct), VMSTATE_WITH_TMP(TestStruct, TmpTestStruct, vmstate_tmp_child),