Displaying 4 results from an estimated 4 matches for "floppy_config".
2018 Oct 30
0
Re: [PATCH nbdkit 4/4] Add floppy plugin.
...the LFN code and
observing that Linux could still view the partition).
I don't believe that qemu can run whatever ancient MS-DOS predates
LFNs (like is it MS-DOS < 6?); or that there is another hypervisor
that can run ancient DOS and also supports NBD drives.
> >+static int
> >+floppy_config (const char *key, const char *value)
> >+{
> >+ if (strcmp (key, "dir") == 0) {
> >+ dir = nbdkit_realpath (value);
> >+ if (dir == NULL)
> >+ return -1;
> >+ }
>
> Should you error if the user passes more than one dir= instead of
&g...
2018 Oct 30
2
Re: [PATCH nbdkit 4/4] Add floppy plugin.
..., struct virtual_floppy *floppy)
> +{
> + struct dir_entry *p;
> + size_t i;
> +
> + i = floppy->dirs[di].table_entries;
> + p = realloc (floppy->dirs[di].table, sizeof (struct dir_entry) * (i+1));
More spacing
> +++ b/plugins/floppy/floppy.c
> +static int
> +floppy_config (const char *key, const char *value)
> +{
> + if (strcmp (key, "dir") == 0) {
> + dir = nbdkit_realpath (value);
> + if (dir == NULL)
> + return -1;
> + }
Should you error if the user passes more than one dir= instead of
leaking the earlier one?
> +++...
2018 Oct 28
6
[PATCH nbdkit 0/4] Add floppy plugin.
Add nbdkit-floppy-plugin, “inspired” by qemu's VVFAT driver, but
without the ability to handle writes.
The implementation is pretty complete, supporting FAT32, LFNs, volume
labels, timestamps, etc, and it passes both ‘make check’ and ‘make
check-valgrind’.
Usage is simple; to serve the current directory:
$ nbdkit floppy .
Then using guestfish (or any NBD client):
$ guestfish --ro
2018 Oct 28
0
[PATCH nbdkit 4/4] Add floppy plugin.
...c const char *label = "NBDKITFLOPY";
+
+/* Virtual floppy. */
+static struct virtual_floppy floppy;
+
+static void
+floppy_load (void)
+{
+ init_virtual_floppy (&floppy);
+}
+
+static void
+floppy_unload (void)
+{
+ free (dir);
+ free_virtual_floppy (&floppy);
+}
+
+static int
+floppy_config (const char *key, const char *value)
+{
+ if (strcmp (key, "dir") == 0) {
+ dir = nbdkit_realpath (value);
+ if (dir == NULL)
+ return -1;
+ }
+ else if (strcmp (key, "label") == 0) {
+ label = value;
+ }
+ else {
+ nbdkit_error ("unknown parameter ...