From 07f8a8b34a2a84af388a47e65003bbe1734cf73b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 1 Aug 2008 14:43:12 +0000 Subject: [PATCH] xend_internal.c, sexpr.c: const-correctness fixes --- ChangeLog | 1 + src/sexpr.c | 2 +- src/sexpr.h | 2 +- src/xend_internal.c | 19 ++++++++++--------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a4a4776be..3face245d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ Fri Aug 1 15:15:00 BST 2008 Daniel P. Berrange Fri Aug 1 15:51:04 CEST 2008 Jim Meyering * virsh.c: more const-correctness fixes + * xend_internal.c, sexpr.c: Likewise. Fri Aug 1 13:57:00 BST 2008 Daniel P. Berrange diff --git a/src/sexpr.c b/src/sexpr.c index 90c549c1ee..b607e4147f 100644 --- a/src/sexpr.c +++ b/src/sexpr.c @@ -519,7 +519,7 @@ sexpr_lookup(const struct sexpr *sexpr, const char *node) * Returns true if the key was found, false otherwise */ int -sexpr_has(struct sexpr *sexpr, const char *node) +sexpr_has(const struct sexpr *sexpr, const char *node) { struct sexpr *s = sexpr_lookup_key(sexpr, node); diff --git a/src/sexpr.h b/src/sexpr.h index 0559a27c78..c3d038e4ca 100644 --- a/src/sexpr.h +++ b/src/sexpr.h @@ -51,5 +51,5 @@ int sexpr_node_copy(const struct sexpr *sexpr, const char *node, char **dst); const char *sexpr_fmt_node(const struct sexpr *sexpr, const char *fmt, ...) ATTRIBUTE_FORMAT(printf,2,3); struct sexpr *sexpr_lookup(const struct sexpr *sexpr, const char *node); -int sexpr_has(struct sexpr *sexpr, const char *node); +int sexpr_has(const struct sexpr *sexpr, const char *node); #endif diff --git a/src/xend_internal.c b/src/xend_internal.c index 880a27962c..bb2edd2791 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -1180,7 +1180,8 @@ xend_detect_config_version(virConnectPtr conn) { * Returns 0 in case of success and -1 in case of error */ static int -xenDaemonParseSxprOS(virConnectPtr xend, struct sexpr *node, +xenDaemonParseSxprOS(virConnectPtr xend, + const struct sexpr *node, virDomainDefPtr def, int hvm) { @@ -1640,11 +1641,11 @@ error: static int xenDaemonParseSxprDisks(virConnectPtr conn, virDomainDefPtr def, - struct sexpr *root, + const struct sexpr *root, int hvm, int xendConfigVersion) { - struct sexpr *cur, *node; + const struct sexpr *cur, *node; virDomainDiskDefPtr disk = NULL, prev = def->disks; for (cur = root; cur->kind == SEXPR_CONS; cur = cur->u.s.cdr) { @@ -1803,10 +1804,10 @@ error: static int xenDaemonParseSxprNets(virConnectPtr conn, virDomainDefPtr def, - struct sexpr *root) + const struct sexpr *root) { virDomainNetDefPtr net = NULL, prev = def->nets; - struct sexpr *cur, *node; + const struct sexpr *cur, *node; const char *tmp; int vif_index = 0; @@ -1964,7 +1965,7 @@ error: static int xenDaemonParseSxprUSB(virConnectPtr conn, virDomainDefPtr def, - struct sexpr *root) + const struct sexpr *root) { virDomainInputDefPtr prev = def->inputs; struct sexpr *cur, *node; @@ -2007,7 +2008,7 @@ no_memory: static int xenDaemonParseSxprGraphicsOld(virConnectPtr conn, virDomainDefPtr def, - struct sexpr *root, + const struct sexpr *root, int hvm, int xendConfigVersion) { @@ -2085,10 +2086,10 @@ no_memory: static int xenDaemonParseSxprGraphicsNew(virConnectPtr conn, virDomainDefPtr def, - struct sexpr *root) + const struct sexpr *root) { virDomainGraphicsDefPtr graphics = NULL; - struct sexpr *cur, *node; + const struct sexpr *cur, *node; const char *tmp; /* append network devices and framebuffer */