Gianluca Cannata, le lun. 26 oct. 2026 11:33:57 +0100, a ecrit:
> Il giorno lun 26 ott 2026 alle ore 11:15 Samuel Thibault
> <[email protected]> ha scritto:
> >
> > Thanks for having a look at it.
> >
> > ? Those libraries do not exest at the moment.
>
> I know. Shall I leave them off for the time being or shall I
> coordinate with Mike for a naming convention ?
Better commit adding the library to the link with the code addition,
otherwise future readers of the commit will be surprised.
> > This is overriding the rules above. You don't need new rules, you just
> > need to add the NVME part in the existing rule above.
>
> Patch updated. Hope I got what you meant.
That is it, yes.
> > I don't think we really want to have a different translator for SATA and
> > NVMe. For USB the question is different because the USB stack will bring
> > complexity and we'll want to manage that differently.
> >
> > I.e. you'd just add the nvme part in the _RUMP_SATA case.
>
> Same as the last sentence.
Yes, but
> diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c
> index aa4a387f..dff93715 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
> @@ -47,10 +47,10 @@
> #define BLKRRPART 0x125F /* re-read partition table */
>
> #define DISK_NAME_LEN 32
> -#define MAX_DISK_DEV 2
> +#define MAX_DISK_DEV 4
You just need 3.
>
> #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
> @@ -125,6 +125,7 @@ is_disk_device (const char *name)
> const char *allowed_devs[MAX_DISK_DEV] = {
> #ifdef _RUMP_SATA
> "wd",
> + "ld",
> #else
> "sd",
> #endif
Now in the USB case we will have a NULL entry, the for loop needs to be
fixed otherwise it can crash.
But I don't think we need MAX_DISK_DEV at all: you can just drop the
size from the allowed_devs array so it's automatically computed, and
make the for loop use sizeof(allowed_devs)/sizeof(allowed_devs[0]) to
know how many elements there are in the array. That can be a preparatory
patch that we can commit already.
Samuel
> @@ -171,6 +172,19 @@ 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, "ld2", &device)
> + || ! device_open (device_master, D_READ, "ld3", &device))
> + {
> + device_close (device);
> + mach_port_deallocate (mach_task_self (), device);
> + mach_port_deallocate (mach_task_self (), device_master);
> + 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)
>