提交 07f8a8b3 编写于 作者: J Jim Meyering

xend_internal.c, sexpr.c: const-correctness fixes

上级 c74c20f7
...@@ -17,6 +17,7 @@ Fri Aug 1 15:15:00 BST 2008 Daniel P. Berrange <berrange@redhat.com> ...@@ -17,6 +17,7 @@ Fri Aug 1 15:15:00 BST 2008 Daniel P. Berrange <berrange@redhat.com>
Fri Aug 1 15:51:04 CEST 2008 Jim Meyering <meyering@redhat.com> Fri Aug 1 15:51:04 CEST 2008 Jim Meyering <meyering@redhat.com>
* virsh.c: more const-correctness fixes * virsh.c: more const-correctness fixes
* xend_internal.c, sexpr.c: Likewise.
Fri Aug 1 13:57:00 BST 2008 Daniel P. Berrange <berrange@redhat.com> Fri Aug 1 13:57:00 BST 2008 Daniel P. Berrange <berrange@redhat.com>
......
...@@ -519,7 +519,7 @@ sexpr_lookup(const struct sexpr *sexpr, const char *node) ...@@ -519,7 +519,7 @@ sexpr_lookup(const struct sexpr *sexpr, const char *node)
* Returns true if the key was found, false otherwise * Returns true if the key was found, false otherwise
*/ */
int 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); struct sexpr *s = sexpr_lookup_key(sexpr, node);
......
...@@ -51,5 +51,5 @@ int sexpr_node_copy(const struct sexpr *sexpr, const char *node, char **dst); ...@@ -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, ...) const char *sexpr_fmt_node(const struct sexpr *sexpr, const char *fmt, ...)
ATTRIBUTE_FORMAT(printf,2,3); ATTRIBUTE_FORMAT(printf,2,3);
struct sexpr *sexpr_lookup(const struct sexpr *sexpr, const char *node); 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 #endif
...@@ -1180,7 +1180,8 @@ xend_detect_config_version(virConnectPtr conn) { ...@@ -1180,7 +1180,8 @@ xend_detect_config_version(virConnectPtr conn) {
* Returns 0 in case of success and -1 in case of error * Returns 0 in case of success and -1 in case of error
*/ */
static int static int
xenDaemonParseSxprOS(virConnectPtr xend, struct sexpr *node, xenDaemonParseSxprOS(virConnectPtr xend,
const struct sexpr *node,
virDomainDefPtr def, virDomainDefPtr def,
int hvm) int hvm)
{ {
...@@ -1640,11 +1641,11 @@ error: ...@@ -1640,11 +1641,11 @@ error:
static int static int
xenDaemonParseSxprDisks(virConnectPtr conn, xenDaemonParseSxprDisks(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
struct sexpr *root, const struct sexpr *root,
int hvm, int hvm,
int xendConfigVersion) int xendConfigVersion)
{ {
struct sexpr *cur, *node; const struct sexpr *cur, *node;
virDomainDiskDefPtr disk = NULL, prev = def->disks; virDomainDiskDefPtr disk = NULL, prev = def->disks;
for (cur = root; cur->kind == SEXPR_CONS; cur = cur->u.s.cdr) { for (cur = root; cur->kind == SEXPR_CONS; cur = cur->u.s.cdr) {
...@@ -1803,10 +1804,10 @@ error: ...@@ -1803,10 +1804,10 @@ error:
static int static int
xenDaemonParseSxprNets(virConnectPtr conn, xenDaemonParseSxprNets(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
struct sexpr *root) const struct sexpr *root)
{ {
virDomainNetDefPtr net = NULL, prev = def->nets; virDomainNetDefPtr net = NULL, prev = def->nets;
struct sexpr *cur, *node; const struct sexpr *cur, *node;
const char *tmp; const char *tmp;
int vif_index = 0; int vif_index = 0;
...@@ -1964,7 +1965,7 @@ error: ...@@ -1964,7 +1965,7 @@ error:
static int static int
xenDaemonParseSxprUSB(virConnectPtr conn, xenDaemonParseSxprUSB(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
struct sexpr *root) const struct sexpr *root)
{ {
virDomainInputDefPtr prev = def->inputs; virDomainInputDefPtr prev = def->inputs;
struct sexpr *cur, *node; struct sexpr *cur, *node;
...@@ -2007,7 +2008,7 @@ no_memory: ...@@ -2007,7 +2008,7 @@ no_memory:
static int static int
xenDaemonParseSxprGraphicsOld(virConnectPtr conn, xenDaemonParseSxprGraphicsOld(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
struct sexpr *root, const struct sexpr *root,
int hvm, int hvm,
int xendConfigVersion) int xendConfigVersion)
{ {
...@@ -2085,10 +2086,10 @@ no_memory: ...@@ -2085,10 +2086,10 @@ no_memory:
static int static int
xenDaemonParseSxprGraphicsNew(virConnectPtr conn, xenDaemonParseSxprGraphicsNew(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
struct sexpr *root) const struct sexpr *root)
{ {
virDomainGraphicsDefPtr graphics = NULL; virDomainGraphicsDefPtr graphics = NULL;
struct sexpr *cur, *node; const struct sexpr *cur, *node;
const char *tmp; const char *tmp;
/* append network devices and framebuffer */ /* append network devices and framebuffer */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册