Displaying 7 results from an estimated 7 matches for "pylong_asunsignedlong".
2020 Aug 10
2
[PATCH nbdkit] python: Allow extents to return any iterable (which includes lists).
...st of 3-tuples");
+ nbdkit_error ("extents method did not return an iterable of 3-tuples");
+ Py_DECREF (iter);
Py_DECREF (r);
return -1;
}
@@ -1078,16 +1075,26 @@ py_extents (void *handle, uint32_t count, uint64_t offset,
extent_length = PyLong_AsUnsignedLongLong (py_length);
extent_type = PyLong_AsUnsignedLong (py_type);
if (check_python_failure ("PyLong") == -1) {
+ Py_DECREF (iter);
Py_DECREF (r);
return -1;
}
if (nbdkit_add_extent (extents,
extent_offset, ex...
2020 Aug 10
5
[PATCH nbdkit] python: Implement can_extents + extents.
...t) != 3) {
+ nbdkit_error ("extents method did not return a list of 3-tuples");
+ Py_DECREF (r);
+ return -1;
+ }
+ py_offset = PyTuple_GetItem (t, 0);
+ py_length = PyTuple_GetItem (t, 1);
+ py_type = PyTuple_GetItem (t, 2);
+ extent_offset = PyLong_AsUnsignedLongLong (py_offset);
+ extent_length = PyLong_AsUnsignedLongLong (py_length);
+ extent_type = PyLong_AsUnsignedLong (py_type);
+ if (check_python_failure ("PyLong") == -1) {
+ Py_DECREF (r);
+ return -1;
+ }
+ if (nbdkit_add_extent (extents,
+...
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...quot;extents method did not return a list of 3-tuples");
> + Py_DECREF (r);
> + return -1;
> + }
> + py_offset = PyTuple_GetItem (t, 0);
> + py_length = PyTuple_GetItem (t, 1);
> + py_type = PyTuple_GetItem (t, 2);
> + extent_offset = PyLong_AsUnsignedLongLong (py_offset);
> + extent_length = PyLong_AsUnsignedLongLong (py_length);
> + extent_type = PyLong_AsUnsignedLong (py_type);
> + if (check_python_failure ("PyLong") == -1) {
Is it really right to be doing error checking only once, but after three
calls into PyL...
2020 Aug 10
0
Re: [PATCH nbdkit] python: Implement can_extents + extents.
...quot;extents method did not return a list of 3-tuples");
> + Py_DECREF (r);
> + return -1;
> + }
> + py_offset = PyTuple_GetItem (t, 0);
> + py_length = PyTuple_GetItem (t, 1);
> + py_type = PyTuple_GetItem (t, 2);
> + extent_offset = PyLong_AsUnsignedLongLong (py_offset);
> + extent_length = PyLong_AsUnsignedLongLong (py_length);
> + extent_type = PyLong_AsUnsignedLong (py_type);
> + if (check_python_failure ("PyLong") == -1) {
> + Py_DECREF (r);
> + return -1;
> + }
> + if (nbdki...
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...nt32_t) * %s);\n" n len;
- pr " if (%s == NULL) {\n" n;
- pr " PyErr_NoMemory ();\n";
- pr " return NULL;\n";
- pr " }\n";
- pr " for (size_t _i = 0; _i < %s; ++_i)\n" len;
- pr " %s[_i] = PyLong_AsUnsignedLong (PyList_GetItem (%s, _i));\n" n n
- | ArrayAndLen _ -> assert false
| Bool _ -> ()
| BytesIn _ -> ()
| BytesOut (n, count) ->
@@ -4280,8 +4251,6 @@ let print_python_binding name { args; ret; may_set_error } =
| Flags n -> pr " %s_u32 = %s;\n" n...
2019 Aug 09
4
[PATCH libnbd 0/2] generator: Preparatory changes to the generator.
These are some simplifications to the generator. They don't probably
make much sense on their own, but they are preparatory to better
handling of enums, and or'd lists of flags.
Rich.
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples
have been updated, but it demonstrates an idea: Should we forget about
the concept of having multiple connections managed under a single
handle?
In this patch there is a single ‘struct nbd_handle *’ which manages a
single state machine and connection (and therefore no nbd_connection).
To connect to a multi-conn server you must