search for: tmpdisk_get_size

Displaying 10 results from an estimated 10 matches for "tmpdisk_get_size".

2020 Apr 09
0
[PATCH nbdkit v2 3/3] tmpdisk: Implement this plugin using fileops.
..._PUNCH_HOLE - return 1; -#else - return 0; -#endif -} - -/* Pretend we have native FUA support, but actually because all disks - * are temporary we will deliberately ignore flush/FUA operations. - */ -static int -tmpdisk_can_fua (void *handle) -{ - return NBDKIT_FUA_NATIVE; -} - -static int64_t -tmpdisk_get_size (void *handle) -{ - struct handle *h = handle; - - return h->size; -} - /* This creates and runs the full "mkfs" (or whatever) command. */ static int run_command (const char *disk) @@ -263,37 +230,18 @@ run_command (const char *disk) return 0; } -/* For block devices, stat-&...
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 Mar 17
2
[PATCH nbdkit v2] New tmpdisk plugin.
..._PUNCH_HOLE + return 1; +#else + return 0; +#endif +} + +/* Pretend we have native FUA support, but actually because all disks + * are temporary we will deliberately ignore flush/FUA operations. + */ +static int +tmpdisk_can_fua (void *handle) +{ + return NBDKIT_FUA_NATIVE; +} + +static int64_t +tmpdisk_get_size (void *handle) +{ + return size; +} + +/* This creates and runs the full "mkfs" (or whatever) command. */ +static int +run_command (const char *disk) +{ + FILE *fp; + CLEANUP_FREE char *cmd = NULL; + size_t len = 0; + int r; + + fp = open_memstream (&cmd, &len); + if (fp ==...
2020 Mar 17
0
Re: [PATCH nbdkit v2] New tmpdisk plugin.
...* Pretend we have native FUA support, but actually because all disks > + * are temporary we will deliberately ignore flush/FUA operations. > + */ > +static int > +tmpdisk_can_fua (void *handle) > +{ > + return NBDKIT_FUA_NATIVE; > +} Agreed. > + > +static int64_t > +tmpdisk_get_size (void *handle) > +{ > + return size; > +} > + > +/* This creates and runs the full "mkfs" (or whatever) command. */ > +static int > +run_command (const char *disk) > +{ > + FILE *fp; > + CLEANUP_FREE char *cmd = NULL; > + size_t len = 0; > + int r;...
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 Apr 07
0
[PATCH nbdkit v2] tmpdisk: Pass any parameters as shell variables to the command.
...equested_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_can_fua (void *handle) static int64_t tmpdisk_get_size (void *handle) { - return size; + struct handle *h = handle; + + return h->size; } /* This creates and runs the full "mkfs" (or whatever) command. */ @@ -163,6 +191,7 @@ run_command (const char *disk) CLEANUP_FREE char *cmd = NULL; size_t len = 0; int r; + struct var...
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.
2020 Apr 08
0
[PATCH nbdkit v3] tmpdisk: Pass any parameters as shell variables to the command.
...equested_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_can_fua (void *handle) static int64_t tmpdisk_get_size (void *handle) { - return size; + struct handle *h = handle; + + return h->size; } /* This creates and runs the full "mkfs" (or whatever) command. */ @@ -163,6 +204,7 @@ run_command (const char *disk) CLEANUP_FREE char *cmd = NULL; size_t len = 0; int r; + struct var...
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