Module Name: src
Committed By: pooka
Date: Mon Jan 3 10:44:40 UTC 2011
Modified Files:
src/usr.bin/rump_allserver: rump_allserver.1 rump_allserver.c
Log Message:
Add -c to control the number of CPUs configured in the kernel.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/rump_allserver/rump_allserver.1
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/rump_allserver/rump_allserver.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/rump_allserver/rump_allserver.1
diff -u src/usr.bin/rump_allserver/rump_allserver.1:1.6 src/usr.bin/rump_allserver/rump_allserver.1:1.7
--- src/usr.bin/rump_allserver/rump_allserver.1:1.6 Wed Dec 15 18:42:59 2010
+++ src/usr.bin/rump_allserver/rump_allserver.1 Mon Jan 3 10:44:40 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: rump_allserver.1,v 1.6 2010/12/15 18:42:59 pooka Exp $
+.\" $NetBSD: rump_allserver.1,v 1.7 2011/01/03 10:44:40 pooka Exp $
.\"
.\" Copyright (c) 2010 Antti Kantee. All rights reserved.
.\"
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 14, 2010
+.Dd January 3, 2011
.Dt RUMP_SERVER 1
.Os
.Sh NAME
@@ -33,6 +33,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl s
+.Op Fl c Ar ncpu
.Op Fl d Ar drivespec
.Op Fl l Ar library
.Op Fl m Ar module
@@ -60,6 +61,12 @@
At execution time it is possible to load components from the command
line as described in the options section.
.Bl -tag -width indent
+.It Fl c Ar ncpu
+Configure
+.Ar ncpu
+virtual CPUs on SMP-capable archs.
+By default, the number of CPUs equals the number of CPUs on the
+host.
.It Fl d Ar drivespec
The argument
.Ar drivespec
Index: src/usr.bin/rump_allserver/rump_allserver.c
diff -u src/usr.bin/rump_allserver/rump_allserver.c:1.11 src/usr.bin/rump_allserver/rump_allserver.c:1.12
--- src/usr.bin/rump_allserver/rump_allserver.c:1.11 Wed Dec 15 19:07:43 2010
+++ src/usr.bin/rump_allserver/rump_allserver.c Mon Jan 3 10:44:40 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: rump_allserver.c,v 1.11 2010/12/15 19:07:43 pooka Exp $ */
+/* $NetBSD: rump_allserver.c,v 1.12 2011/01/03 10:44:40 pooka Exp $ */
/*-
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: rump_allserver.c,v 1.11 2010/12/15 19:07:43 pooka Exp $");
+__RCSID("$NetBSD: rump_allserver.c,v 1.12 2011/01/03 10:44:40 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -51,8 +51,8 @@
usage(void)
{
- fprintf(stderr, "usage: %s [-s] [-d drivespec] [-l libs] [-m modules] "
- "bindurl\n", getprogname());
+ fprintf(stderr, "usage: %s [-s] [-c ncpu]�[-d drivespec] [-l libs] "
+ "[-m modules] bindurl\n", getprogname());
exit(1);
}
@@ -101,12 +101,21 @@
unsigned netfs = 0, curetfs = 0;
int error;
int ch, sflag;
+ int ncpu;
setprogname(argv[0]);
sflag = 0;
- while ((ch = getopt(argc, argv, "d:l:m:s")) != -1) {
+ while ((ch = getopt(argc, argv, "c:d:l:m:s")) != -1) {
switch (ch) {
+ case 'c':
+ ncpu = atoi(optarg);
+ /* XXX: MAXCPUS is from host, not from kernel */
+ if (ncpu < 1 || ncpu > MAXCPUS)
+ err(1, "CPU count needs to be between "
+ "1 and %d\n", MAXCPUS);
+ setenv("RUMP_NCPU", optarg, 1);
+ break;
case 'd': {
char *options, *value;
char *key, *hostpath;