From minios-devel-bounces@lists.xenproject.org Fri Jan 27 07:32:56 2023
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 27 Jan 2023 07:32:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.485312.752438 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pLJEB-0006pc-NQ; Fri, 27 Jan 2023 07:32:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 485312.752438; Fri, 27 Jan 2023 07:32:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pLJEB-0006pV-Kz; Fri, 27 Jan 2023 07:32:51 +0000
Received: by outflank-mailman (input) for mailman id 485312;
 Fri, 27 Jan 2023 07:32:50 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D8Jc=5Y=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1pLJEA-0006pK-8z
 for minios-devel@lists.xenproject.org; Fri, 27 Jan 2023 07:32:50 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cb272f3c-9e14-11ed-b8d1-410ff93cb8f0;
 Fri, 27 Jan 2023 08:32:47 +0100 (CET)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 008AD21DC8;
 Fri, 27 Jan 2023 07:32:46 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BD16D138E3;
 Fri, 27 Jan 2023 07:32:45 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id 41rDLB1+02MzYAAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 27 Jan 2023 07:32:45 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb272f3c-9e14-11ed-b8d1-410ff93cb8f0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1674804766; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=n76WnWUE/5YrtZqdKfCuwTkAbmeQBtDXu0yYOZuyFm0=;
	b=ue9gaEms7h+5KZTR5o6qE8naxYWtyoVA94IjgLmiULZBhqu3O5QbiMVwUYJ42PSaR1XOb+
	au4pv19pIbxXII5KM6kcR/1+nNo8/+74EA4kBSdqUdOCDMeCuZXtaDaz1Yiyo56fzB29+c
	mq5vcZ/t8nh4BX/huflxH3ksUppDcS8=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH] Mini-OS: remove stale subdirs from Makefile
Date: Fri, 27 Jan 2023 08:32:44 +0100
Message-Id: <20230127073244.6883-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The SUBDIRS make variable has some stale entries, remove them.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f3acdd2f..747c7c01 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ EXTRA_OBJS =
 TARGET := mini-os
 
 # Subdirectories common to mini-os
-SUBDIRS := lib xenbus console
+SUBDIRS := lib
 
 src-$(CONFIG_BLKFRONT) += blkfront.c
 src-$(CONFIG_CONSFRONT) += consfront.c
-- 
2.35.3



From minios-devel-bounces@lists.xenproject.org Fri Jan 27 07:33:52 2023
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 27 Jan 2023 07:33:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.485321.752453 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pLJFA-0007V7-6g; Fri, 27 Jan 2023 07:33:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 485321.752453; Fri, 27 Jan 2023 07:33:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pLJFA-0007V0-3s; Fri, 27 Jan 2023 07:33:52 +0000
Received: by outflank-mailman (input) for mailman id 485321;
 Fri, 27 Jan 2023 07:33:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=D8Jc=5Y=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1pLJF8-0007JG-AT
 for minios-devel@lists.xenproject.org; Fri, 27 Jan 2023 07:33:50 +0000
Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f01b6503-9e14-11ed-a5d9-ddcf98b90cbd;
 Fri, 27 Jan 2023 08:33:49 +0100 (CET)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by smtp-out1.suse.de (Postfix) with ESMTPS id 322E321DA3;
 Fri, 27 Jan 2023 07:33:48 +0000 (UTC)
Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512)
 (No client certificate requested)
 by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0495C138E3;
 Fri, 27 Jan 2023 07:33:47 +0000 (UTC)
Received: from dovecot-director2.suse.de ([192.168.254.65])
 by imap2.suse-dmz.suse.de with ESMTPSA id HkVtO1t+02OkYAAAMHmgww
 (envelope-from <jgross@suse.com>); Fri, 27 Jan 2023 07:33:47 +0000
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f01b6503-9e14-11ed-a5d9-ddcf98b90cbd
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1674804828; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:  content-transfer-encoding:content-transfer-encoding;
	bh=2F3jMA00rIuMoLB5a5BqPwacl19YT7UGy2nW1Pjamfc=;
	b=njRbIWfll6G2JpZj/M/OWVZX+cvo69nOjKOlQppL9T3HC1pvHTHcufdWAzj6KqMDjTH5CU
	3o1JsuQ5BrxuUzsbnerkUnCRLNX3y1HeP9Tbhr+6KMs57YvOXTepuNu78Zzi0cyTs9JCEg
	7lS2RB5EwFKwptg/jPFxb08bRzTJkjU=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH] Mini-OS: move xenbus test code into test.c
