summaryrefslogtreecommitdiffstats
path: root/hw/core
diff options
context:
space:
mode:
authorKrzysztof Kozlowski2017-03-10 21:05:50 +0100
committerEduardo Habkost2017-04-20 20:22:41 +0200
commitbe9721f400f7e5395bb2a257c291557df8f3f833 (patch)
tree58d8c0b8e6577cb41ac97767f182190a653bd284 /hw/core
parentqdev: Constify value passed to qdev_prop_set_macaddr (diff)
downloadqemu-be9721f400f7e5395bb2a257c291557df8f3f833.tar.gz
qemu-be9721f400f7e5395bb2a257c291557df8f3f833.tar.xz
qemu-be9721f400f7e5395bb2a257c291557df8f3f833.zip
qdev: Constify local variable returned by blk_bs
Inside qdev_prop_set_drive() the value returned by blk_bs() is passed only as pointer to const to bdrv_get_node_name() and pointed values is not modified in other places so this can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Message-Id: <20170310200550.13313-3-krzk@kernel.org> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev-properties-system.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index e885e650fb..79c2014135 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -409,7 +409,7 @@ void qdev_prop_set_drive(DeviceState *dev, const char *name,
if (value) {
ref = blk_name(value);
if (!*ref) {
- BlockDriverState *bs = blk_bs(value);
+ const BlockDriverState *bs = blk_bs(value);
if (bs) {
ref = bdrv_get_node_name(bs);
}