From nobody Tue Feb 10 04:15:58 2026 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=1670886405; cv=none; d=zohomail.com; s=zohoarc; b=XLR9AWPKXAheXIvJm9DbIAh46MHAK6qCzViWibE0Ef0qYwOBkf+lswTVyLI2pd5t4u7TgnxYFKwQcWEEGFjnFS6fvTrdzaVDY+GawW+mLTaMH1y66IzQbSTRX3sjyvQbnZfDrtSEZnubVDgkPXee/qSMQACfWHRpqUV9u9iFHgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670886405; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=blM7A2ZtBOEvrOOyVb68rTbl2nGKVpaDUjZZ/09ilWY=; b=dna/EVE+IATHc1zHT70bL04a/RckKh74J0I/ekaJWM5OGLgVZN/h91TIreBWpBco6azEqYX+p+bmq199ACVu1+wY0bkWgd2H/4EMx8eQhsguwqAW5fDkIUhAR6fiUmeOoBj5OmZ98aF02D41Au5R+jRA6xdmUORLDJ3xyb9o41k= 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 1670886405109255.16578154381784; Mon, 12 Dec 2022 15:06:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4rrj-0007AL-0G; Mon, 12 Dec 2022 18:05: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 1p4rrh-00079v-8J for qemu-devel@nongnu.org; Mon, 12 Dec 2022 18:05:41 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4rre-0004G6-To for qemu-devel@nongnu.org; Mon, 12 Dec 2022 18:05:41 -0500 Received: by mail-ej1-x62e.google.com with SMTP id vv4so32218033ejc.2 for ; Mon, 12 Dec 2022 15:05:38 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l9-20020a1709060cc900b007b5903e595bsm3774463ejh.84.2022.12.12.15.05.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Dec 2022 15:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=blM7A2ZtBOEvrOOyVb68rTbl2nGKVpaDUjZZ/09ilWY=; b=EWTAYxZnd09SLTtGq6/R674WKwfn22bKGpZb8sy41dZvq2ttMSNDKqeU/qJ4hnZdRo yoVTgbFRtCPGvZWzAPNeD/7IV54U/qyp3J7mwJVORO71fpP0c4o18ZsSyvl9j3NY0Ew/ b90X7QRdoBtGb+X3fcblpWteGD2Gnn2q8xOKKC55WFsrUcFGCZV0X+rMbYD0Ju1pbIiw ggfMjFaY7K6fW0oboEyC0vbgkoYgh6yCqUhco5tIF/avla2b0AC1iHUl/QBT1yU0Pnw2 mitf0TJsdS2Pa0fh2MMbRDo+EwFHkDT/Xity0hHAi6rO8qYxqFw7jhyFYFl33OkmgkDY WFmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=blM7A2ZtBOEvrOOyVb68rTbl2nGKVpaDUjZZ/09ilWY=; b=5cP4B4jeuOMKDjx3/v+Liz5gnmm1hYBPuxphxqe9DkfRxF0S9EQqln8sV0GbRvXO4b ZYysrYt2wjgtyFJ9YQ0UAPFBDR7wYLeVcICnIRyNQU/X73ZmigddfjxDuHowli0rCYkj mzeeZPNqvZqbA4I463UTglp/+hIbaGZI8XVmmN/HJ2JwB1yrIC9DLSqMqoszAfNdzG3M HHu6aofaNUwUROZwngI3CcDKVeoZGr32zp8FjJnzQfD9f/HjaZNrcmUcw6nYmNs9rB10 9RrSwIKgLOjAEhMO5OtQgCKqPaABDO6sbtQ9KP1W9UZuQPRlzxVB4BtH1k5jwV+mD0aT jnZg== X-Gm-Message-State: ANoB5pn91dxcfWF1pCSgeWifEcyiYdLCn2F+LJ7rBqdl27v6cFYUOOpN A+K7GSD9a567r5W8ezfINr9ocXR9xlbl3lk7nEY= X-Google-Smtp-Source: AA0mqf4KSeWFI6Q4yu8UJ7M1ePah6fRR2IWK9GojluCZN4xls3Q+UvDO46GIUJsQVn5HXRW8LCj/dA== X-Received: by 2002:a17:906:25c7:b0:7c1:8ba6:6eb3 with SMTP id n7-20020a17090625c700b007c18ba66eb3mr409887ejb.35.1670886337134; Mon, 12 Dec 2022 15:05:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Cc: Greg Kurz , Stefan Hajnoczi , Kevin Wolf , qemu-block@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jason Wang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Christian Schoenebeck , Hanna Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-8.0 03/10] hw/virtio: Constify qmp_virtio_feature_map_t[] Date: Tue, 13 Dec 2022 00:05:10 +0100 Message-Id: <20221212230517.28872-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212230517.28872-1-philmd@linaro.org> References: <20221212230517.28872-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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 autolearn=unavailable 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: 1670886405925100007 These arrays are only accessed read-only, move them to .rodata. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 5817f4cbc9..f54cc23304 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -80,7 +80,7 @@ enum VhostUserProtocolFeature { }; =20 /* Virtio transport features mapping */ -static qmp_virtio_feature_map_t virtio_transport_map[] =3D { +static const qmp_virtio_feature_map_t virtio_transport_map[] =3D { /* Virtio device transport features */ #ifndef VIRTIO_CONFIG_NO_LEGACY FEATURE_ENTRY(VIRTIO_F_NOTIFY_ON_EMPTY, \ @@ -111,7 +111,7 @@ static qmp_virtio_feature_map_t virtio_transport_map[] = =3D { }; =20 /* Vhost-user protocol features mapping */ -static qmp_virtio_feature_map_t vhost_user_protocol_map[] =3D { +static const qmp_virtio_feature_map_t vhost_user_protocol_map[] =3D { FEATURE_ENTRY(VHOST_USER_PROTOCOL_F_MQ, \ "VHOST_USER_PROTOCOL_F_MQ: Multiqueue protocol supported"), FEATURE_ENTRY(VHOST_USER_PROTOCOL_F_LOG_SHMFD, \ @@ -161,7 +161,7 @@ static qmp_virtio_feature_map_t vhost_user_protocol_map= [] =3D { }; =20 /* virtio device configuration statuses */ -static qmp_virtio_feature_map_t virtio_config_status_map[] =3D { +static const qmp_virtio_feature_map_t virtio_config_status_map[] =3D { FEATURE_ENTRY(VIRTIO_CONFIG_S_DRIVER_OK, \ "VIRTIO_CONFIG_S_DRIVER_OK: Driver setup and ready"), FEATURE_ENTRY(VIRTIO_CONFIG_S_FEATURES_OK, \ @@ -179,7 +179,7 @@ static qmp_virtio_feature_map_t virtio_config_status_ma= p[] =3D { }; =20 /* virtio-blk features mapping */ -qmp_virtio_feature_map_t virtio_blk_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_blk_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_BLK_F_SIZE_MAX, \ "VIRTIO_BLK_F_SIZE_MAX: Max segment size is size_max"), FEATURE_ENTRY(VIRTIO_BLK_F_SEG_MAX, \ @@ -218,7 +218,7 @@ qmp_virtio_feature_map_t virtio_blk_feature_map[] =3D { }; =20 /* virtio-serial features mapping */ -qmp_virtio_feature_map_t virtio_serial_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_serial_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_CONSOLE_F_SIZE, \ "VIRTIO_CONSOLE_F_SIZE: Host providing console size"), FEATURE_ENTRY(VIRTIO_CONSOLE_F_MULTIPORT, \ @@ -229,7 +229,7 @@ qmp_virtio_feature_map_t virtio_serial_feature_map[] = =3D { }; =20 /* virtio-gpu features mapping */ -qmp_virtio_feature_map_t virtio_gpu_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_gpu_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_GPU_F_VIRGL, \ "VIRTIO_GPU_F_VIRGL: Virgl 3D mode supported"), FEATURE_ENTRY(VIRTIO_GPU_F_EDID, \ @@ -250,7 +250,7 @@ qmp_virtio_feature_map_t virtio_gpu_feature_map[] =3D { }; =20 /* virtio-input features mapping */ -qmp_virtio_feature_map_t virtio_input_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_input_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), FEATURE_ENTRY(VHOST_USER_F_PROTOCOL_FEATURES, \ @@ -260,7 +260,7 @@ qmp_virtio_feature_map_t virtio_input_feature_map[] =3D= { }; =20 /* virtio-net features mapping */ -qmp_virtio_feature_map_t virtio_net_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_net_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_NET_F_CSUM, \ "VIRTIO_NET_F_CSUM: Device handling packets with partial check= sum " "supported"), @@ -338,7 +338,7 @@ qmp_virtio_feature_map_t virtio_net_feature_map[] =3D { }; =20 /* virtio-scsi features mapping */ -qmp_virtio_feature_map_t virtio_scsi_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_scsi_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_SCSI_F_INOUT, \ "VIRTIO_SCSI_F_INOUT: Requests including read and writable dat= a " "buffers suppoted"), @@ -359,7 +359,7 @@ qmp_virtio_feature_map_t virtio_scsi_feature_map[] =3D { }; =20 /* virtio/vhost-user-fs features mapping */ -qmp_virtio_feature_map_t virtio_fs_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_fs_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), FEATURE_ENTRY(VHOST_USER_F_PROTOCOL_FEATURES, \ @@ -369,7 +369,7 @@ qmp_virtio_feature_map_t virtio_fs_feature_map[] =3D { }; =20 /* virtio/vhost-user-i2c features mapping */ -qmp_virtio_feature_map_t virtio_i2c_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_i2c_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_I2C_F_ZERO_LENGTH_REQUEST, \ "VIRTIO_I2C_F_ZERO_LEGNTH_REQUEST: Zero length requests suppor= ted"), FEATURE_ENTRY(VHOST_F_LOG_ALL, \ @@ -381,7 +381,7 @@ qmp_virtio_feature_map_t virtio_i2c_feature_map[] =3D { }; =20 /* virtio/vhost-vsock features mapping */ -qmp_virtio_feature_map_t virtio_vsock_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_vsock_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_VSOCK_F_SEQPACKET, \ "VIRTIO_VSOCK_F_SEQPACKET: SOCK_SEQPACKET supported"), FEATURE_ENTRY(VHOST_F_LOG_ALL, \ @@ -393,7 +393,7 @@ qmp_virtio_feature_map_t virtio_vsock_feature_map[] =3D= { }; =20 /* virtio-balloon features mapping */ -qmp_virtio_feature_map_t virtio_balloon_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_balloon_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_BALLOON_F_MUST_TELL_HOST, \ "VIRTIO_BALLOON_F_MUST_TELL_HOST: Tell host before reclaiming " "pages"), @@ -411,14 +411,14 @@ qmp_virtio_feature_map_t virtio_balloon_feature_map[]= =3D { }; =20 /* virtio-crypto features mapping */ -qmp_virtio_feature_map_t virtio_crypto_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_crypto_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), { -1, "" } }; =20 /* virtio-iommu features mapping */ -qmp_virtio_feature_map_t virtio_iommu_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_iommu_feature_map[] =3D { FEATURE_ENTRY(VIRTIO_IOMMU_F_INPUT_RANGE, \ "VIRTIO_IOMMU_F_INPUT_RANGE: Range of available virtual addrs.= " "available"), @@ -441,7 +441,7 @@ qmp_virtio_feature_map_t virtio_iommu_feature_map[] =3D= { }; =20 /* virtio-mem features mapping */ -qmp_virtio_feature_map_t virtio_mem_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_mem_feature_map[] =3D { #ifndef CONFIG_ACPI FEATURE_ENTRY(VIRTIO_MEM_F_ACPI_PXM, \ "VIRTIO_MEM_F_ACPI_PXM: node_id is an ACPI PXM and is valid"), @@ -453,7 +453,7 @@ qmp_virtio_feature_map_t virtio_mem_feature_map[] =3D { }; =20 /* virtio-rng features mapping */ -qmp_virtio_feature_map_t virtio_rng_feature_map[] =3D { +const qmp_virtio_feature_map_t virtio_rng_feature_map[] =3D { FEATURE_ENTRY(VHOST_F_LOG_ALL, \ "VHOST_F_LOG_ALL: Logging write descriptors supported"), FEATURE_ENTRY(VHOST_USER_F_PROTOCOL_FEATURES, \ --=20 2.38.1