Hello Samuel,

I have reworked the second patch after the preparatory one and the
recent changes of Mike.

Feedbacks are welcome, as always.

Cheers,

Gianluca

PS: The second patch follows and if you prefer a simple git diff, I
will adjust accordingly.

>From 89613f5c339760aa4ba2fb7fa679c2ea6808a541 Mon Sep 17 00:00:00 2001
From: Gianluca Cannata <[email protected]>
Date: Thu, 29 Oct 2026 09:03:15 +0100
Subject: [PATCH] rumpdisk: Add support for NVMe disks

---
 rumpdisk/Makefile     |  4 ++--
 rumpdisk/block-rump.c | 17 +++++++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/rumpdisk/Makefile b/rumpdisk/Makefile
index de33c65d..7b5947b8 100644
--- a/rumpdisk/Makefile
+++ b/rumpdisk/Makefile
@@ -1,5 +1,5 @@
 #
-#   Copyright (C) 2019, 2023 Free Software Foundation, Inc.
+#   Copyright (C) 2019, 2023, 2026 Free Software Foundation, Inc.
 #
 #   This program is free software; you can redistribute it and/or
 #   modify it under the terms of the GNU General Public License as
@@ -16,7 +16,7 @@
 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

 RUMPLIBS=rump rumpuser rumpdev rumpdev_disk rumpdev_pci rumpvfs
-RUMPSATA=rumpdev_ahcisata rumpdev_piixide rumpdev_ata
+RUMPSATA=rumpdev_ahcisata rumpdev_piixide rumpdev_ata rumpdev_nvme
rumpdev_ld_nvme rumpdev_ld
 RUMPUSB=rumpdev_usb rumpdev_pci_usbhc rumpdev_umass rumpdev_scsipi
 RUMPEXTRA=rumpdev_scsipi

diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c
index 9e41dc73..0df7ceee 100644
--- a/rumpdisk/block-rump.c
+++ b/rumpdisk/block-rump.c
@@ -1,7 +1,7 @@
 /*
  * Rump block driver support
  *
- * Copyright (C) 2019 Free Software Foundation
+ * Copyright (C) 2019, 2026 Free Software Foundation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@
 #endif

 #ifdef _RUMP_SATA
-#define RUMP_TYPE_STRING "rump SATA/IDE"
+#define RUMP_TYPE_STRING "rump SATA/IDE/NVMe"
 #else
 #define RUMP_TYPE_STRING "rump USB"
 #endif
@@ -132,6 +132,7 @@ is_disk_device (const char *name)
   const char *allowed_devs[] = {
 #ifdef _RUMP_SATA
     "wd",
+    "ld",
 #else
     "sd",
 #endif
@@ -178,6 +179,18 @@ rumpdisk_device_init (void)
       device_t device;

 #ifdef _RUMP_SATA
+      if (! device_open (device_master, D_READ, "ld0", &device)
+       || ! device_open (device_master, D_READ, "ld1", &device)
+       || ! device_open (device_master, D_READ, "ld3", &device)
+       || ! device_open (device_master, D_READ, "ld2", &device))
+    {
+      device_close (device);
+      mach_port_deallocate (mach_task_self (), device);
+      fprintf(stderr, "Kernel is already driving a Logic Disk device,
skipping probing disks\n");
+      fflush(stderr);
+      disabled = 1;
+      return;
+    }
 #if 0
       if (! device_open (device_master, D_READ, "hd0", &device)
        || ! device_open (device_master, D_READ, "hd1", &device)
-- 
2.55.0

Reply via email to