Displaying 9 results from an estimated 9 matches for "virtual_floppy".
2018 Oct 28
0
[PATCH nbdkit 4/4] Add floppy plugin.
.../* Short basename. */
+ char short_ext[3]; /* Short file extension. */
+ char *lfn; /* Long filename for MS-DOS as UTF16-LE. */
+ size_t lfn_size; /* Size *in bytes* of lfn. */
+};
+
+static int add_volume_label (const char *label, size_t di, struct virtual_floppy *floppy);
+static int add_dot_entries (size_t di, struct virtual_floppy *floppy);
+static int add_directory_entry (const struct lfn *lfn, uint8_t attributes, uint32_t file_size, struct stat *statbuf, size_t di, struct virtual_floppy *floppy);
+static void set_times (const struct stat *statbuf, stru...
2020 Apr 15
0
[PATCH nbdkit 2/9] floppy, iso, split, ssh: Use new vector type to store lists of strings.
...ntry);
+
/* On disk directory entry (LFN). */
struct lfn_entry {
uint8_t seq; /* sequence number */
@@ -162,8 +166,7 @@ struct dir {
size_t nr_files;
/* On disk directory table. */
- struct dir_entry *table;
- size_t table_entries;
+ dir_entries table;
};
struct virtual_floppy {
diff --git a/plugins/floppy/directory-lfn.c b/plugins/floppy/directory-lfn.c
index 10caf84b..e06680e9 100644
--- a/plugins/floppy/directory-lfn.c
+++ b/plugins/floppy/directory-lfn.c
@@ -71,7 +71,7 @@ static void set_times (const struct stat *statbuf, struct dir_entry *entry);
static int convert...
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
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...e_stats *ret)
+ __attribute__((__nonnull__ (1, 2)));
#endif /* NBDKIT_XZFILE_H */
diff --git a/plugins/floppy/virtual-floppy.h b/plugins/floppy/virtual-floppy.h
index 5a50c62..d9111b0 100644
--- a/plugins/floppy/virtual-floppy.h
+++ b/plugins/floppy/virtual-floppy.h
@@ -223,11 +223,20 @@ struct virtual_floppy {
#define SECTORS_PER_CLUSTER 32
#define CLUSTER_SIZE (SECTOR_SIZE * SECTORS_PER_CLUSTER)
-extern void init_virtual_floppy (struct virtual_floppy *floppy);
-extern int create_virtual_floppy (const char *dir, const char *label, struct virtual_floppy *floppy);
-extern void free_virtual_floppy (st...
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html
In v2 I have provided two patches:
The first patch extends attribute((nonnull)) to most internal
functions, but not to the external API.
The second patch uses a macro so that attribute((format)) is only used
in the public API on GCC or Clang. At least in theory these headers
could be used by a C compiler which
2018 Oct 30
2
Re: [PATCH nbdkit 4/4] Add floppy plugin.
...+ size_t lfn_size; /* Size *in bytes* of lfn. */
Including or excluding the trailing 2 bytes for a terminating NUL character?
> +/* Create the on disk directory table for dirs[di]. */
> +int
> +create_directory (size_t di, const char *label,
> + struct virtual_floppy *floppy)
> +{
> + /* Add files. */
> + attributes = DIR_ENTRY_ARCHIVE; /* Same as set by Linux kernel. */
> + for (i = 0; i < nr_files; ++i) {
> + const size_t fi = floppy->dirs[di].files[i];
> + assert (fi < floppy->nr_files);
> +
> + lfn = &lfn...
2018 Oct 30
1
Re: [PATCH nbdkit 4/4] Add floppy plugin.
...name, &statbuf, di, floppy) == -1)
>>> + goto error2;
>>> + }
...and visit_file(). Looking at just visit_file():
> +static int
> +visit_file (const char *dir, const char *name,
> + const struct stat *statbuf, size_t di,
> + struct virtual_floppy *floppy)
> +{
> + void *np;
> + char *host_path;
> + size_t fi, i;
> +
> + if (asprintf (&host_path, "%s/%s", dir, name) == -1) {
> + nbdkit_error ("asprintf: %m");
> + return -1;
> + }
asprintf() may have modified errno...
> + /*...
2020 Apr 15
18
[PATCH nbdkit 0/9] Generic vector, and pass $nbdkit_stdio_safe to shell scripts.
This was a rather longer trip around the houses than I anticipated!
The basic purpose of the patch series is to set $nbdkit_stdio_safe to
"0" or "1" in sh and eval plugin scripts.
To do that, I ended up adding a nicer way to manipulate environ lists,
and to do that, I ended up adding a whole generic vector
implementation which is applicable in a lot of different places.
2020 Feb 25
6
[PATCH nbdkit 0/5] server: Add .get_ready callback.
I like this change. I think we were overloading the config_complete
method before to do two different things (complete configuration; do
any allocation/housekeeping necessary before we can start serving).
The only questions in my mind are whether we want this before 1.18,
and whether the name ("get_ready") is a good one.
Rich.