[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 15/25] tools/xenstore: make data parameter of db_write() const



db_write() doesn't change the data written to the data base, so the
data parameter can be const.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
V3:
- new patch
---
 tools/xenstore/xenstored_core.c | 4 ++--
 tools/xenstore/xenstored_core.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index a08962c3ea..9f88914149 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -611,11 +611,11 @@ static unsigned int get_acc_domid(struct connection 
*conn, const char *name,
        return (!conn || name[0] == '/' || name[0] == '@') ? domid : conn->id;
 }
 
-int db_write(struct connection *conn, const char *db_name, void *data,
+int db_write(struct connection *conn, const char *db_name, const void *data,
             size_t size, struct node_account_data *acc,
             enum write_node_mode mode, bool no_quota_check)
 {
-       struct xs_tdb_record_hdr *hdr = data;
+       const struct xs_tdb_record_hdr *hdr = data;
        struct node_account_data old_acc = {};
        unsigned int old_domid, new_domid;
        size_t name_len = strlen(db_name);
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index e1aeb4aecd..1aa3cc0936 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -363,7 +363,7 @@ int remember_string(struct hashtable *hash, const char 
*str);
 
 /* Data base access functions. */
 struct xs_tdb_record_hdr *db_fetch(const char *db_name, size_t *size);
-int db_write(struct connection *conn, const char *db_name, void *data,
+int db_write(struct connection *conn, const char *db_name, const void *data,
             size_t size, struct node_account_data *acc,
             enum write_node_mode mode, bool no_quota_check);
 void db_delete(struct connection *conn, const char *name,
-- 
2.35.3




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.