Commit 7ce67518 authored by Yathindra Naik's avatar Yathindra Naik

Some more debugging code.

- Verifies read/write to xenstore is fine.
- Xenstore complains it cannot read backend node.
parent d0fc9f70
This diff is collapsed.
......@@ -618,7 +618,7 @@ void do_introduce(struct connection *conn, struct buffered_data *in)
if(dominfo.cap_flag) {
domain->cap_flag = dominfo.cap_flag;
domain->conn->cap_flag = dominfo.cap_flag;
xprintf("Setting cap_flag for conn: %p\n",conn);
xprintf("Setting cap_flag for domain_id: %d\n",domid);
}
#endif
......@@ -772,8 +772,9 @@ void do_get_domain_path(struct connection *conn, const char *domid_str)
return;
}
xprintf("do_get_domain_path: Looking for domain path for domain %s\n",domid_str);
path = talloc_domain_path(conn, atoi(domid_str));
xprintf("do_get_domain_path: found %s\n",path);
send_reply(conn, XS_GET_DOMAIN_PATH, path, strlen(path) + 1);
talloc_free(path);
......@@ -795,6 +796,7 @@ void do_is_domain_introduced(struct connection *conn, const char *domid_str)
else
result = (find_domain_by_domid(domid) != NULL);
xprintf("do_is_domain_introduced: domain %d %s\n",domid, (result?"found":"not found"));
send_reply(conn, XS_IS_DOMAIN_INTRODUCED, result ? "T" : "F", 2);
}
......
......@@ -56,6 +56,7 @@ static void add_event(struct connection *conn,
unsigned int len;
char *data;
xprintf("add_event: Try to find node %s\n",name);
if (!check_event_node(name)) {
/* Can this conn load node, or see that it doesn't exist? */
struct node *node = get_node(conn, name, XS_PERM_READ);
......@@ -68,6 +69,7 @@ static void add_event(struct connection *conn,
* But this breaks device-channel teardown!
* Really we should fix this better...
*/
xprintf("add_event: got back node %p for %s\n",node,name);
if (!node && errno != ENOENT && errno != EACCES)
return;
}
......@@ -133,6 +135,7 @@ void do_watch(struct connection *conn, struct buffered_data *in)
} else {
relative = !strstarts(vec[0], "/");
vec[0] = canonicalize(conn, vec[0]);
xprintf("do_watch: watching node %s\n",vec[0]);
if (!is_valid_nodename(vec[0])) {
send_error(conn, EINVAL);
return;
......
......@@ -37,6 +37,7 @@ static uint32_t total_size(struct record_hdr *hdr)
#endif
}
/*
static char perm_to_char(enum xs_perm_type perm)
{
return perm == XS_PERM_READ ? 'r' :
......@@ -45,7 +46,7 @@ static char perm_to_char(enum xs_perm_type perm)
perm == (XS_PERM_READ|XS_PERM_WRITE) ? 'b' :
'?';
}
*/
int main(int argc, char *argv[])
{
TDB_DATA key;
......@@ -78,11 +79,11 @@ int main(int argc, char *argv[])
char *p;
printf("%.*s: ", (int)key.dsize, key.dptr);
for (i = 0; i < hdr->num_perms; i++)
/*for (i = 0; i < hdr->num_perms; i++)
printf("%s%c%i",
i == 0 ? "" : ",",
perm_to_char(hdr->perms[i].perms),
hdr->perms[i].id);
hdr->perms[i].id);*/
p = (void *)&hdr->perms[hdr->num_perms];
printf(" %.*s\n", hdr->datalen, p);
p += hdr->datalen;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment