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

[Xen-changelog] move XS_DEBUG code into a proper function



# HG changeset patch
# User vhanquez@xxxxxxxxxxxxxxxxxxxxxxx
# Node ID 51b0d4c2d4d9e2a4ad02c0e3b32fb56f6a8b8126
# Parent  c097485037f7417b77db34da198b62a9c9481dc5
move XS_DEBUG code into a proper function

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>

diff -r c097485037f7 -r 51b0d4c2d4d9 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Wed Mar 15 11:41:58 2006
+++ b/tools/xenstore/xenstored_core.c   Wed Mar 15 12:08:10 2006
@@ -1113,6 +1113,25 @@
        send_ack(conn, XS_SET_PERMS);
 }
 
+static void do_debug(struct connection *conn, struct buffered_data *in)
+{
+       if (streq(in->buffer, "print"))
+               xprintf("debug: %s", in->buffer + get_string(in, 0));
+       if (streq(in->buffer, "check"))
+               check_store();
+#ifdef TESTING
+       /* For testing, we allow them to set id. */
+       if (streq(in->buffer, "setid")) {
+               conn->id = atoi(in->buffer + get_string(in, 0));
+       } else if (streq(in->buffer, "failtest")) {
+               if (get_string(in, 0) < in->used)
+                       srandom(atoi(in->buffer + get_string(in, 0)));
+               failtest = true;
+       }
+#endif /* TESTING */
+       send_ack(conn, XS_DEBUG);
+}
+
 /* Process "in" for conn: "in" will vanish after this conversation, so
  * we can talloc off it for temporary variables.  May free "conn".
  */
@@ -1159,21 +1178,7 @@
                break;
 
        case XS_DEBUG:
-               if (streq(in->buffer, "print"))
-                       xprintf("debug: %s", in->buffer + get_string(in, 0));
-               if (streq(in->buffer, "check"))
-                       check_store();
-#ifdef TESTING
-               /* For testing, we allow them to set id. */
-               if (streq(in->buffer, "setid")) {
-                       conn->id = atoi(in->buffer + get_string(in, 0));
-               } else if (streq(in->buffer, "failtest")) {
-                       if (get_string(in, 0) < in->used)
-                               srandom(atoi(in->buffer + get_string(in, 0)));
-                       failtest = true;
-               }
-#endif /* TESTING */
-               send_ack(conn, XS_DEBUG);
+               do_debug(conn, in);
                break;
 
        case XS_WATCH:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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