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: unknown flag (0x%x)", flags);
> +*error = EINVAL;
> +return 0;
> + }
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 $ret;
> read ($FH, $ret, $count, $offset) || die "read: $!"
> return $ret;
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
---
The NBD Protocol requests an EPERM failure on attempts to write to
a read-only export. We were internally using EROFS, but our mapping
was slamming that to EINVAL.
Signed-off-by: Eric Blake
---
src/connections.c | 1 +
1 file changed, 1 insertion(+)
diff --git
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,
The plugin interface was impliticly using the last errno value
as the source for any error code sent over the wire to the client.
This is okay for C, but in other language bindings, it gets
rather awkward when you can't guarantee what errno will even be
set to by the time the binding glue has
Fix some things I noticed while reviewing v1, and follow Rich's
idea to add a new nbdkit_set_error() utility function with a
binding for Python users to request a particular error (rather
than being forced to live with whatever stale value is in errno
after all the intermediate binding glue code).
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.
---
.gitignore | 20 +
Makefile.am
---
.gitignore | 40 -
Makefile.am | 2 +-
align/Makefile.am| 4 +-
builder/Makefile.am | 8 +-
cat/Makefile.am | 20 ++---
cfg.mk
Just code motion.
---
Makefile.am | 3 +++
cat/Makefile.am | 6 +++---
common/visit/Makefile.am | 33 +
{cat => common/visit}/visit.c | 0
{cat => common/visit}/visit.h | 0
configure.ac | 1 +
This is mostly code motion but:
(1) I had to remove the compile-time COMPILING_GUESTFISH and
COMPILING_VIRT_RESCUE macros and replace them with runtime constants
and checks.
(2) I moved the fish/config.c file into this library.
---
Makefile.am| 2 +-
Just code motion.
---
Makefile.am| 1 +
align/Makefile.am | 13 +--
common/parallel/Makefile.am| 51 ++
{df => common/parallel}/domains.c | 0
{df =>
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, common/windows and common/parallel.
The only remaining item is to consider whether we
13 matches
Mail list logo