Date: Fri, 27 Jan 2023 08:33:46 +0100
Message-Id: <20230127073346.6992-1-jgross@suse.com>
X-Mailer: git-send-email 2.35.3
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The test code in xenbus.c can easily be moved into test.c.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 test.c   | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 xenbus.c | 113 -------------------------------------------------------
 2 files changed, 106 insertions(+), 115 deletions(-)

diff --git a/test.c b/test.c
index 42a26661..465c54e8 100644
--- a/test.c
+++ b/test.c
@@ -44,6 +44,7 @@
 #include <fcntl.h>
 #include <xen/features.h>
 #include <xen/version.h>
+#include <xen/io/xs_wire.h>
 
 #ifdef CONFIG_XENBUS
 static unsigned int do_shutdown = 0;
@@ -52,11 +53,114 @@ static DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
 #endif
 
 #ifdef CONFIG_XENBUS
-void test_xenbus(void);
+/* 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;
+    int x;
+
+    printk("ls %s...\n", pre);
+    msg = xenbus_ls(XBT_NIL, pre, &dirs);
+    if ( msg )
+    {
+        printk("Error in xenbus ls: %s\n", msg);
+        free(msg);
+        return;
+    }
+
+    for ( x = 0; dirs[x]; x++ )
+    {
+        printk("ls %s[%d] -> %s\n", pre, x, dirs[x]);
+        free(dirs[x]);
+    }
+
+    free(dirs);
+}
+
+static void do_read_test(const char *path)
+{
+    char *res, *msg;
+
+    printk("Read %s...\n", path);
+    msg = xenbus_read(XBT_NIL, path, &res);
+    if ( msg )
+    {
+        printk("Error in xenbus read: %s\n", msg);
+        free(msg);
+        return;
+    }
+    printk("Read %s -> %s.\n", path, res);
+    free(res);
+}
+
+static void do_write_test(const char *path, const char *val)
+{
+    char *msg;
+
+    printk("Write %s to %s...\n", val, path);
+    msg = xenbus_write(XBT_NIL, path, val);
+    if ( msg )
+    {
+        printk("Result %s\n", msg);
+        free(msg);
+    }
+    else
+        printk("Success.\n");
+}
+
+static void do_rm_test(const char *path)
+{
+    char *msg;
+
+    printk("rm %s...\n", path);
+    msg = xenbus_rm(XBT_NIL, path);
+    if ( msg )
+    {
+        printk("Result %s\n", msg);
+        free(msg);
+    }
+    else
+        printk("Success.\n");
+}
 
 static void xenbus_tester(void *p)
 {
-    test_xenbus();
+    printk("Doing xenbus test.\n");
+    xenbus_debug_msg("Testing xenbus...\n");
+
+    printk("Doing ls test.\n");
+    do_ls_test("device");
+    do_ls_test("device/vif");
+    do_ls_test("device/vif/0");
+
+    printk("Doing read test.\n");
+    do_read_test("device/vif/0/mac");
+    do_read_test("device/vif/0/backend");
+
+    printk("Doing write test.\n");
+    do_write_test("device/vif/0/flibble", "flobble");
+    do_read_test("device/vif/0/flibble");
+    do_write_test("device/vif/0/flibble", "widget");
+    do_read_test("device/vif/0/flibble");
+
+    printk("Doing rm test.\n");
+    do_rm_test("device/vif/0/flibble");
+    do_read_test("device/vif/0/flibble");
+    printk("(Should have said ENOENT)\n");
 }
 #endif
 
diff --git a/xenbus.c b/xenbus.c
index aa1fe7bf..81e9b65d 100644
--- a/xenbus.c
+++ b/xenbus.c
@@ -964,119 +964,6 @@ 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;
-    int x;
-
-    printk("ls %s...\n", pre);
-    msg = xenbus_ls(XBT_NIL, pre, &dirs);
-    if ( msg )
-    {
-        printk("Error in xenbus ls: %s\n", msg);
-        free(msg);
-        return;
-    }
-
-    for ( x = 0; dirs[x]; x++ )
-    {
-        printk("ls %s[%d] -> %s\n", pre, x, dirs[x]);
-        free(dirs[x]);
-    }
-
-    free(dirs);
-}
-
-static void do_read_test(const char *path)
-{
-    char *res, *msg;
-
-    printk("Read %s...\n", path);
-    msg = xenbus_read(XBT_NIL, path, &res);
-    if ( msg )
-    {
-        printk("Error in xenbus read: %s\n", msg);
-        free(msg);
-        return;
-    }
-    printk("Read %s -> %s.\n", path, res);
-    free(res);
-}
-
-static void do_write_test(const char *path, const char *val)
-{
-    char *msg;
-
-    printk("Write %s to %s...\n", val, path);
-    msg = xenbus_write(XBT_NIL, path, val);
-    if ( msg )
-    {
-        printk("Result %s\n", msg);
-        free(msg);
-    }
-    else
-        printk("Success.\n");
-}
-
-static void do_rm_test(const char *path)
-{
-    char *msg;
-
-    printk("rm %s...\n", path);
-    msg = xenbus_rm(XBT_NIL, path);
-    if ( msg )
-    {
-        printk("Result %s\n", msg);
-        free(msg);
-    }
-    else
-        printk("Success.\n");
-}
-
-/* Simple testing thing */
-void test_xenbus(void)
-{
-    printk("Doing xenbus test.\n");
-    xenbus_debug_msg("Testing xenbus...\n");
-
-    printk("Doing ls test.\n");
-    do_ls_test("device");
-    do_ls_test("device/vif");
-    do_ls_test("device/vif/0");
-
-    printk("Doing read test.\n");
-    do_read_test("device/vif/0/mac");
-    do_read_test("device/vif/0/backend");
-
-    printk("Doing write test.\n");
-    do_write_test("device/vif/0/flibble", "flobble");
-    do_read_test("device/vif/0/flibble");
-    do_write_test("device/vif/0/flibble", "widget");
-    do_read_test("device/vif/0/flibble");
-
-    printk("Doing rm test.\n");
-    do_rm_test("device/vif/0/flibble");
-    do_read_test("device/vif/0/flibble");
-    printk("(Should have said ENOENT)\n");
-}
-#endif /* CONFIG_TEST */
-
 /*
  * Local variables:
  * mode: C
-- 
2.35.3



From minios-devel-bounces@lists.xenproject.org Sun Jan 29 18:50:09 2023
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Sun, 29 Jan 2023 18:50:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.486408.753749 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pMCkc-0000Bx-D1; Sun, 29 Jan 2023 18:50:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 486408.753749; Sun, 29 Jan 2023 18:50:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pMCkc-0000Bq-93; Sun, 29 Jan 2023 18:50:02 +0000
Received: by outflank-mailman (input) for mailman id 486408;
 Sun, 29 Jan 2023 18:50:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=As8j=52=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1pMCka-00007Y-Fx
 for minios-devel@lists.xenproject.org; Sun, 29 Jan 2023 18:50:00 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b84e0226-a005-11ed-b8d1-410ff93cb8f0;
 Sun, 29 Jan 2023 19:49:56 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 4D6B2200FB;
 Sun, 29 Jan 2023 19:49:54 +0100 (CET)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 4AaagANKtKKu; Sun, 29 Jan 2023 19:49:54 +0100 (CET)
Received: from begin (lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr
 [92.158.138.184])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 0289A200F9;
 Sun, 29 Jan 2023 19:49:53 +0100 (CET)
Received: from samy by begin with local (Exim 4.96)
 (envelope-from <samuel.thibault@ens-lyon.org>) id 1pMCkT-000G6W-1i;
 Sun, 29 Jan 2023 19:49:53 +0100
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b84e0226-a005-11ed-b8d1-410ff93cb8f0
Date: Sun, 29 Jan 2023 19:49:53 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH] Mini-OS: move xenbus test code into test.c
Message-ID: <20230129184953.lcfdp23l6pp42c3l@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20230127073346.6992-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230127073346.6992-1-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le ven. 27 janv. 2023 08:33:46 +0100, a ecrit:
> The test code in xenbus.c can easily be moved into test.c.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  test.c   | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++-
>  xenbus.c | 113 -------------------------------------------------------
>  2 files changed, 106 insertions(+), 115 deletions(-)
> 
> diff --git a/test.c b/test.c
> index 42a26661..465c54e8 100644
> --- a/test.c
> +++ b/test.c
> @@ -44,6 +44,7 @@
>  #include <fcntl.h>
>  #include <xen/features.h>
>  #include <xen/version.h>
> +#include <xen/io/xs_wire.h>
>  
>  #ifdef CONFIG_XENBUS
>  static unsigned int do_shutdown = 0;
> @@ -52,11 +53,114 @@ static DECLARE_WAIT_QUEUE_HEAD(shutdown_queue);
>  #endif
>  
>  #ifdef CONFIG_XENBUS
> -void test_xenbus(void);
> +/* 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;
> +    int x;
> +
> +    printk("ls %s...\n", pre);
> +    msg = xenbus_ls(XBT_NIL, pre, &dirs);
> +    if ( msg )
> +    {
> +        printk("Error in xenbus ls: %s\n", msg);
> +        free(msg);
> +        return;
> +    }
> +
> +    for ( x = 0; dirs[x]; x++ )
> +    {
> +        printk("ls %s[%d] -> %s\n", pre, x, dirs[x]);
> +        free(dirs[x]);
> +    }
> +
> +    free(dirs);
> +}
> +
> +static void do_read_test(const char *path)
> +{
> +    char *res, *msg;
> +
> +    printk("Read %s...\n", path);
> +    msg = xenbus_read(XBT_NIL, path, &res);
> +    if ( msg )
> +    {
> +        printk("Error in xenbus read: %s\n", msg);
> +        free(msg);
> +        return;
> +    }
> +    printk("Read %s -> %s.\n", path, res);
> +    free(res);
> +}
> +
> +static void do_write_test(const char *path, const char *val)
> +{
> +    char *msg;
> +
> +    printk("Write %s to %s...\n", val, path);
> +    msg = xenbus_write(XBT_NIL, path, val);
> +    if ( msg )
> +    {
> +        printk("Result %s\n", msg);
> +        free(msg);
> +    }
> +    else
> +        printk("Success.\n");
> +}
> +
> +static void do_rm_test(const char *path)
> +{
> +    char *msg;
> +
> +    printk("rm %s...\n", path);
> +    msg = xenbus_rm(XBT_NIL, path);
> +    if ( msg )
> +    {
> +        printk("Result %s\n", msg);
> +        free(msg);
> +    }
> +    else
> +        printk("Success.\n");
> +}
>  
>  static void xenbus_tester(void *p)
>  {
> -    test_xenbus();
> +    printk("Doing xenbus test.\n");
> +    xenbus_debug_msg("Testing xenbus...\n");
> +
> +    printk("Doing ls test.\n");
> +    do_ls_test("device");
> +    do_ls_test("device/vif");
> +    do_ls_test("device/vif/0");
> +
> +    printk("Doing read test.\n");
> +    do_read_test("device/vif/0/mac");
> +    do_read_test("device/vif/0/backend");
> +
> +    printk("Doing write test.\n");
> +    do_write_test("device/vif/0/flibble", "flobble");
> +    do_read_test("device/vif/0/flibble");
> +    do_write_test("device/vif/0/flibble", "widget");
> +    do_read_test("device/vif/0/flibble");
> +
> +    printk("Doing rm test.\n");
> +    do_rm_test("device/vif/0/flibble");
> +    do_read_test("device/vif/0/flibble");
> +    printk("(Should have said ENOENT)\n");
>  }
>  #endif
>  
> diff --git a/xenbus.c b/xenbus.c
> index aa1fe7bf..81e9b65d 100644
> --- a/xenbus.c
> +++ b/xenbus.c
> @@ -964,119 +964,6 @@ 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;
> -    int x;
> -
> -    printk("ls %s...\n", pre);
> -    msg = xenbus_ls(XBT_NIL, pre, &dirs);
> -    if ( msg )
> -    {
> -        printk("Error in xenbus ls: %s\n", msg);
> -        free(msg);
> -        return;
> -    }
> -
> -    for ( x = 0; dirs[x]; x++ )
> -    {
> -        printk("ls %s[%d] -> %s\n", pre, x, dirs[x]);
> -        free(dirs[x]);
> -    }
> -
> -    free(dirs);
> -}
> -
> -static void do_read_test(const char *path)
> -{
> -    char *res, *msg;
> -
> -    printk("Read %s...\n", path);
> -    msg = xenbus_read(XBT_NIL, path, &res);
> -    if ( msg )
> -    {
> -        printk("Error in xenbus read: %s\n", msg);
> -        free(msg);
> -        return;
> -    }
> -    printk("Read %s -> %s.\n", path, res);
> -    free(res);
> -}
> -
> -static void do_write_test(const char *path, const char *val)
> -{
> -    char *msg;
> -
> -    printk("Write %s to %s...\n", val, path);
> -    msg = xenbus_write(XBT_NIL, path, val);
> -    if ( msg )
> -    {
> -        printk("Result %s\n", msg);
> -        free(msg);
> -    }
> -    else
> -        printk("Success.\n");
> -}
> -
> -static void do_rm_test(const char *path)
> -{
> -    char *msg;
> -
> -    printk("rm %s...\n", path);
> -    msg = xenbus_rm(XBT_NIL, path);
> -    if ( msg )
> -    {
> -        printk("Result %s\n", msg);
> -        free(msg);
> -    }
> -    else
> -        printk("Success.\n");
> -}
> -
> -/* Simple testing thing */
> -void test_xenbus(void)
> -{
> -    printk("Doing xenbus test.\n");
> -    xenbus_debug_msg("Testing xenbus...\n");
> -
> -    printk("Doing ls test.\n");
> -    do_ls_test("device");
> -    do_ls_test("device/vif");
> -    do_ls_test("device/vif/0");
> -
> -    printk("Doing read test.\n");
> -    do_read_test("device/vif/0/mac");
> -    do_read_test("device/vif/0/backend");
> -
> -    printk("Doing write test.\n");
> -    do_write_test("device/vif/0/flibble", "flobble");
> -    do_read_test("device/vif/0/flibble");
> -    do_write_test("device/vif/0/flibble", "widget");
> -    do_read_test("device/vif/0/flibble");
> -
> -    printk("Doing rm test.\n");
> -    do_rm_test("device/vif/0/flibble");
> -    do_read_test("device/vif/0/flibble");
> -    printk("(Should have said ENOENT)\n");
> -}
> -#endif /* CONFIG_TEST */
> -
>  /*
>   * Local variables:
>   * mode: C
> -- 
> 2.35.3
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.


From minios-devel-bounces@lists.xenproject.org Sun Jan 29 18:50:11 2023
Return-path: <minios-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Sun, 29 Jan 2023 18:50:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.486410.753763 (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pMCkl-0001FW-PU; Sun, 29 Jan 2023 18:50:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 486410.753763; Sun, 29 Jan 2023 18:50:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <minios-devel-bounces@lists.xenproject.org>)
	id 1pMCkl-0001FO-Lm; Sun, 29 Jan 2023 18:50:11 +0000
Received: by outflank-mailman (input) for mailman id 486410;
 Sun, 29 Jan 2023 18:50:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=As8j=52=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1pMCkk-00007Y-JY
 for minios-devel@lists.xenproject.org; Sun, 29 Jan 2023 18:50:10 +0000
Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c0103a7b-a005-11ed-b8d1-410ff93cb8f0;
 Sun, 29 Jan 2023 19:50:07 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 6C37B200FB;
 Sun, 29 Jan 2023 19:50:07 +0100 (CET)
Received: from sonata.ens-lyon.org ([127.0.0.1])
 by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 5T9GIAFM5FCn; Sun, 29 Jan 2023 19:50:06 +0100 (CET)
Received: from begin (lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr
 [92.158.138.184])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by sonata.ens-lyon.org (Postfix) with ESMTPSA id 642D4200F9;
 Sun, 29 Jan 2023 19:50:06 +0100 (CET)
Received: from samy by begin with local (Exim 4.96)
 (envelope-from <samuel.thibault@ens-lyon.org>) id 1pMCkg-000G6l-38;
 Sun, 29 Jan 2023 19:50:06 +0100
X-BeenThere: minios-devel@lists.xenproject.org
List-Id: Mini-os development list <minios-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:minios-devel@lists.xenproject.org>
List-Help: <mailto:minios-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/minios-devel>, 
 <mailto:minios-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: minios-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Minios-devel" <minios-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c0103a7b-a005-11ed-b8d1-410ff93cb8f0
Date: Sun, 29 Jan 2023 19:50:06 +0100
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Juergen Gross <jgross@suse.com>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org,
	wl@xen.org
Subject: Re: [PATCH] Mini-OS: remove stale subdirs from Makefile
Message-ID: <20230129185006.p44xmmrlppiaayru@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org, wl@xen.org
References: <20230127073244.6883-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20230127073244.6883-1-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le ven. 27 janv. 2023 08:32:44 +0100, a ecrit:
> The SUBDIRS make variable has some stale entries, remove them.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index f3acdd2f..747c7c01 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -34,7 +34,7 @@ EXTRA_OBJS =
>  TARGET := mini-os
>  
>  # Subdirectories common to mini-os
> -SUBDIRS := lib xenbus console
> +SUBDIRS := lib
>  
>  src-$(CONFIG_BLKFRONT) += blkfront.c
>  src-$(CONFIG_CONSFRONT) += consfront.c
> -- 
> 2.35.3
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.


