Patchwork constify value pointer for qdev_prop_set_string

login
register
mail settings
Submitter Christian Borntraeger
Date July 17, 2012, 1:26 p.m.
Message ID <1342531577-5189-1-git-send-email-borntraeger@de.ibm.com>
Download mbox | patch
Permalink /patch/171430/
State New
Headers show

Comments

Christian Borntraeger - July 17, 2012, 1:26 p.m.
qdev_prop_set_string uses object_property_set_str, which takes
a const char * for the value. Lets propagate the constness
into qdev_prop_set_string.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 hw/qdev-properties.c |    2 +-
 hw/qdev.h            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 0b89462..3571cf3 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -1123,7 +1123,7 @@  void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value)
     assert_no_error(errp);
 }
 
-void qdev_prop_set_string(DeviceState *dev, const char *name, char *value)
+void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value)
 {
     Error *errp = NULL;
     object_property_set_str(OBJECT(dev), value, name, &errp);
diff --git a/hw/qdev.h b/hw/qdev.h
index f4683dc..a0770b0 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -316,7 +316,7 @@  void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value);
 void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value);
 void qdev_prop_set_int32(DeviceState *dev, const char *name, int32_t value);
 void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value);
-void qdev_prop_set_string(DeviceState *dev, const char *name, char *value);
+void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value);
 void qdev_prop_set_chr(DeviceState *dev, const char *name, CharDriverState *value);
 void qdev_prop_set_netdev(DeviceState *dev, const char *name, VLANClientState *value);
 void qdev_prop_set_vlan(DeviceState *dev, const char *name, VLANState *value);