Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpvfs Release all hypervisor-level resour...



details:   https://anonhg.NetBSD.org/src/rev/283b6fa77969
branches:  trunk
changeset: 333817:283b6fa77969
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Nov 17 14:30:31 2014 +0000

description:
Release all hypervisor-level resources for rump_etfs paths when the
rump kernel is halted.

Allows a Xen domU to not complain after it was shut down, or something
like that.  Requested by Martin Lucina.

diffstat:

 sys/rump/librump/rumpvfs/rump_vfs.c         |   5 +++--
 sys/rump/librump/rumpvfs/rump_vfs_private.h |   3 ++-
 sys/rump/librump/rumpvfs/rumpblk.c          |  23 +++++++++++++++++++++--
 3 files changed, 26 insertions(+), 5 deletions(-)

diffs (87 lines):

diff -r 73b167ea30d1 -r 283b6fa77969 sys/rump/librump/rumpvfs/rump_vfs.c
--- a/sys/rump/librump/rumpvfs/rump_vfs.c       Mon Nov 17 13:58:53 2014 +0000
+++ b/sys/rump/librump/rumpvfs/rump_vfs.c       Mon Nov 17 14:30:31 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_vfs.c,v 1.80 2014/05/23 10:56:36 pooka Exp $      */
+/*     $NetBSD: rump_vfs.c,v 1.81 2014/11/17 14:30:31 pooka Exp $      */
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.80 2014/05/23 10:56:36 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.81 2014/11/17 14:30:31 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -79,6 +79,7 @@
 {
 
        vfs_shutdown();
+       rumpblk_fini();
 }
 
 static void
diff -r 73b167ea30d1 -r 283b6fa77969 sys/rump/librump/rumpvfs/rump_vfs_private.h
--- a/sys/rump/librump/rumpvfs/rump_vfs_private.h       Mon Nov 17 13:58:53 2014 +0000
+++ b/sys/rump/librump/rumpvfs/rump_vfs_private.h       Mon Nov 17 14:30:31 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_vfs_private.h,v 1.17 2013/03/07 22:12:34 pooka Exp $      */
+/*     $NetBSD: rump_vfs_private.h,v 1.18 2014/11/17 14:30:31 pooka Exp $      */
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -40,6 +40,7 @@
 int    rumpblk_register(const char *, devminor_t *, uint64_t, uint64_t);
 int    rumpblk_deregister(const char *);
 int    rumpblk_init(void);
+void   rumpblk_fini(void);
 
 void   rump_biodone(void *, size_t, int);
 
diff -r 73b167ea30d1 -r 283b6fa77969 sys/rump/librump/rumpvfs/rumpblk.c
--- a/sys/rump/librump/rumpvfs/rumpblk.c        Mon Nov 17 13:58:53 2014 +0000
+++ b/sys/rump/librump/rumpvfs/rumpblk.c        Mon Nov 17 14:30:31 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpblk.c,v 1.57 2014/07/25 08:10:40 dholland Exp $    */
+/*     $NetBSD: rumpblk.c,v 1.58 2014/11/17 14:30:31 pooka Exp $       */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpblk.c,v 1.57 2014/07/25 08:10:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpblk.c,v 1.58 2014/11/17 14:30:31 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -341,6 +341,25 @@
        return 0;
 }
 
+/*
+ * Release all backend resources, to be called only when the rump
+ * kernel is being shut down.
+ * This routine does not do a full "fini" since we're going down anyway.
+ */
+void
+rumpblk_fini(void)
+{
+       int i;
+
+       for (i = 0; i < RUMPBLK_SIZE; i++) {
+               struct rblkdev *rblk;
+
+               rblk = &minors[i];
+               if (rblk->rblk_fd != -1)
+                       backend_close(rblk);
+       }
+}
+
 static int
 backend_open(struct rblkdev *rblk, const char *path)
 {



Home | Main Index | Thread Index | Old Index