[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [mini-os master] mini-os: move test functions under CONFIG_TEST
commit 0a2dd2d159111064227bf9cfbadae22069609ab0 Author: Juergen Gross <jgross@xxxxxxxx> AuthorDate: Tue Aug 17 11:54:59 2021 +0200 Commit: Wei Liu <wl@xxxxxxx> CommitDate: Tue Aug 31 15:56:30 2021 +0000 mini-os: move test functions under CONFIG_TEST 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@xxxxxxxx> Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx> --- xenbus/xenbus.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/xenbus/xenbus.c b/xenbus/xenbus.c index 9e61930..23de61e 100644 --- a/xenbus/xenbus.c +++ b/xenbus/xenbus.c @@ -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: -- generated by git-patchbot for /home/xen/git/mini-os.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |