Displaying 20 results from an estimated 21 matches for "wstopsig".
2017 Nov 20
3
[nbdkit PATCH 0/2] Add nbd forwarder test coverage
To avoid bitrot, any new feature needs testsuite coverage ;)
Still to come: once I get my work on parallel nbd finished,
I will add a test-parallel-nbd.sh that closely mirrors what
my other series added in test-parallel-file.sh.
If desired, it might be a fun exercise to tweak test-nbd into
using a for-loop of user-controlled depth for how deep you
want to nest the forwarding tree, to see where
2014 Oct 03
0
Fwd: mksh-static segfaults on continued jobs
...ult.
The simplest way to reproduce is to call "fg" for any stopped job in
interactive mksh-static or lksh (full mksh is not affected); it results
in job being continued but shell crashing immediately after that.
The crash happens in j_print() at jobs.c:1560 where the expression
sigtraps[WSTOPSIG(p->status)] is out-of-bounds. It seems to be introduced
with revision 1.101 of jobs.c that added WCONTINUED flag to wait(2)
and then updated the state after checking status with WIFCONTINUED.
Apparently, when compiling with klibc, WCONTINUED flag is defined but
WIFCONTINUED macro is not. The...
2019 Sep 30
0
[nbdkit PATCH 1/2] server: Propagate unexpected nbdkit failure with --run
...);
fprintf (stderr, "%s: external command was killed by signal %d\n",
program_name, WTERMSIG (r));
- r = 1;
- }
- else if (WIFSTOPPED (r)) {
- fprintf (stderr, "%s: external command was stopped by signal %d\n",
- program_name, WSTOPSIG (r));
- r = 1;
+ r = WTERMSIG (r) + 128;
}
- kill (pid, SIGTERM); /* Kill captive nbdkit. */
+ switch (waitpid (pid, &status, WNOHANG)) {
+ case -1:
+ nbdkit_error ("waitpid: %m");
+ r = 1;
+ break;
+ case 0:
+ /* Captive nbdkit s...
2019 Oct 01
0
[nbdkit PATCH v2 1/6] server: Propagate unexpected nbdkit failure with --run
...);
fprintf (stderr, "%s: external command was killed by signal %d\n",
program_name, WTERMSIG (r));
- r = 1;
- }
- else if (WIFSTOPPED (r)) {
- fprintf (stderr, "%s: external command was stopped by signal %d\n",
- program_name, WSTOPSIG (r));
- r = 1;
+ r = WTERMSIG (r) + 128;
}
- kill (pid, SIGTERM); /* Kill captive nbdkit. */
+ switch (waitpid (pid, &status, WNOHANG)) {
+ case -1:
+ nbdkit_error ("waitpid: %m");
+ r = EXIT_FAILURE;
+ break;
+ case 0:
+ /* Capti...
2019 Feb 22
1
Re: [PATCH nbdkit v3 4/4] Add linuxdisk plugin.
...gt; + return -1;
> + }
> + else if (WIFSIGNALED (r)) {
> + nbdkit_error ("mke2fs command was killed by signal %d", WTERMSIG (r));
> + return -1;
> + }
> + else if (WIFSTOPPED (r)) {
> + nbdkit_error ("mke2fs command was stopped by signal %d", WSTOPSIG (r));
> + return -1;
> + }
> +
WIFSTOPPED() branch is unreachable.
> +=item nbdkit --filter=cow linuxdisk /path/to/directory
> +
> +Add a writable overlay (see L<nbdkit-cow-filter(1)>, allowing the disk
> +to be written by the client. B<Multiple clients must not...
2020 Mar 17
0
Re: [PATCH nbdkit v2] New tmpdisk plugin.
...;, WEXITSTATUS (r));
> + return -1;
> + }
> + else if (WIFSIGNALED (r)) {
> + nbdkit_error ("command killed by signal %d", WTERMSIG (r));
> + return -1;
> + }
> + else if (WIFSTOPPED (r)) {
> + nbdkit_error ("command stopped by signal %d", WSTOPSIG (r));
> + return -1;
> + }
Generally, WIFSTOPPED() should be unreachable for the result of
system(). I don't mind if you leave it for ease of copy/paste, but it
doesn't hurt to drop it.
> +
> + return 0;
> +}
> +
> +static void *
> +tmpdisk_open (int readon...
2012 Jul 03
8
[PATCH 0/7 v2] Fix and workaround for qcow2 issues in qemu causing data corruption.
https://bugzilla.redhat.com/show_bug.cgi?id=836710
https://bugzilla.redhat.com/show_bug.cgi?id=836913
There are at least two related bugs going on:
(1) Linux sync(2) system call doesn't send a write barrier to the
disk, so in effect it doesn't force the hard disk to flush its cache.
libguestfs used sync(2) to force changes to disk. We didn't expect
that qemu was caching anything
2019 Feb 19
2
Re: [PATCH nbdkit 4/4] Add linuxdisk plugin.
...gt; + return -1;
> + }
> + else if (WIFSIGNALED (r)) {
> + nbdkit_error ("mke2fs command was killed by signal %d", WTERMSIG (r));
> + return -1;
> + }
> + else if (WIFSTOPPED (r)) {
> + nbdkit_error ("mke2fs command was stopped by signal %d", WSTOPSIG (r));
> + return -1;
> + }
Is WIFSTOPPED() even a possible result of system()? 'man waitpid' says
this status is only possible for a call made with WUNTRACED, which seems
contradictory to system() running the command to completion without tracing.
> +
> + return 0;
> +...
2019 Sep 30
5
[nbdkit PATCH 0/2] Fix nbdkit --run when nbdkit hits assertion
Found while working on the retry filter. Swap the order of the two
patches to see nbdkit ignore assertion failures with status 0.
Eric Blake (2):
server: Propagate unexpected nbdkit failure with --run
tests: Enhance captive test
server/captive.c | 43 ++++++++++++++++++++++++++++++----------
tests/test-captive.sh | 46 +++++++++++++++++++++++++++++++++++++++----
2 files changed, 75
2020 Mar 17
2
[PATCH nbdkit v2] New tmpdisk plugin.
...("command exited with code %d", WEXITSTATUS (r));
+ return -1;
+ }
+ else if (WIFSIGNALED (r)) {
+ nbdkit_error ("command killed by signal %d", WTERMSIG (r));
+ return -1;
+ }
+ else if (WIFSTOPPED (r)) {
+ nbdkit_error ("command stopped by signal %d", WSTOPSIG (r));
+ return -1;
+ }
+
+ return 0;
+}
+
+static void *
+tmpdisk_open (int readonly)
+{
+ struct handle *h;
+ CLEANUP_FREE char *disk = NULL;
+ const char *tmpdir;
+
+ tmpdir = getenv ("TMPDIR");
+ if (!tmpdir)
+ tmpdir = "/var/tmp";
+
+ h = malloc (sizeof *h);
+...
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
2019 Oct 01
9
[nbdkit PATCH v2 0/6] Improve retry filter
Includes a rework of the previously posted patch for --run
improvements (mostly with improved comments and commit message; I
decided that waiting for the captive nbdkit to exit was overkill), and
four new patches. The tests are intentionally separate, to allow
rearranging the order of the series to see the failures being fixed.
Eric Blake (6):
server: Propagate unexpected nbdkit failure with
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
2013 Mar 05
1
[PATCH v2] fuse: Add guestunmount program to handle unmounting (RHBZ#916780)
Since the first patch:
- The program is now called 'guestunmount'.
- I tested the --fd option and it appears to work.
- You can now control retries / quiet.
- Revised man pages.
- Includes tests.
I'm just running through the automated tests now.
Rich.
2019 Feb 22
5
[PATCH nbdkit v3 0/4] Add linuxdisk plugin.
For v3 I reimplemented this using mke2fs -d. This obviously makes the
implementation a whole lot simpler, but cannot support multiple
directory merging.
Patches 1-3 are the same as before. I've also reproduced the notes
from v2 below.
v2:
- Fix inconsistent tab/space.
- All 3 plugins now contain a block of text pointing to the
other 2 plugins.
- TMDIR -> TMPDIR
- Unlink the
2020 Aug 14
2
[PATCH nbdkit] New ondemand plugin.
...("command exited with code %d", WEXITSTATUS (r));
+ return -1;
+ }
+ else if (WIFSIGNALED (r)) {
+ nbdkit_error ("command killed by signal %d", WTERMSIG (r));
+ return -1;
+ }
+ else if (WIFSTOPPED (r)) {
+ nbdkit_error ("command stopped by signal %d", WSTOPSIG (r));
+ return -1;
+ }
+
+ return 0;
+}
+
+/* For block devices, stat->st_size is not the true size. */
+static int64_t
+block_device_size (int fd)
+{
+ off_t size;
+
+ size = lseek (fd, 0, SEEK_END);
+ if (size == -1) {
+ nbdkit_error ("lseek: %m");
+ return -1;
+ }
+
+...
2019 Feb 22
0
[PATCH nbdkit v3 4/4] Add linuxdisk plugin.
...exit code %d", WEXITSTATUS (r));
+ return -1;
+ }
+ else if (WIFSIGNALED (r)) {
+ nbdkit_error ("mke2fs command was killed by signal %d", WTERMSIG (r));
+ return -1;
+ }
+ else if (WIFSTOPPED (r)) {
+ nbdkit_error ("mke2fs command was stopped by signal %d", WSTOPSIG (r));
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/plugins/linuxdisk/linuxdisk.c b/plugins/linuxdisk/linuxdisk.c
new file mode 100644
index 0000000..8f50dd3
--- /dev/null
+++ b/plugins/linuxdisk/linuxdisk.c
@@ -0,0 +1,229 @@
+/* nbdkit
+ * Copyright (C) 2019 Red Hat Inc.
+ * All rights reser...
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
2012 Oct 18
10
[PATCH 0/10] Add a mini-library for running external commands.
Inspired by libvirt's virCommand* internal mini-library, this adds
some internal APIs for running commands.
The first patch contains the new APIs. The subsequent patches change
various parts of the library over to use it.
Rich.
2019 Feb 19
0
[PATCH nbdkit 4/4] Add linuxdisk plugin.
...exit code %d", WEXITSTATUS (r));
+ return -1;
+ }
+ else if (WIFSIGNALED (r)) {
+ nbdkit_error ("mke2fs command was killed by signal %d", WTERMSIG (r));
+ return -1;
+ }
+ else if (WIFSTOPPED (r)) {
+ nbdkit_error ("mke2fs command was stopped by signal %d", WSTOPSIG (r));
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+visit (const char *dir, ext2_filsys fs, ext2_ino_t dir_ino,
+ struct file **files, size_t *nr_files)
+{
+ char *origdir;
+ DIR *DIR;
+ struct dirent *d;
+ struct stat statbuf;
+ int err;
+ char *subname = NULL;
+
+ /* Because...