It is very unlikely that the value of errno after completing the
glue code in between the completion of the user's callback and
the point in time where we construct the client's reply is going
to be untouched, which means that we are likely to send the wrong
error code across the wire. Add a new
This cleans up the existing code base with regards to implicit
use of errno from language bindings, then rebases the previous
work in python on top of that.
I'm still playing with the perl bindings, but got further after
reading 'perldoc perlembed'.
Eric Blake (4):
plugins: Don't use bogus
The last patch fixed the plugin interface to not use a bogus value
of errno from other language bindings, but hard-coding things to
EIO is not nice either.
The solution is to expose an explicit utility function for setting
the preferred error value, while still falling back to errno for
backwards
In addition to calling python functions from C, we want to make
script writing easier by exposing C functions to python. For
now, just wrap nbdkit_set_error(), as that will be needed for
an optimal implementation of a zero() callback.
Signed-off-by: Eric Blake
---
v2: tweak
Add a python language binding for the .zero callback, used for
implementing NBD_CMD_WRITE_ZEROES. The caller doesn't have to
return anything, but should use nbdkit.set_error(errno.EOPNOTSUPP)
to get an automatic fallback to pwrite.
Enhance the example to show the use of the fallback mechanism,
Generate the random filename using our utility function
guestfs_int_random_string. This also means that we will not need to
call srandom() in guestfish or virt-edit.
---
common/edit/file-edit.c | 18 ++
edit/edit.c | 3 ---
fish/fish.c | 3 ---
3 files
If two instances of the test start at exactly the same time, they
would have the same random number seed.
---
tests/mount-local/test-parallel-mount-local.c | 2 +-
tests/parallel/test-parallel.c| 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git
A better way to solve this I think.
Rich.
___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs
On Thu, Jan 26, 2017 at 03:51:20PM +, Richard W.M. Jones wrote:
> It avoids two programs which start at exactly the same time from
> having the same random number seed, which helps in some tests.
Ignore this patch, better one to come.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
On Thu, Jan 26, 2017 at 04:57:32PM +0100, Pino Toscano wrote:
> On Wednesday, 25 January 2017 14:37:10 CET Richard W.M. Jones wrote:
> > This commit, which is just code motion, moves the common XDR protocol
> > code (libprotocol) and the common errno handling (liberrnostring) into
> > libraries
On Wednesday, 25 January 2017 14:37:11 CET Richard W.M. Jones wrote:
> Just code motion.
>
> This commit makes it clearer what is a utility and what is part of the
> library. It also makes it clear that we should rename:
>
> guestfs-internal-frontend.h -> utils.h
>
On Wednesday, 25 January 2017 14:37:09 CET Richard W.M. Jones wrote:
> Previous patch series was posted here:
> https://www.redhat.com/archives/libguestfs/2017-January/msg00059.html
>
> v2 simply extends this patch series to cover the extra directories
> common/edit, common/progress,
On Thu, Jan 26, 2017 at 08:21:17AM -0600, Eric Blake wrote:
> On 01/26/2017 04:13 AM, Richard W.M. Jones wrote:
> > On Wed, Jan 25, 2017 at 08:42:34PM -0600, Eric Blake wrote:
> >> +eg. NULL or -1. If the call to C is omitted, then
> >> +the value of C will be used instead.
> > [...]
> >> +/*
On Wednesday, 25 January 2017 14:37:10 CET Richard W.M. Jones wrote:
> This commit, which is just code motion, moves the common XDR protocol
> code (libprotocol) and the common errno handling (liberrnostring) into
> libraries which are each built once and shared between the library and
> daemon.
>
When testing virt-p2v (eg. on the host machine) this prevents us from
testing two instances of virt-p2v at the same time because both will
try to use the same port.
---
p2v/main.c | 16
p2v/p2v.h | 5 +
p2v/ssh.c | 3 ---
3 files changed, 21 insertions(+), 3 deletions(-)
qemu-nbd is a fine NBD server. However it's not easy to compile a
reliably working version on RHEL 5.
This patch series allows nbdkit to be used as an alternative (qemu-nbd
is still the default).
Rich.
___
Libguestfs mailing list
Add code in virt-p2v so that it can use nbdkit (with the file plugin)
as an alternative to qemu-nbd.
This is controlled through the virt-p2v --nbd command line option,
allowing you to select which server (out of qemu-nbd or nbdkit) you
prefer (with a fallback). The default is:
---
p2v/Makefile.am | 1 +
p2v/test-virt-p2v-nbdkit.sh | 80 +
2 files changed, 81 insertions(+)
create mode 100755 p2v/test-virt-p2v-nbdkit.sh
diff --git a/p2v/Makefile.am b/p2v/Makefile.am
index 320d65a..0a2c2a8 100644
---
It avoids two programs which start at exactly the same time from
having the same random number seed, which helps in some tests.
---
edit/edit.c | 3 ++-
fish/fish.c | 2 +-
tests/mount-local/test-parallel-mount-local.c | 2 +-
3
On 01/26/2017 09:16 AM, Richard W.M. Jones wrote:
> It sounds like errno_is_reliable is an unknowable value. How would we
> set it correctly for Perl (for example), in a way that would work for
> all past and future Perl interpreters?
errno is NEVER reliable after a non-C plugin, so we have a
On Thu, Jan 26, 2017 at 08:08:46AM -0600, Eric Blake wrote:
> On 01/26/2017 04:18 AM, Richard W.M. Jones wrote:
> > On Wed, Jan 25, 2017 at 08:55:18PM -0600, Eric Blake wrote:
> >> On 01/20/2017 02:16 PM, Eric Blake wrote:
> >>> Reject rather than silently ignoring unknown client request flags.
>
On 01/26/2017 04:13 AM, Richard W.M. Jones wrote:
> On Wed, Jan 25, 2017 at 08:42:34PM -0600, Eric Blake wrote:
>> +eg. NULL or -1. If the call to C is omitted, then
>> +the value of C will be used instead.
> [...]
>> +/* Grab the appropriate error value.
>> + */
>> +static int
>> +_get_error
On 01/26/2017 04:18 AM, Richard W.M. Jones wrote:
> On Wed, Jan 25, 2017 at 08:55:18PM -0600, Eric Blake wrote:
>> On 01/20/2017 02:16 PM, Eric Blake wrote:
>>> Reject rather than silently ignoring unknown client request flags.
>>>
>>
>>>
>>> + /* Validate flags */
>>> + if (flags &
On Wed, Jan 25, 2017 at 08:55:18PM -0600, Eric Blake wrote:
> On 01/20/2017 02:16 PM, Eric Blake wrote:
> > Reject rather than silently ignoring unknown client request flags.
> >
>
> >
> > + /* Validate flags */
> > + if (flags & ~NBD_CMD_FLAG_FUA) {
> > +nbdkit_error ("invalid request:
On Wed, Jan 25, 2017 at 08:42:35PM -0600, Eric Blake wrote:
> In addition to calling python functions from C, we want to make
> script writing easier by exposing C functions to python. For
> now, just wrap nbdkit_set_error(), as that will be needed for
> an optimal implementation of a zero()
On Wed, Jan 25, 2017 at 08:42:36PM -0600, Eric Blake wrote:
> Add a python language binding for the .zero callback, used for
> implementing NBD_CMD_WRITE_ZEROES. The caller doesn't have to
> return anything, but should use nbdkit.set_error(errno.EOPNOTSUPP)
> to get an automatic fallback to
On Wed, Jan 25, 2017 at 08:48:10PM -0600, Eric Blake wrote:
> On 01/24/2017 09:16 AM, Richard W.M. Jones wrote:
>
> > In Perl, old code to raise an error would look like:
> >
> > sub pread
> > {
> > my $h = shift;
> > my $count = shift;
> > my $offset = shift;
> > my
27 matches
Mail list logo