Source-Changes-HG archive

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

[src/trunk]: src Version rumpuser ABI with a lightweight mechanism.



details:   https://anonhg.NetBSD.org/src/rev/84a80f544ee2
branches:  trunk
changeset: 755563:84a80f544ee2
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jun 09 14:08:17 2010 +0000

description:
Version rumpuser ABI with a lightweight mechanism.

diffstat:

 lib/librumpuser/rumpuser.c       |  11 +++++++++--
 sys/rump/include/rump/rumpuser.h |   5 ++++-
 sys/rump/librump/rumpkern/rump.c |  11 +++++++++--
 3 files changed, 22 insertions(+), 5 deletions(-)

diffs (83 lines):

diff -r d69f06f40aff -r 84a80f544ee2 lib/librumpuser/rumpuser.c
--- a/lib/librumpuser/rumpuser.c        Wed Jun 09 13:51:02 2010 +0000
+++ b/lib/librumpuser/rumpuser.c        Wed Jun 09 14:08:17 2010 +0000
@@ -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;
diff -r d69f06f40aff -r 84a80f544ee2 sys/rump/include/rump/rumpuser.h
--- a/sys/rump/include/rump/rumpuser.h  Wed Jun 09 13:51:02 2010 +0000
+++ b/sys/rump/include/rump/rumpuser.h  Wed Jun 09 14:08:17 2010 +0000
@@ -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;
diff -r d69f06f40aff -r 84a80f544ee2 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Wed Jun 09 13:51:02 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Wed Jun 09 14:08:17 2010 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index