From nobody Wed Nov 27 12:28:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1699254548; cv=none; d=zohomail.com; s=zohoarc; b=HLc/HczKPKZCEtQCjSPhfsC1w0/Cv8w34kNWbeXW46Tbaa2sn6SqPI/82udcOqPqi6Oe4+bH55pyh8Xsny6G+1YINmH2O+u9ekf9gvPfB00joTU/yhJgE7G/ZSSmMED9cKWDyO1nGn5D9j6EkugZ93FA73V9lNsHuSWoExpYfwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699254548; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=j2A10pfHkrD+rrB4z/CGDQAhqqlN9Qu55HFBv/3KiUo=; b=QcddDyGUNDOc9AXAVaPYoetd6DP7msO2sYXUF2QiMek4hHr13u4anUW0f2HPM+rCADOkwfzuCUR+E4YAod51KtvPPTGq8PK5cIinvqBjTzEwsbCS454++6+zuZuTnOAX5SGc3l2O82qrUnLjMwRH9dlHK0ujYWWjTAGqtwKOb90= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699254548266364.0032431096695; Sun, 5 Nov 2023 23:09:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qztfr-0005ZN-J1; Mon, 06 Nov 2023 02:05:29 -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 1qztdD-0001C5-Il for qemu-devel@nongnu.org; Mon, 06 Nov 2023 02:02:47 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qztd1-00023A-TX for qemu-devel@nongnu.org; Mon, 06 Nov 2023 02:02:41 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2800bb246ceso3068063a91.1 for ; Sun, 05 Nov 2023 23:02:30 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 8-20020a17090a194800b0027d88387287sm5319650pjh.51.2023.11.05.23.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 23:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699254149; x=1699858949; 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=j2A10pfHkrD+rrB4z/CGDQAhqqlN9Qu55HFBv/3KiUo=; b=n1Ad8J9z3m5a/1AJz5XrSbGoLHplqhAPs3baukHHp5zo5nB3Pfv11S/ffMOQ+/J1++ GChskkOsFoWxsEw8jJ5OuSQkgj69cDiobN0ebKMHKey0Vmyu7CnGQgIv8BiOdLIITO2d K7oO8E9rpv9g5AvC2hEuHbCyuFRAMDuZA4Givn0lPg6h1rMDlq/mVb/eA4HB9uPmvsYO p2rAZ58qxvEPQLcoydhqNAtjAdlaLw6h7KQd4T/ryniDSJrKsQZOTJn4NLBk+gfohQJX JXnTk6gqs7KhVod9iTIcWzWJg/wQNcKEU923L3dFTjxjNmLvcGuqDsg1y+4QHQzeaeRF 9FUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699254149; x=1699858949; 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=j2A10pfHkrD+rrB4z/CGDQAhqqlN9Qu55HFBv/3KiUo=; b=cYqiFwEn1KV3drMjrZqaImFMnXJIyj1+OV0rLw9CRMkpL6vc52dgUj7JXibeywSrew oIZyhEDCfLYFjnIFP4+XscCmUhnggLKQ4vZ4O/nMfMJcvtLcQoVcnzlQcLtNvurs6TUQ dJTRixWfGudKK+jAEATdF6BgRBdU85PWkxZy5ZYJ1BcHZ1bZRFZ3C5RMUQ+Y8UtpAzK3 bHsWCM/ZzgaDABrDaQHZ8PlZeN8YdV+lFWkmT5AVc3m13LZD57WAfeOCaHWEYSreEz0v rBkHhBOHC5JhFloqE1xVRvpeKdYvruj6uJ9PHTHLGnfUEf4ZP+RLrkejnXCP3VdPPtMA 5X0A== X-Gm-Message-State: AOJu0YzOJonmV5++MME/+8VnltwM8fsWtJ6mbcDKVZf53ewAc9Ysi452 X6pvDLIcpkPr7i8bsLbsVt57GcKVnsT80Mom6Tk= X-Google-Smtp-Source: AGHT+IH1kS5CbtD9rt34sW2xYS55LbYV+mVhIAOhoRb8jOIIR7v6QkVo1wy24WMW2UvRxsaKNsGU7g== X-Received: by 2002:a17:90b:3507:b0:280:3c60:bd2d with SMTP id ls7-20020a17090b350700b002803c60bd2dmr17299742pjb.15.1699254148938; Sun, 05 Nov 2023 23:02:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: quintela@redhat.com, peterx@redhat.com, farosas@suse.de, leobras@redhat.com Subject: [PATCH 70/71] tests/unit/test-vmstate: Constify VMState Date: Sun, 5 Nov 2023 22:58:26 -0800 Message-Id: <20231106065827.543129-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231106065827.543129-1-richard.henderson@linaro.org> References: <20231106065827.543129-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1699254550104100003 Content-Type: text/plain; charset="utf-8" While const data in tests is not particularly important, this makes a grep test clear across the tree. Signed-off-by: Richard Henderson Reviewed-by: Juan Quintela --- 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_primitiv= e =3D { .name =3D "simple/primitive", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (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 =3D { .name =3D "simple/array", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_UINT16_ARRAY(u16_1, TestSimpleArray, 3), VMSTATE_END_OF_LIST() } @@ -341,7 +341,7 @@ static const VMStateDescription vmstate_versioned =3D { .name =3D "test/versioned", .version_id =3D 2, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_UINT32(a, TestStruct), VMSTATE_UINT32_V(b, TestStruct, 2), /* Versioned field in the midd= le, so * we catch bugs more easily. @@ -412,7 +412,7 @@ static const VMStateDescription vmstate_skipping =3D { .name =3D "test/skip", .version_id =3D 2, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (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 =3D { .name =3D "test/tst", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_INT32(i, TestStructTriv), VMSTATE_END_OF_LIST() } @@ -542,7 +542,7 @@ const VMStateDescription vmsd_arps =3D { .name =3D "test/arps", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (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 =3D { .name =3D "test/arps", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (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 =3D { .name =3D "test/queue-element", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_BOOL(b, TestQtailqElement), VMSTATE_UINT8(u8, TestQtailqElement), VMSTATE_END_OF_LIST() @@ -696,7 +696,7 @@ static const VMStateDescription vmstate_q =3D { .name =3D "test/queue", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_INT16(i16, TestQtailq), VMSTATE_QTAILQ_V(q, TestQtailq, 1, vmstate_q_element, TestQtailqEl= ement, next), @@ -821,7 +821,7 @@ typedef struct TestGTreeInterval { .name =3D "interval", \ .version_id =3D 1, \ .minimum_version_id =3D 1, \ - .fields =3D (VMStateField[]) { \ + .fields =3D (const VMStateField[]) { \ VMSTATE_UINT64(low, TestGTreeInterval), \ VMSTATE_UINT64(high, TestGTreeInterval), \ VMSTATE_END_OF_LIST() \ @@ -839,7 +839,7 @@ typedef struct TestGTreeMapping { .name =3D "mapping", \ .version_id =3D 1, \ .minimum_version_id =3D 1, \ - .fields =3D (VMStateField[]) { \ + .fields =3D (const VMStateField[]) { \ VMSTATE_UINT64(phys_addr, TestGTreeMapping), \ VMSTATE_UINT32(flags, TestGTreeMapping), \ VMSTATE_END_OF_LIST() \ @@ -915,7 +915,7 @@ static const VMStateDescription vmstate_domain =3D { .version_id =3D 1, .minimum_version_id =3D 1, .pre_load =3D domain_preload, - .fields =3D (VMStateField[]) { + .fields =3D (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 = =3D { .name =3D "test/queue list", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_UINT32(id, TestQListElement), VMSTATE_END_OF_LIST() } @@ -951,7 +951,7 @@ static const VMStateDescription vmstate_iommu =3D { .version_id =3D 1, .minimum_version_id =3D 1, .pre_load =3D iommu_preload, - .fields =3D (VMStateField[]) { + .fields =3D (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 =3D { .name =3D "test/container/qlist", .version_id =3D 1, .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (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 vers= ion_id) =20 static const VMStateDescription vmstate_tmp_back_to_parent =3D { .name =3D "test/tmp_child_parent", - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_UINT64(f, TestStruct), VMSTATE_END_OF_LIST() } @@ -1424,7 +1424,7 @@ static const VMStateDescription vmstate_tmp_child =3D= { .name =3D "test/tmp_child", .pre_save =3D tmp_child_pre_save, .post_load =3D tmp_child_post_load, - .fields =3D (VMStateField[]) { + .fields =3D (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 =3D= { static const VMStateDescription vmstate_with_tmp =3D { .name =3D "test/with_tmp", .version_id =3D 1, - .fields =3D (VMStateField[]) { + .fields =3D (const VMStateField[]) { VMSTATE_UINT32(a, TestStruct), VMSTATE_UINT64(d, TestStruct), VMSTATE_WITH_TMP(TestStruct, TmpTestStruct, vmstate_tmp_child), --=20 2.34.1