From patchwork Fri Feb 3 10:12:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 650018 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp733330pva; Fri, 3 Feb 2023 02:13:16 -0800 (PST) X-Google-Smtp-Source: AK7set9HVQyCKpPV8yW8J+s2qRUJd1zcwkxokejBHy/BdVChBuVj9bu4bpfSvhB+gcFWZwcBCcvE X-Received: by 2002:ac8:7c54:0:b0:3b9:b43e:5733 with SMTP id o20-20020ac87c54000000b003b9b43e5733mr18163240qtv.61.1675419195860; Fri, 03 Feb 2023 02:13:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675419195; cv=none; d=google.com; s=arc-20160816; b=qMDnOY4oj1YAC3DoGi4qZWY6MObHSSHg4vTUD7nxM/pwktaIwLPlc9wFt3T9cX11oi FMoLKvFtWVVQcuk/5cU9QQqC3hyfU/uFNLyhtmtE3jSZZgpwfMchROlB8Rw7x03uEWi1 sLTFBT9aKM4v7voKoKbIC+Tlde/245Tr8hcYRwbUkNywdff+8kjj3ie8Ilfls8zX3st0 wJFF3qMoHJiiego3/hJTztCul9eXO/cMaY4z140zQUBrQ3WKClvH1kmpoAlidO3GTdcB 4vM3ysms2eLIyn/Xvjpou9W9vvoP7DkI8K2XM/MqmWHjEfIYpM5CuA1kq+uRK4tPouYH GR/A== 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=CrEmjsQWUs+O54UNiVqyUtKQaK97UySf4g9leluZ4II=; b=fz4Lf06ES3+WDGe8fP7dnwWFi6gGA9m8bPzFJtByO578IS0UblNTdNohJpG03xullp dz2FZQm0ULEsuSZ04IPfNBfGb756mrr8QqRG8ZccMSI1S2lx2/2OLUtkSO5EIZSdftPE Sfpbdx4FxZ4Jd84d2zUVEkpU6zur54uZ8OzUXC77zA45ceu4ztkWAviz/1QevVfFuZZ9 tdiGwZM/u6dYIqTwj5vxvMkkCeJAGpwvQCdmad2jwB7mxtUdbLb5rmrc5OOJxzLqan1t y6/Bg4w+8q7Bvzodkn96iP+TAG7idz29tV9BUAuwSbt3K4j3clyMkiym20gIE256UTw3 zzZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QQwOg9vl; 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 204-20020a3703d5000000b00706b15a6e8fsi1748130qkd.578.2023.02.03.02.13.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 02:13:15 -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=QQwOg9vl; 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 1pNt3i-0008Lp-G0; Fri, 03 Feb 2023 05:12: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 1pNt3c-0008J3-89 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:38 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNt3Z-0002F4-Uk for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:36 -0500 Received: by mail-wr1-x42a.google.com with SMTP id a2so3893609wrd.6 for ; Fri, 03 Feb 2023 02:12:33 -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=CrEmjsQWUs+O54UNiVqyUtKQaK97UySf4g9leluZ4II=; b=QQwOg9vlwpGMppX49RZ7vpgn7E0+iLi5zWjDrbtM7B9hAOEq3bI8N0OgO/8UmCOVB4 VQPzh7FQ9wv3wVAk4yz6uC1qX+2xI8N/TT7EkD41A3dUKQUX2ccB4GDw5BLvP7D8y3Bs AM44GHLv7fZi39+PqR0h3L5MXBXpNIsoQXxlO/7O3gr6NjG8HQxm1IqcvAhI9oGVXZi7 1n+JssDgT2dNgB0tSRGuvPqg4Xu18WbuuyaBqeWeCDRrXhD94uYlfCHylK3zXxsm32Hw n0/s+vQ8Z3bbzwWrCw38WH7KPfB65DpOiXgnxVCQSGDdgelp2bTX99xSgMpBgAMKtfFw XsqQ== 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=CrEmjsQWUs+O54UNiVqyUtKQaK97UySf4g9leluZ4II=; b=HqwbLxSHA1alne9bDgycU0Z45yfdwxBaeTdVUMyvIlv02KTUMqXEZUEw6Q6SXgGaN0 bbBHUv91puyM/GzMzAf8ChEp23lQS3qcbqQfE0N651B/LVoDCIxhJAI9moqZZjKx0Th8 9ssCJZWjWfcgtY085zuhlWY50tm6OCThUHsLu+6r/AnWsD4y1j9pEKl+8E+yn6UXisGj DAqBakPBJsMou3IlPo+imUWk4Es5DAYZ1rMoAfVRK1H20QxjoXV4occWRtjIHc/5ryDC ZZRAcR/9eJ7Qfa0MothaPTG5d6Nt/fojac3/yV7utrrmqn2I+mhqaltcEKssE401GToX hnKg== X-Gm-Message-State: AO0yUKX8xtqfwd5ufcs2lKRqk9Lz3Zf1iwUkCc8/mQL8x5CfnmbO472I QUEpXQBStGiKAq9r3+g7S94RlfyFtSP7eZx9 X-Received: by 2002:adf:8912:0:b0:2bf:e692:2636 with SMTP id s18-20020adf8912000000b002bfe6922636mr9049032wrs.26.1675419152301; Fri, 03 Feb 2023 02:12:32 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bv20-20020a0560001f1400b002bc8130cca7sm1586794wrb.23.2023.02.03.02.12.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 02:12:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , qemu-trivial@nongnu.org, =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/4] hw/qdev-properties: Constify Property* in object_field_prop_ptr() Date: Fri, 3 Feb 2023 11:12:21 +0100 Message-Id: <20230203101224.25796-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203101224.25796-1-philmd@linaro.org> References: <20230203101224.25796-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The pointed Property structure is accessed read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 357b8761b5..858c33830c 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -50,7 +50,7 @@ void qdev_prop_allow_set_link_before_realize(const Object *obj, } } -void *object_field_prop_ptr(Object *obj, Property *prop) +void *object_field_prop_ptr(Object *obj, const Property *prop) { void *ptr = obj; ptr += prop->offset; diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index e1df08876c..b5a0ab34f3 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -206,7 +206,7 @@ void qdev_prop_set_macaddr(DeviceState *dev, const char *name, const uint8_t *value); void qdev_prop_set_enum(DeviceState *dev, const char *name, int value); -void *object_field_prop_ptr(Object *obj, Property *prop); +void *object_field_prop_ptr(Object *obj, const Property *prop); void qdev_prop_register_global(GlobalProperty *prop); const GlobalProperty *qdev_find_global_prop(Object *obj, From patchwork Fri Feb 3 10:12:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 650020 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp733446pva; Fri, 3 Feb 2023 02:13:30 -0800 (PST) X-Google-Smtp-Source: AK7set9S/TNoByyDdx/GUQMrADremNJUONI0dCf7sciyZPFxJbgBxeGx0SdN2PUPdq5pF0pBiqV9 X-Received: by 2002:a05:622a:188e:b0:3b6:30ea:e95 with SMTP id v14-20020a05622a188e00b003b630ea0e95mr16321513qtc.18.1675419210158; Fri, 03 Feb 2023 02:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675419210; cv=none; d=google.com; s=arc-20160816; b=zwiFgRcv7sr/4c8tCAn1kodR2LpWVq7y9p6H9gSo4yBLoJKmvV46gQBGub2YTWreeO FAePd2YyTEOr2PdYibJbFH9k7wOLndS2aexOSedOWlgL7EniP1OI8jHWdAHoQ49ujGwN maJqnJey0Lil0HM+wpDs8sLCVnXiYkeQrGekTFVxuCJVE2yXn4xDPTIiM6n2G3AHdMUC IPa4btgXBddapUaj1cOO0X+0Va0unW/IxFNHAzwxwYCw6sA1ZUjpfwjoof5lYwyUFFhC LBasMU4X4DWQNEh2HD56ZsFp6fW9Hvw7JCNTv2iz+cYOeCCqKx9Qa2KO2ORh+wxxWjVB J7aw== 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=2FPU8hqewqby+6DslWjG6sYp4oJe8crQF3hcWKmfIIg=; b=BDDHHhp8B6u5/5YOavfT1nME+ADUtR+N+e44xNh9BkRHjQBG8bP/zHbynbqLdxzLeu ntRLh6jGDtzkcTQ06A97Ezw9UzehwYZfXAU+B7TXzUCTXWTj3IOisHHT6qh5Tt7mVA28 J7kYzrTzCcrXyH+IUfNE/HsyTrYc3zh/5CxPEANnvoAGwjAJXd4TC3uKyOxxKP7MIX7O PCqUpXCK5Bi3JrUQ/6EtrEblXC9C9LUe6P5w2WippblZ7fD7yqqcNwh1BkeHiizbayq9 udpxTGUGLgArcTuoBmFmoE6B2col1g1NA406GqVu6qrdi97QyhpAG8kzCISikupKlJnE HQUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dYYulEIF; 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 w7-20020a05622a190700b003b86c04d598si1630712qtc.723.2023.02.03.02.13.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 02:13:30 -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=dYYulEIF; 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 1pNt3u-0008Nm-K0; Fri, 03 Feb 2023 05:12:58 -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 1pNt3g-0008LR-79 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:41 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNt3e-0002Fu-ET for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:39 -0500 Received: by mail-wr1-x42d.google.com with SMTP id bk16so4149827wrb.11 for ; Fri, 03 Feb 2023 02:12:38 -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=2FPU8hqewqby+6DslWjG6sYp4oJe8crQF3hcWKmfIIg=; b=dYYulEIFPBC87aUd9KEbUMujovwFfFH/mIdIaP7LwyEUV84+y0XSU09HHBTvHRRZ9Z u3nn+xQP2eGsSjJEY1B7EyBSS/7EpI7pViIZt2J+qHi3WOLiCXGfXqOqJLKQCs4CDmIb TYg9yXfgLvHHKou09dG9w+Glxo4VXT3VF9fgUvhFTbLKA24ze2omwYwji/Ja//t1I1YH bBnOvWurZS5WeBwLgNeB9Mnii/x9jWK1HZeKuPhOplDIHJifyUUnJblkFGC7WknVmggx UG9XvVmEq4RMb/19AzrBbnUQ9Yt5QiJbskJCLjsgjwLFIv/kiyaVzt2HgdDjZh3KLoP1 NjMg== 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=2FPU8hqewqby+6DslWjG6sYp4oJe8crQF3hcWKmfIIg=; b=heZJX5IAcVBpm5AGnZ1wwUa0WNeMezd70nllXigWn9Zg1EtYHIDpvN7FfAFLk/cwQC 6ECi7SL0cQqLxXRTqfw1QxnvA5CKLlxLLfCTG7iPrhQI/TZ/1RdXiJZklp03rMBn4ajm dFn5JVmqh7AKRPyAPusdVLMdYvsrPsP6RLkKdWAIpC8fcIn+bHOkbUeC0N6RB5+avB+X hwSQlSKNtWPz7KmhDLaZv7kYWJ3O6DFMH8f4gOXBGJPUwu1MJn8NvR6rsTLLFE1r12es tqz4pinTNzl+2JBd4prd5pxWq+BlFSYAz/fL4EaPv274B1x2gW2Ei4J8dBaEEHAuayHZ HPHQ== X-Gm-Message-State: AO0yUKX8FeUcx7kHbRUCeSiIEyPCDKqMXaSREBroMIipOQtKrP6iBaTb FDa6yuHKs+r7mIHZPQSXt2ExF4PINZZyOg7Q X-Received: by 2002:a05:6000:384:b0:2bf:db79:4c6e with SMTP id u4-20020a056000038400b002bfdb794c6emr11976086wrf.63.1675419156978; Fri, 03 Feb 2023 02:12:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m10-20020a5d624a000000b002c3ce97ec38sm1402383wrv.115.2023.02.03.02.12.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 02:12:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , qemu-trivial@nongnu.org, =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/4] hw/qdev-properties: Constify Property* in PropertyInfo::print() handler Date: Fri, 3 Feb 2023 11:12:22 +0100 Message-Id: <20230203101224.25796-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203101224.25796-1-philmd@linaro.org> References: <20230203101224.25796-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The pointed Property structure is accessed read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties-system.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index d42493f630..a982de1354 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -799,7 +799,7 @@ invalid: g_free(str); } -static int print_pci_devfn(Object *obj, Property *prop, char *dest, +static int print_pci_devfn(Object *obj, const Property *prop, char *dest, size_t len) { int32_t *ptr = object_field_prop_ptr(obj, prop); diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index b5a0ab34f3..39959c3432 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -34,7 +34,7 @@ struct PropertyInfo { const char *description; const QEnumLookup *enum_table; bool realized_set_allowed; /* allow setting property on realized device */ - int (*print)(Object *obj, Property *prop, char *dest, size_t len); + int (*print)(Object *obj, const Property *prop, char *dest, size_t len); void (*set_default_value)(ObjectProperty *op, const Property *prop); ObjectProperty *(*create)(ObjectClass *oc, const char *name, Property *prop); From patchwork Fri Feb 3 10:12:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 650022 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp733913pva; Fri, 3 Feb 2023 02:14:34 -0800 (PST) X-Google-Smtp-Source: AK7set8VEb2nLns8wGlIXZrbNdkLPEJdBGRyCdd92I7fapVhEQqxw3wnZVofQ3TsmCEJHQWuF9GV X-Received: by 2002:a05:622a:588:b0:3b8:6b3c:a37 with SMTP id c8-20020a05622a058800b003b86b3c0a37mr17657343qtb.6.1675419274177; Fri, 03 Feb 2023 02:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675419274; cv=none; d=google.com; s=arc-20160816; b=wfCh1JOzFjHwvswBiRizN4+rfWjGcpVASjngp6hPk5qCcVYLgJQiPqGU/eBC2ovHqF vs6FhOIuRDzRWxzjbS+7ZnAr8DbqZDuIkT/fV3OF6B9WWs1gQwEj7Ie1VfOsxO2/WJyg r+Z8Qftu7K3wgtMdgsPUq9mgJe76mew70crhrWsstU2+1qqoEDnDHaj9CR9EoUFmE1Eo XiXM+kyWYh4YD06+lKYD9wllOAdtbgrj2Vn4Iw/SiyAmsUqgVAgN7edkfDhqkTcuxUrI 8cC+eDzyF/C9gO4+RYT0kzKhzt9KRBu14yCbLVOMuw3SQZwRuUecI7274qNqlTARuQ5v tzdQ== 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=l1+8RskQqSTqwx3siHFRois+Ev1CScrT5ouMmLra5q8=; b=hhdR6SXfn6+CdcBoqA/diNqsuzxHwmw3B9HIMRB37V6Jrlf1WehVxHK3j9kXdhfXIg 386/bX+InxZdAojr9pYA/OnC9KgfTcLl5662Hw/1PFph4H9YY/NXaTv59AFu+gvKOF12 g7REZWXSNMyJWgTqfYBqrE7K+UKdXWFvuZ0AQBrDuWJHzHV/ZfEyzuk82JPjrSogyrsS 15QQnLxWr9ey8iTcCW4UiObAls7e6YLNIc0mTXar/OKNGxXjiPgPjXTd8Jb77FVxEHpX HGbxSLuQDwOtVD965WJv6cheEk9auHn6kEPxC4vcv96OACYIW3PrJYfmOebeoCVX/aTe Fc/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="no6afKJ/"; 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 bm10-20020a05620a198a00b0071db2c0ba6dsi1868434qkb.611.2023.02.03.02.14.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 02:14:34 -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="no6afKJ/"; 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 1pNt44-0008Qw-DS; Fri, 03 Feb 2023 05:13:04 -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 1pNt3k-0008Ma-TK for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:47 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNt3j-0002GL-GL for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:44 -0500 Received: by mail-wr1-x435.google.com with SMTP id r2so4163360wrv.7 for ; Fri, 03 Feb 2023 02:12:42 -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=l1+8RskQqSTqwx3siHFRois+Ev1CScrT5ouMmLra5q8=; b=no6afKJ/oUrH+dV5hj59RnhkouyJfbNjD+YNHGViXZnhL3CzFICkXRkX8bJ2EpIPeJ xJ9P4ASrNNrzsPSAZ/GZtx3B5+T19bjHJPR+756cC/nfRCVtw8rUw7TkmQAQlX+YJ5N7 gvXhQS0ClgRS3IVwOWWsT68DuPdMW7Y898R8Ba7LDxCza6gsFszJhRR7fFGv/S9Vquis qKX1APCq5z47YoJFB/dO1wYxcNzV0agND0tjb9MQUEJivtD/s1XvftLp1hYR+vPqlwMV /zURck/4dMkGQY4qmZcR1cf1KGHOUgI7v2Jhs7bCShn6Q5qNMxpRtIjws9VDGxUe0j4n 3MgQ== 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=l1+8RskQqSTqwx3siHFRois+Ev1CScrT5ouMmLra5q8=; b=5AbonHPw8PN//pVGXBzWYlXYRBZoCg60UYUXY6YzI8fqn5s0Hxy1ecTzgspMaKyDP9 D0JcULAfWutpj9EqKA6KPZlKeAQrsrRX6x6MrGn7CiqoOz7mAbBl0MOsnumZ5zjNH58G kFN9yegDyLwAtVVdgEXrpvYTCAXfsCl8inm/kzqVAolvy2qnrYNpNp8d8D/LEfzu5XZp uMx0Hk5ezQnf+pz0+OygdByYNNyaPQLXXj1r2JCQQjQHIf8f9rdn1+10/AmGxpUVpeQJ 2hduvULi0zOudKbnexaruxugIBywUiQs9F/TJtIlqfIwgt96IFESoz6yGwIKeUx/AK78 x7pA== X-Gm-Message-State: AO0yUKWh5NvMe3JdAUEGkFclV4MQUs6qa7gD+KbSRNmyuZzlzW4ubPCk nvV39aQbECC51A4W+GgbZFueypS7uCzVjzUT X-Received: by 2002:adf:f006:0:b0:2bf:b199:c7ef with SMTP id j6-20020adff006000000b002bfb199c7efmr8591914wro.12.1675419161701; Fri, 03 Feb 2023 02:12:41 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l17-20020a056000023100b002bdf8dd6a8bsm1625515wrz.80.2023.02.03.02.12.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 02:12:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , qemu-trivial@nongnu.org, =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/4] hw/qdev-properties: Constify Property* in PropertyInfo::create() handler Date: Fri, 3 Feb 2023 11:12:23 +0100 Message-Id: <20230203101224.25796-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203101224.25796-1-philmd@linaro.org> References: <20230203101224.25796-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The pointed Property structure is accessed read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 858c33830c..baf9a91b29 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -840,7 +840,7 @@ const PropertyInfo qdev_prop_size = { /* --- object link property --- */ static ObjectProperty *create_link_property(ObjectClass *oc, const char *name, - Property *prop) + const Property *prop) { return object_class_property_add_link(oc, name, prop->link_type, prop->offset, diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 39959c3432..21f399e9a3 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -37,7 +37,7 @@ struct PropertyInfo { int (*print)(Object *obj, const Property *prop, char *dest, size_t len); void (*set_default_value)(ObjectProperty *op, const Property *prop); ObjectProperty *(*create)(ObjectClass *oc, const char *name, - Property *prop); + const Property *prop); ObjectPropertyAccessor *get; ObjectPropertyAccessor *set; ObjectPropertyRelease *release; From patchwork Fri Feb 3 10:12:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 650021 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp733862pva; Fri, 3 Feb 2023 02:14:24 -0800 (PST) X-Google-Smtp-Source: AK7set9za7PF7XAunrjYTV9Qr02h08GZgBfinRtmyGCEB2DLD7U/ox+3+uijzaS1deYBUUVZbbl1 X-Received: by 2002:a05:622a:24e:b0:3a9:8cc6:d4b2 with SMTP id c14-20020a05622a024e00b003a98cc6d4b2mr8163109qtx.5.1675419264698; Fri, 03 Feb 2023 02:14:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675419264; cv=none; d=google.com; s=arc-20160816; b=EboihOpHZTEtpKVnFSvVLPuXASlmI82iJaWL1f72MdGlmTm+qwJ9Yv43NvoizjIJEG 7sCJ/lYOBGJ0R35b6qzNFQSVE3J5VvOElBTzaS6N/pgl89WKcu+aqb6y2youOrNuumh6 DP2Ta++B163Etb7tOZQhCXeMq0Y7hAG49RvNd+tRqI51gvE5lhZ/aQYvBaiNrNAI5tQu 9xDR/fhPls+q+uWww/jHFcm1UZRz1vt4JqvtjIhQIHIlDs3q/e3BhEk+2VlUjVGRfo55 Oz/ky4OuLv4zt56u69TesMsaznKBLh2v9juctWCM0WIeTDKscPFLpcVoteQXrIZqd/GN Uyqw== 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=tYOm6U1mrpjpeze33/MXi3JiNC/zlctq5Oro7JtmJks=; b=Ux0OtfpsPo2QeqZj6wKykowgGq0cvpaOBQLybHD6fPP9iIlJ8b9Dxw8ghr1oRk9R/3 QWh+dcRLeCx12COsCB6M5d5KnAhuJvykQu8QVVlKvAbkiQ46gKkfiJAHHShDeT5BXiNo dE7IyQek0TcTrF7q2WPujDIVJzWfFkaGlr3co76Z5S2NLTst+bpf2jfmPtG6zSXmonx7 MBk228rQ9NBxlJWew69Y1VOqaDwQLiCuJP4tCzEJb/tMp/vdj9p2l0o+gec5T109UpXT H+pBy8xgzhAa2KEzJhxD/Ju/YfG6X6M0UBrqr2P2QOh+WjaDumJH6SFUSvEaVpwcBqya Plqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yBju/Ft8"; 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 t11-20020a05622a01cb00b003b635b87abbsi1684839qtw.11.2023.02.03.02.14.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 02:14:24 -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="yBju/Ft8"; 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 1pNt44-0008QU-5R; Fri, 03 Feb 2023 05:13:04 -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 1pNt3p-0008N2-RE for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:50 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNt3o-0002I0-BW for qemu-devel@nongnu.org; Fri, 03 Feb 2023 05:12:49 -0500 Received: by mail-wr1-x42b.google.com with SMTP id q5so4218244wrv.0 for ; Fri, 03 Feb 2023 02:12:47 -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=tYOm6U1mrpjpeze33/MXi3JiNC/zlctq5Oro7JtmJks=; b=yBju/Ft8sFCHC+DJwCACGjj0Or9yAr/a5cn+g6lRhQM7ORDKhIegCbqjxj+zQOvYSe HLnc64zgZNM/c7CgI99RtIiLOcWTIX1TdvAX3n0Ck4YDd9gXazqkFB/b6NmBlG7CoMcN CPvYFj6Kc/3rNjgWJ38JSfrbSQA1tewpldAm6bqGNOO2OusqTsO4aq3dilClwYMlhctD qwpMRhHUaYAAEHDlNiT4v1PTryOZ+91ayPmpOSUjoTR0zfcBH3Usp9OujPwOaXjhp4Ua ShTu4cSiJW4CaTe/J9RmgmL7ybSLxW2JkP+MOazcH2b76c6DJRriYbi16LxsPzhEOpSJ 0WlA== 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=tYOm6U1mrpjpeze33/MXi3JiNC/zlctq5Oro7JtmJks=; b=Pxf8+XbPJkiW3R6fYOcUgzPMMC/Z/1oFTQw2vv1uumrHI3+FqB2sTloTJR7rZBBjzw cxYvQ3v9cM2ZJnFt4abRvomlDpPI6WyI2hWIwYip0lkgTatson47vrr1KkqDCpnKN9sL kmYV1Z2fDlAhiyPGMk3hGMrasfyqV98VBDo1NVJM68nsY3Gxnvcz4Zv80VHlQxVK2gHs HfAUHgu8Y1QRP3ZQpAIouFBU1/mx0hL73TCTPenKeyBqiX3g5LwE1WFY0lV1QuGSsKYb lRV4UkTdnw0aZGq/eNalQSlDM4a7Le51+yH3dscXjYhqnBsFTQGRcjyCNydICkF8sn7b VsFQ== X-Gm-Message-State: AO0yUKWhTWS9F81rhzjVVWRxyEnkZTmA0STvIsZTVI3q+72rr5tfOK5H Vjx3w27iVPDUrVCxZ1M79El1hr7TlJBr9A8Y X-Received: by 2002:a5d:6d46:0:b0:2bf:bac7:30d4 with SMTP id k6-20020a5d6d46000000b002bfbac730d4mr8440644wri.53.1675419166611; Fri, 03 Feb 2023 02:12:46 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m2-20020a056000008200b002bfb7c2430bsm1634964wrx.19.2023.02.03.02.12.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 02:12:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , qemu-trivial@nongnu.org, =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/4] hw/qdev-properties: Constify DeviceClass::props_ field Date: Fri, 3 Feb 2023 11:12:24 +0100 Message-Id: <20230203101224.25796-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203101224.25796-1-philmd@linaro.org> References: <20230203101224.25796-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The pointed Property structure is accessed read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c | 10 +++++----- include/hw/qdev-core.h | 2 +- softmmu/qdev-monitor.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index baf9a91b29..9789a2f5de 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -640,7 +640,7 @@ const PropertyInfo qdev_prop_arraylen = { /* --- public helpers --- */ -static Property *qdev_prop_walk(Property *props, const char *name) +static const Property *qdev_prop_walk(const Property *props, const char *name) { if (!props) { return NULL; @@ -654,10 +654,10 @@ static Property *qdev_prop_walk(Property *props, const char *name) return NULL; } -static Property *qdev_prop_find(DeviceState *dev, const char *name) +static const Property *qdev_prop_find(DeviceState *dev, const char *name) { ObjectClass *class; - Property *prop; + const Property *prop; /* device properties */ class = object_get_class(OBJECT(dev)); @@ -731,7 +731,7 @@ void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value) void qdev_prop_set_enum(DeviceState *dev, const char *name, int value) { - Property *prop; + const Property *prop; prop = qdev_prop_find(dev, name); object_property_set_str(OBJECT(dev), name, @@ -959,7 +959,7 @@ void device_class_set_props(DeviceClass *dc, Property *props) void qdev_alias_all_properties(DeviceState *target, Object *source) { ObjectClass *class; - Property *prop; + const Property *prop; class = object_get_class(OBJECT(target)); do { diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 35fddb19a6..fd11e9a82f 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -108,7 +108,7 @@ struct DeviceClass { * The underscore at the end ensures a compile-time error if someone * assigns to dc->props instead of using device_class_set_props. */ - Property *props_; + const Property *props_; /* * Can this device be instantiated with -device / device_add? diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 4b0ef65780..f47de51f95 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -741,8 +741,8 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp) #define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__) static void qbus_print(Monitor *mon, BusState *bus, int indent); -static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props, - int indent) +static void qdev_print_props(Monitor *mon, DeviceState *dev, + const Property *props, int indent) { if (!props) return;