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

This commit is contained in:
Jim Meyering 2008-08-01 14:43:12 +00:00
parent c74c20f701
commit 07f8a8b34a
4 changed files with 13 additions and 11 deletions

View File

@ -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>
* 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>

View File

@ -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);

View File

@ -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

View File

@ -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 */