Displaying 11 results from an estimated 11 matches for "tmpdisk_config_complete".
2020 Apr 07
0
[PATCH nbdkit v2] tmpdisk: Pass any parameters as shell variables to the command.
...(sizeof *vars);
+ if (vars == NULL) {
+ perror ("malloc");
+ exit (EXIT_FAILURE);
+ }
+ vars->next = v_next;
+ vars->key = key;
+ vars->value = value;
}
return 0;
@@ -101,7 +126,7 @@ tmpdisk_config (const char *key, const char *value)
static int
tmpdisk_config_complete (void)
{
- if (size == -1) {
+ if (requested_size == -1) {
nbdkit_error ("size parameter is required");
return -1;
}
@@ -117,6 +142,7 @@ tmpdisk_config_complete (void)
struct handle {
int fd;
+ int64_t size;
bool can_punch_hole;
};
@@ -152,7 +178,9 @@ tmpdisk_...
2020 Apr 08
0
[PATCH nbdkit v3] tmpdisk: Pass any parameters as shell variables to the command.
...) {
+ assert (last_var == NULL);
+ vars = last_var = new_var;
+ }
+ else {
+ assert (last_var != NULL);
+ last_var->next = new_var;
+ last_var = new_var;
+ }
}
return 0;
@@ -101,7 +139,7 @@ tmpdisk_config (const char *key, const char *value)
static int
tmpdisk_config_complete (void)
{
- if (size == -1) {
+ if (requested_size == -1) {
nbdkit_error ("size parameter is required");
return -1;
}
@@ -117,6 +155,7 @@ tmpdisk_config_complete (void)
struct handle {
int fd;
+ int64_t size;
bool can_punch_hole;
};
@@ -152,7 +191,9 @@ tmpdisk_...
2020 Apr 08
2
[PATCH nbdkit v3] tmpdisk: Generalize the tmpdisk plugin.
v2 was here:
https://www.redhat.com/archives/libguestfs/2020-April/msg00075.html
In v3:
- Add [VAR=VALUE ...] to manual.
- Various minor improvements to the manual.
- Work (at least, in theory - not tested) with block devices or
symlinks. I didn't document this because it's hard to ensure these
files or block devices would be cleaned up, so here be dragons.
- Remove O_NOCTTY.
-
2020 Apr 07
2
[PATCH nbdkit v2] tmpdisk: Generalize the tmpdisk plugin
An evolution of v1 here:
https://www.redhat.com/archives/libguestfs/2020-April/msg00035.html
I want to generalize the tmpdisk plugin, particularly so you can use
commands like ‘qemu-img create’ or even ‘virt-builder’.
(Actually virt-builder really works - I tested it - but of course it
causes a 30+ second delay when connecting to the server.)
You can now use commands such as:
nbdkit tmpdisk
2020 Mar 16
1
[PATCH nbdkit] New tmpdisk plugin.
Unfinished (needs tests). This is my attempt to make a
"remote tmpfs" plugin as outlined in this prior email:
https://www.redhat.com/archives/libguestfs/2020-March/msg00134.html
Although it would be possible to construct something a bit like this
using existing plugins and filters (perhaps with some new features in
those filters) I think it may be nicer to have a dedicated plugin for
2020 Apr 09
0
[PATCH nbdkit v2 3/3] tmpdisk: Implement this plugin using fileops.
...h>
-#include <sys/stat.h>
#include <sys/wait.h>
#define NBDKIT_API_VERSION 2
#include <nbdkit-plugin.h>
#include "cleanup.h"
+#include "fileops.h"
#include "utils.h"
static const char *tmpdir = "/var/tmp";
@@ -153,12 +153,6 @@ tmpdisk_config_complete (void)
"type=ext4|... The filesystem type.\n" \
"command=<COMMAND> Alternate command instead of mkfs."
-struct handle {
- int fd;
- int64_t size;
- bool can_punch_hole;
-};
-
/* Multi-conn is absolutely unsafe! In this callback it is si...
2020 Apr 04
0
[PATCH nbdkit 2/2] tmpdisk: Pass any parameters as shell variables to the command.
...quot;%s", command);
if (fclose (fp) == EOF) {
@@ -414,6 +444,7 @@ static struct nbdkit_plugin plugin = {
.version = PACKAGE_VERSION,
.load = tmpdisk_load,
+ .unload = tmpdisk_unload,
.config = tmpdisk_config,
.config_complete = tmpdisk_config_complete,
.config_help = tmpdisk_config_help,
diff --git a/plugins/tmpdisk/default-command.sh.in b/plugins/tmpdisk/default-command.sh.in
index 251e0b7b..87c86f1e 100644
--- a/plugins/tmpdisk/default-command.sh.in
+++ b/plugins/tmpdisk/default-command.sh.in
@@ -30,6 +30,9 @@
# OF THE USE OF THIS SO...
2020 Mar 17
2
[PATCH nbdkit v3] New tmpdisk plugin.
v2 was here:
https://www.redhat.com/archives/libguestfs/2020-March/msg00154.html
v3:
- Micro-optimize tmpdir.
- Quote $disk in default command shell fragment.
- Don't redirect mkfs output to /dev/null. Instead use
exec </dev/null >/dev/null before the shell fragment.
We may want to do this in other places where we run
external shell scripts, or more generally for all
2020 Mar 17
2
[PATCH nbdkit v2] New tmpdisk plugin.
...== 0) {
+ size = nbdkit_parse_size (value);
+ if (size == -1)
+ return -1;
+ }
+ else if (strcmp (key, "type") == 0) {
+ type = value;
+ }
+ else {
+ nbdkit_error ("unknown parameter '%s'", key);
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+tmpdisk_config_complete (void)
+{
+ if (size == -1) {
+ nbdkit_error ("size parameter is required");
+ return -1;
+ }
+
+ return 0;
+}
+
+#define tmpdisk_config_help \
+ "size=<SIZE> (required) Virtual filesystem size.\n" \
+ "label=<LABEL> The filesystem...
2020 Apr 04
4
[PATCH nbdkit 0/2] Generalize the tmpdisk plugin.
Patch 1/2 is uncontroversial.
Patch 2/2 is an interesting idea I had to generalize this plugin. It
already uses a complete embedded shell script to do most of the work.
What if, instead of making special cases for "type" and "label"
params, we simply turn any other plugin parameters into script
variables? This part of it works fine. However there is another
problem which is
2020 Apr 09
6
[PATCH nbdkit v2 0/3] Implement fileops.
Needs some work still, see in particular the commit message
for patch 3.
Rich.