Displaying 20 results from an estimated 41 matches for "nr_files".
2019 Jan 20
1
[PATCH nbdkit] partitioning: Support MBR logical partitions.
An evolution of the patch I posted yesterday to qemu-devel
(https://www.mail-archive.com/qemu-devel@nongnu.org/msg588920.html)
which (a) works and (b) has a test.
Rich.
2019 Jan 21
0
[PATCH nbdkit v2 1/4] partitioning plugin: Support MBR logical partitions.
...nts will not be able to handle this.
diff --git a/plugins/partitioning/virtual-disk.h b/plugins/partitioning/virtual-disk.h
index 8b798a1..f59df70 100644
--- a/plugins/partitioning/virtual-disk.h
+++ b/plugins/partitioning/virtual-disk.h
@@ -104,7 +104,7 @@ extern struct file *files;
extern size_t nr_files;
extern struct regions regions;
-extern unsigned char *primary, *secondary;
+extern unsigned char *primary, *secondary, **ebr;
/* Main entry point called after files array has been populated. */
extern int create_virtual_disk_layout (void);
@@ -115,16 +115,16 @@ extern int create_virtual_dis...
2020 Apr 15
0
[PATCH nbdkit 2/9] floppy, iso, split, ssh: Use new vector type to store lists of strings.
...- file size */
} __attribute__((packed));
+/* Appendable list of struct dir_entry. */
+DEFINE_VECTOR_TYPE(dir_entries, struct dir_entry);
+
/* 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/plug...
2018 Oct 28
0
[PATCH nbdkit 4/4] Add floppy plugin.
...(size_t di, struct virtual_floppy *floppy);
+
+/* Create the on disk directory table for dirs[di]. */
+int
+create_directory (size_t di, const char *label,
+ struct virtual_floppy *floppy)
+{
+ size_t i;
+ const size_t nr_subdirs = floppy->dirs[di].nr_subdirs;
+ const size_t nr_files = floppy->dirs[di].nr_files;
+ struct lfn *lfns, *lfn;
+ const char *name;
+ uint8_t attributes;
+ uint32_t file_size;
+ struct stat *statbuf;
+
+ if (di == 0) {
+ /* For root directory, add the volume label entry first. */
+ if (add_volume_label (label, di, floppy) == -1)
+ ret...
2019 Jan 21
8
[PATCH nbdkit v2 0/4] Support MBR logical partitions.
This is a revised version of the two series previously posted here:
https://www.redhat.com/archives/libguestfs/2019-January/msg00137.html
https://www.redhat.com/archives/libguestfs/2019-January/msg00139.html
There have been many smaller changes but the highlights are:
- Using SECTOR_SIZE instead of hard-coding 512 everywhere.
- Additional safety checks that the EBR chain doesn't
jump
1997 Dec 03
2
Insufficient allocations in net/unix/garbage.c
[Mod: linux-kernel removed from To: list. --alex]
-----BEGIN PGP SIGNED MESSAGE-----
Kernels 2.0.x do not sufficiently allocate space for the internal stack
used for garbage collection on unix domain sockets. I have neither
examined nor tested 2.1.x kernels.
Because the garbage collection system defines a MAX_STACK depth of 1000
for it''s internal use, it is relatively trivial to
2018 Sep 17
0
[PATCH nbdkit v3 3/3] Add partitioning plugin.
...\xe4"
+
+/* Files supplied on the command line. */
+struct file {
+ const char *filename; /* file= supplied on the command line */
+ int fd;
+ struct stat statbuf;
+ char guid[16]; /* random GUID used for GPT */
+};
+
+static struct file *files = NULL;
+static size_t nr_files = 0;
+
+/* partition-type parameter. */
+#define PARTTYPE_UNSET 0
+#define PARTTYPE_MBR 1
+#define PARTTYPE_GPT 2
+static int parttype = PARTTYPE_UNSET;
+
+/* Virtual disk regions (contiguous). */
+enum region_type {
+ region_file, /* contents of the i'th file */
+ region_data,...
2019 Feb 19
2
Re: [PATCH nbdkit 4/4] Add linuxdisk plugin.
...t; + return -1;
> + }
> +
> + /* First pass: This creates subdirectories in the filesystem and
> + * also builds a list of files so we can identify hard links.
> + */
> + for (i = 0; i < nr_dirs; ++i) {
> + if (visit (dirs[i], fs, EXT2_ROOT_INO, &files, &nr_files) == -1)
> + return -1;
> + }
> +
> + if (nr_files > 0) {
> + assert (files != NULL);
> +
> + /* Sort the files by device and inode number to identify hard links. */
> + qsort (files, nr_files, sizeof (struct file), compare_inodes);
> +
> + /* Seco...
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 Sep 17
4
[PATCH nbdkit 0/3] Add partitioning plugin.
nbdkit partitioning boot.img swap.img root.img
... creates a virtual disk by adding a partition table.
In ancient times Xen used to do this.
Rich.
2018 Sep 17
7
[PATCH nbdkit v3 0/3] Add partitioning plugin.
The partitioning plugin patch is the same (except for rebasing).
However I have changed the first two patches based on feedback
received. In particular this fixes a very serious bug found by Eric
Blake in the current truncate filter.
Rich.
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 Apr 15
0
[PATCH nbdkit 4/9] common/regions: Use new vector type to store the list of regions.
...;
}
return 0;
diff --git a/plugins/partitioning/virtual-disk.h b/plugins/partitioning/virtual-disk.h
index e1739783..4428ff17 100644
--- a/plugins/partitioning/virtual-disk.h
+++ b/plugins/partitioning/virtual-disk.h
@@ -91,7 +91,7 @@ struct file {
extern struct file *files;
extern size_t nr_files;
-extern struct regions regions;
+extern regions the_regions;
extern unsigned char *primary, *secondary, **ebr;
/* Main entry point called after files array has been populated. */
diff --git a/plugins/linuxdisk/partition-gpt.c b/plugins/linuxdisk/partition-gpt.c
index 81a530d6..6380dc8f 10064...
2019 Feb 19
0
[PATCH nbdkit 4/4] Add linuxdisk plugin.
...Inode flags. */
+ const char *type; /* File type (used only for debugging). */
+};
+
+static int64_t estimate_size (void);
+static int mke2fs (const char *filename);
+static int visit (const char *dir, ext2_filsys fs, ext2_ino_t dir_ino,
+ struct file **files, size_t *nr_files);
+static int compare_inodes (const void *f1, const void *f2);
+static int e2mkdir (ext2_filsys fs, ext2_ino_t dir_ino, const char *name,
+ const struct stat *statbuf, ext2_ino_t *ino);
+static int e2emptyinode (ext2_filsys fs, ext2_ino_t dir_ino,
+ const...
2015 Oct 20
0
[PATCH 2/2] actions: turn some params into RelativePathnameList (RHBZ#1174551).
...sibility = VInternal;
shortdesc = "lstat on multiple files";
diff --git a/tests/bigdirs/test-big-dirs.pl b/tests/bigdirs/test-big-dirs.pl
index 40038b7..5bcc71c 100755
--- a/tests/bigdirs/test-big-dirs.pl
+++ b/tests/bigdirs/test-big-dirs.pl
@@ -63,7 +63,6 @@ for (my $i = 0; $i < $nr_files; ++$i) {
# Check that lstatlist, lxattrlist and readlinklist return the
# expected number of entries.
my @a;
-@filenames = map { "/dir/$_" } @filenames;
@a = $g->lstatlist ("/dir", \@filenames);
die unless @a == $nr_files;
--
2.1.0
2018 Apr 12
4
[nbdkit PATCH v3 0/2] Add nbdkit_realpath
Hi,
this is the v3 of my series for nbdkit_realpath; this series adds an
extra documentation update to nbdkit_absolute_path, documenting when it
can only be used, and then adds nbdkit_realpath.
Thanks,
Pino Toscano (2):
docs: improve documentation of nbdkit_absolute_path
plugin: add and use nbdkit_realpath
docs/nbdkit-plugin.pod | 24 +++++++++++++++++++++++-
include/nbdkit-common.h
2018 Feb 14
2
[nbdkit PATCH v2] plugin: add and use nbdkit_realpath
...eturn -1;
}
diff --git a/plugins/split/split.c b/plugins/split/split.c
index 47c366d..bdcdcf7 100644
--- a/plugins/split/split.c
+++ b/plugins/split/split.c
@@ -76,7 +76,7 @@ split_config (const char *key, const char *value)
return -1;
}
filenames = new_filenames;
- filenames[nr_files] = nbdkit_absolute_path (value);
+ filenames[nr_files] = nbdkit_realpath (value);
if (filenames[nr_files] == NULL)
return -1;
nr_files++;
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
index 1c15127..8bc1517 100644
--- a/plugins/vddk/vddk.c
+++ b/plugins/vddk/vddk.c
@@ -...
2018 Feb 13
3
[nbdkit PATCH] plugin: add and use nbdkit_realpath
...eturn -1;
}
diff --git a/plugins/split/split.c b/plugins/split/split.c
index 47c366d..bdcdcf7 100644
--- a/plugins/split/split.c
+++ b/plugins/split/split.c
@@ -76,7 +76,7 @@ split_config (const char *key, const char *value)
return -1;
}
filenames = new_filenames;
- filenames[nr_files] = nbdkit_absolute_path (value);
+ filenames[nr_files] = nbdkit_realpath (value);
if (filenames[nr_files] == NULL)
return -1;
nr_files++;
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
index 1c15127..8bc1517 100644
--- a/plugins/vddk/vddk.c
+++ b/plugins/vddk/vddk.c
@@ -...
2019 Feb 19
7
[PATCH nbdkit 0/4] New plugin: Add linuxdisk plugin.
Turns out Japanese trains are good for coding!
In supermin we have a bunch of code to create the libguestfs
appliance. It creates it directly using libext2fs (part of
e2fsprogs). We can use the same technique to create ext2 virtual
disks in nbdkit, which is what this new plugin does. Why a new plugin
instead of modifying the floppy plugin? See the 4/4 commit message
for an explanation.
The
2018 Oct 30
1
Re: [PATCH nbdkit 4/4] Add floppy plugin.
...ath;
> + size_t fi, i;
> +
> + if (asprintf (&host_path, "%s/%s", dir, name) == -1) {
> + nbdkit_error ("asprintf: %m");
> + return -1;
> + }
asprintf() may have modified errno...
> + /* Add to global list of files. */
> + fi = floppy->nr_files;
> + np = realloc (floppy->files, sizeof (struct file) * (fi+1));
Likewise a successful realloc()...
> + if (np == NULL) {
> + nbdkit_error ("realloc: %m");
> + free (host_path);
> + return -1;
> + }
> + floppy->files = np;
> + floppy->nr_f...