Module Name:    src
Committed By:   pooka
Date:           Wed Jun  9 14:08:17 UTC 2010

Modified Files:
        src/lib/librumpuser: rumpuser.c
        src/sys/rump/include/rump: rumpuser.h
        src/sys/rump/librump/rumpkern: rump.c

Log Message:
Version rumpuser ABI with a lightweight mechanism.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/librumpuser/rumpuser.c
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.176 -r1.177 src/sys/rump/librump/rumpkern/rump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumpuser/rumpuser.c
diff -u src/lib/librumpuser/rumpuser.c:1.7 src/lib/librumpuser/rumpuser.c:1.8
--- src/lib/librumpuser/rumpuser.c:1.7	Wed Jun  9 11:35:36 2010
+++ src/lib/librumpuser/rumpuser.c	Wed Jun  9 14:08:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.c,v 1.7 2010/06/09 11:35:36 pooka Exp $	*/
+/*	$NetBSD: rumpuser.c,v 1.8 2010/06/09 14:08:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.7 2010/06/09 11:35:36 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.8 2010/06/09 14:08:17 pooka Exp $");
 #endif /* !lint */
 
 /* thank the maker for this */
@@ -68,6 +68,13 @@
 #include "rumpuser_int.h"
 
 int
+rumpuser_getversion()
+{
+
+	return RUMPUSER_VERSION;
+}
+
+int
 rumpuser_getfileinfo(const char *path, uint64_t *sizep, int *ftp, int *error)
 {
 	struct stat sb;

Index: src/sys/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.44 src/sys/rump/include/rump/rumpuser.h:1.45
--- src/sys/rump/include/rump/rumpuser.h:1.44	Wed Jun  9 11:35:36 2010
+++ src/sys/rump/include/rump/rumpuser.h	Wed Jun  9 14:08:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.h,v 1.44 2010/06/09 11:35:36 pooka Exp $	*/
+/*	$NetBSD: rumpuser.h,v 1.45 2010/06/09 14:08:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -36,6 +36,9 @@
 #include <stdint.h>
 #endif
 
+#define RUMPUSER_VERSION 1
+int rumpuser_getversion(void);
+
 struct msghdr;
 struct pollfd;
 struct sockaddr;

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.176 src/sys/rump/librump/rumpkern/rump.c:1.177
--- src/sys/rump/librump/rumpkern/rump.c:1.176	Wed Jun  9 13:51:02 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Jun  9 14:08:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.176 2010/06/09 13:51:02 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.177 2010/06/09 14:08:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.176 2010/06/09 13:51:02 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.177 2010/06/09 14:08:17 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -217,6 +217,13 @@
 	else
 		rump_inited = 1;
 
+	if (rumpuser_getversion() != RUMPUSER_VERSION) {
+		/* let's hope the ABI of rumpuser_dprintf is the same ;) */
+		rumpuser_dprintf("rumpuser version mismatch: %d vs. %d\n",
+		    rumpuser_getversion(), RUMPUSER_VERSION);
+		return EPROGMISMATCH;
+	}
+
 	if (rumpuser_getenv("RUMP_VERBOSE", buf, sizeof(buf), &error) == 0) {
 		if (*buf != '0')
 			boothowto = AB_VERBOSE;

Reply via email to