]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qdev: Constify local variable returned by blk_bs
authorKrzysztof Kozlowski <krzk@kernel.org>
Fri, 10 Mar 2017 20:05:50 +0000 (22:05 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Thu, 20 Apr 2017 18:22:41 +0000 (15:22 -0300)
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>
hw/core/qdev-properties-system.c

index e885e650fb7d674ecb790fcd856c4b5446302a82..79c2014135e9d5cb669ab189107d597816ccab0c 100644 (file)
@@ -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);
             }