Source-Changes-HG archive

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

[src/trunk]: src/sbin/raidctl Update RUMP_ACTION to use rumpclient.



details:   https://anonhg.NetBSD.org/src/rev/cf329e939ac5
branches:  trunk
changeset: 758562:cf329e939ac5
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Nov 08 12:42:35 2010 +0000

description:
Update RUMP_ACTION to use rumpclient.

The server must of course have some disks configured.  Let's say
we have this simple server with disks as a few sparse host files:

main()
{
        rump_init();
        rump_pub_etfs_register("/disk1", "./disk1.img", RUMP_ETFS_BLK);
        rump_pub_etfs_register("/disk2", "./disk2.img", RUMP_ETFS_BLK);
        rump_pub_etfs_register("/disk3", "./disk3.img", RUMP_ETFS_BLK);
        rump_pub_etfs_register("/disk4", "./disk4.img", RUMP_ETFS_BLK);
        pause();
}

And we run the server:

mainbus0 (root)
Kernelized RAIDframe activated
/disk1: hostpath ./disk1.img (97 GB)
/disk2: hostpath ./disk2.img (97 GB)
/disk3: hostpath ./disk3.img (97 GB)
/disk4: hostpath ./disk4.img (97 GB)

We can then configure the raid against the server:

> ./raidctl -c theraid.conf raid0

And lo, we have evidence of a level1 raid in the server dmesg:

raid0: RAID Level 1
raid0: Components: /disk1 /disk2 /disk3 /disk4
raid0: Total Sectors: 409599744 (199999 MB)

yea, i initialized it already in a previous run:

> ./raidctl -S raid0
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.

diffstat:

 sbin/raidctl/Makefile  |   5 ++---
 sbin/raidctl/raidctl.c |  10 +++++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r 5734401d7a8d -r cf329e939ac5 sbin/raidctl/Makefile
--- a/sbin/raidctl/Makefile     Mon Nov 08 12:06:47 2010 +0000
+++ b/sbin/raidctl/Makefile     Mon Nov 08 12:42:35 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.14 2009/10/11 12:51:58 pooka Exp $
+#      $NetBSD: Makefile,v 1.15 2010/11/08 12:42:35 pooka Exp $
 
 PROG=  raidctl 
 SRCS=  rf_configure.c raidctl.c
@@ -9,8 +9,7 @@
 
 .ifdef RUMP_ACTION
 CPPFLAGS+=     -DRUMP_ACTION -DRUMP_SYS_IOCTL -DRUMP_SYS_CLOSE
-LDADD+=                -lrumpdev_disk -lrumpdev_raidframe -lrumpdev
-LDADD+=                -lrumpvfs -lrump -lrumpuser -lpthread
+LDADD+=                -lrumpclient
 DBG=           -g
 .endif
 
diff -r 5734401d7a8d -r cf329e939ac5 sbin/raidctl/raidctl.c
--- a/sbin/raidctl/raidctl.c    Mon Nov 08 12:06:47 2010 +0000
+++ b/sbin/raidctl/raidctl.c    Mon Nov 08 12:42:35 2010 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: raidctl.c,v 1.48 2010/03/16 03:23:47 jld Exp $   */
+/*      $NetBSD: raidctl.c,v 1.49 2010/11/08 12:42:35 pooka Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.48 2010/03/16 03:23:47 jld Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.49 2010/11/08 12:42:35 pooka Exp $");
 #endif
 
 
@@ -58,8 +58,11 @@
 #include <unistd.h>
 #include <util.h>
 
+#ifdef RUMP_ACTION
 #include <rump/rump.h>
+#include <rump/rumpclient.h>
 #include <rump/rump_syscalls.h>
+#endif
 
 #include <dev/raidframe/raidframevar.h>
 #include <dev/raidframe/raidframeio.h>
@@ -125,7 +128,8 @@
        openmode = O_RDWR;      /* default to read/write */
 
 #ifdef RUMP_ACTION
-       rump_init();
+       if (rumpclient_init() == -1)
+               err(1, "rump client init failed");
 #endif
 
        while ((ch = getopt(argc, argv, "a:A:Bc:C:f:F:g:GiI:l:mM:r:R:sSpPuv")) 



Home | Main Index | Thread Index | Old Index