]> xenbits.xensource.com Git - mini-os.git/commitdiff
mini-os: move test functions under CONFIG_TEST
authorJuergen Gross <jgross@suse.com>
Tue, 17 Aug 2021 09:54:59 +0000 (11:54 +0200)
committerWei Liu <wl@xen.org>
Tue, 31 Aug 2021 15:56:30 +0000 (15:56 +0000)
There is no need to have the xenbus test support functions always
included in Mini-OS. Move them inside #ifdef CONFIG_TEST.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
xenbus/xenbus.c

index 9e6193053ad5afc39fd7cdb4606c2d2967816e0e..23de61ebaa8ec387422016ef6af0c062b4b0e73b 100644 (file)
@@ -549,21 +549,6 @@ static char *errmsg(struct xsd_sockmsg *rep)
     return res;
 }
 
-/* Send a debug message to xenbus.  Can block. */
-static void xenbus_debug_msg(const char *msg)
-{
-    int len = strlen(msg);
-    struct write_req req[] = {
-        { "print", sizeof("print") },
-        { msg, len },
-        { "", 1 }};
-    struct xsd_sockmsg *reply;
-
-    reply = xenbus_msg_reply(XS_DEBUG, 0, req, ARRAY_SIZE(req));
-    printk("Got a reply, type %d, id %d, len %d.\n",
-            reply->type, reply->req_id, reply->len);
-}
-
 /* List the contents of a directory.  Returns a malloc()ed array of
    pointers to malloc()ed strings.  The array is NULL terminated.  May
    block. */
@@ -858,6 +843,22 @@ domid_t xenbus_get_self_id(void)
     return ret;
 }
 
+#ifdef CONFIG_TEST
+/* Send a debug message to xenbus.  Can block. */
+static void xenbus_debug_msg(const char *msg)
+{
+    int len = strlen(msg);
+    struct write_req req[] = {
+        { "print", sizeof("print") },
+        { msg, len },
+        { "", 1 }};
+    struct xsd_sockmsg *reply;
+
+    reply = xenbus_msg_reply(XS_DEBUG, 0, req, ARRAY_SIZE(req));
+    printk("Got a reply, type %d, id %d, len %d.\n",
+            reply->type, reply->req_id, reply->len);
+}
+
 static void do_ls_test(const char *pre)
 {
     char **dirs, *msg;
@@ -944,6 +945,7 @@ void test_xenbus(void)
     do_read_test("device/vif/0/flibble");
     printk("(Should have said ENOENT)\n");
 }
+#endif /* CONFIG_TEST */
 
 /*
  * Local variables: