bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 4/6] rumpdisk: Don't pretend to be the arbiter anymore


From: Damien Zammit
Subject: [PATCH 4/6] rumpdisk: Don't pretend to be the arbiter anymore
Date: Sun, 7 Mar 2021 17:39:08 +1100

---
 rumpdisk/block-rump.c | 16 +++++++++++++---
 rumpdisk/main.c       |  5 -----
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c
index 3ee0773d..584056f7 100644
--- a/rumpdisk/block-rump.c
+++ b/rumpdisk/block-rump.c
@@ -27,6 +27,7 @@
 
 #include <mach.h>
 #include <hurd.h>
+#include <hurd/fsys.h> /* fsys_getpriv */
 #include <hurd/ports.h>
 #include <device/device.h>
 
@@ -136,12 +137,12 @@ dev_mode_to_rump_mode (const dev_mode_t mode)
 static void
 rumpdisk_device_init (void)
 {
-  mach_port_t device_master;
+  mach_port_t bootport, device_master;
+  device_t device;
+  task_t fstask;
 
   if (! get_privileged_ports (0, &device_master))
     {
-      device_t device;
-
 #if 0
       if (! device_open (device_master, D_READ, "hd0", &device)
        || ! device_open (device_master, D_READ, "hd1", &device)
@@ -164,6 +165,15 @@ rumpdisk_device_init (void)
          return;
        }
     }
+
+  /* FIXME: need to synchronise with arbiter to wait for fsys_startup */
+  sleep(1);
+  
+  task_get_bootstrap_port (mach_task_self (), &bootport);
+  fsys_getpriv (bootport, &_hurd_host_priv, &_hurd_device_master, &fstask);
+
+  sleep(1);
+
   rump_init ();
 }
 
diff --git a/rumpdisk/main.c b/rumpdisk/main.c
index a26e17cb..c01372eb 100644
--- a/rumpdisk/main.c
+++ b/rumpdisk/main.c
@@ -31,11 +31,6 @@
 #include <pthread.h>
 #include <mach.h>
 
-/* TODO: Add api to pciaccess to allow selecting backend.
- * For now we pretend to be the arbiter and claim x86 method.
- */
-char *netfs_server_name = "pci-arbiter";
-
 mach_port_t bootstrap_resume_task = MACH_PORT_NULL;
 
 static const struct argp_option options[] = {
-- 
2.30.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]