Displaying 20 results from an estimated 61 matches for "api_version".
Did you mean:
_api_version
2019 Nov 22
1
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...> >
> > >>> +# There are several variants of the API. nbdkit will call this
> > >>> +# function first to determine which one you want to use. This is the
> > >>> +# latest version at the time this example was written.
> > >>> +def api_version():
> > >>> + return 2
> > >>
> > >> Matches the C counterpart of #define NBDKIT_API_VERSION 2 at the top of
> > >> a plugin.
> > >
> > > This is the same thing I was thinking about. This makes it more clear
> > > that...
2019 Nov 22
4
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On 11/22/19 3:20 PM, Nir Soffer wrote:
>>> +# There are several variants of the API. nbdkit will call this
>>> +# function first to determine which one you want to use. This is the
>>> +# latest version at the time this example was written.
>>> +def api_version():
>>> + return 2
>>
>> Matches the C counterpart of #define NBDKIT_API_VERSION 2 at the top of
>> a plugin.
>
> This is the same thing I was thinking about. This makes it more clear
> that the api
> version is constant, and not something the plugin should...
2015 May 28
4
[PATCH 1/4] generator: move api_version to a common version_added
...ml
@@ -301,8 +301,10 @@ I<The caller must free the returned buffer after use>.\n\n"
pr "This function takes a key or passphrase parameter which
could contain sensitive material. Read the section
L</KEYS AND PASSPHRASES> for more information.\n\n";
- let version = api_version f.added in
- pr "(Added in %s)\n\n" version;
+ (match version_added f with
+ | Some version -> pr "(Added in %s)\n\n" version
+ | None -> assert false
+ );
(* Handling of optional argument variants. *)
if optargs <> [] then (
@@ -322,8 +324,8 @@ L</KE...
2023 Jul 04
1
[PATCH v2 3/3] vduse: Temporarily disable control queue features
...IO_NET_F_MQ) |
+ (1ULL << VIRTIO_NET_F_CTRL_MAC_ADDR) |
+ (1ULL << VIRTIO_NET_F_RSS) |
+ (1ULL << VIRTIO_NET_F_HASH_REPORT) |
+ (1ULL << VIRTIO_NET_F_NOTF_COAL));
+ }
+}
+
static int vduse_create_dev(struct vduse_dev_config *config,
void *config_buf, u64 api_version)
{
@@ -1793,6 +1812,8 @@ static int vduse_create_dev(struct vduse_dev_config *config,
if (!dev)
goto err;
+ vduse_dev_features_fixup(config);
+
dev->api_version = api_version;
dev->device_features = config->features;
dev->device_id = config->device_id;
--
2.41.0
2023 Jul 04
1
[PATCH v2 3/3] vduse: Temporarily disable control queue features
...RT) |
> + (1ULL << VIRTIO_NET_F_NOTF_COAL));
> + }
> +}
> +
This will never be exhaustive, we are adding new features.
Please add an allowlist with just legal ones instead.
> static int vduse_create_dev(struct vduse_dev_config *config,
> void *config_buf, u64 api_version)
> {
> @@ -1793,6 +1812,8 @@ static int vduse_create_dev(struct vduse_dev_config *config,
> if (!dev)
> goto err;
>
> + vduse_dev_features_fixup(config);
> +
> dev->api_version = api_version;
> dev->device_features = config->features;
> dev->d...
2019 Nov 21
1
Re: Extending the nbdkit python plugin
On Thu, Nov 21, 2019 at 02:17:43PM +0000, Daniel P. Berrangé wrote:
> I would define a new 'api_version()' method for your python
> plugins.
>
> Existing plugins don't implement that of course so when your
> C code invokes that it'll get an exception, and can assume
> the classic API contract for pwrite().
>
> If the plugin implements 'api_version()' return...
2019 Nov 22
0
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...:20 PM, Nir Soffer wrote:
>
> >>> +# There are several variants of the API. nbdkit will call this
> >>> +# function first to determine which one you want to use. This is the
> >>> +# latest version at the time this example was written.
> >>> +def api_version():
> >>> + return 2
> >>
> >> Matches the C counterpart of #define NBDKIT_API_VERSION 2 at the top of
> >> a plugin.
> >
> > This is the same thing I was thinking about. This makes it more clear
> > that the api
> > version is consta...
2019 Nov 22
0
[PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
To avoid breaking existing plugins, Python plugins wishing to use
version 2 of the API must opt in by declaring:
def api_version():
return 2
(Plugins which do not do this are assumed to want API version 1).
---
plugins/python/example.py | 15 +++-
plugins/python/nbdkit-python-plugin.pod | 61 ++++++++++-----
plugins/python/python.c | 100 ++++++++++++++++++++----
tests/test.py...
2019 Nov 23
0
[PATCH nbdkit v3 2/7] python: Implement nbdkit API version 2.
To avoid breaking existing plugins, Python plugins wishing to use
version 2 of the API must opt in by declaring:
API_VERSION = 2
(Plugins which do not do this are assumed to want API version 1).
---
plugins/python/example.py | 14 ++-
plugins/python/nbdkit-python-plugin.pod | 56 +++++++-----
plugins/python/python.c | 114 ++++++++++++++++++++----
tests/test.py...
2019 Nov 22
1
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...t;, &fn)) {
>>> PyErr_Clear ();
>>> - r = PyObject_CallFunction (fn, "ONL", obj,
>>> - PyByteArray_FromStringAndSize (buf, count),
>>> - offset, NULL);
>>> + switch (py_api_version) {
>>> + case 1:
>>> + r = PyObject_CallFunction (fn, "ONL", obj,
>>> + PyByteArray_FromStringAndSize (buf, count),
>>> + offset, NULL);
>>
>> Here, we could assert (fla...
2019 Nov 23
8
[PATCH nbdkit v3 0/7] Implement nbdkit API v2 for Python plugins.
v2 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00163.html
I pushed patch 1 (with spelling fix), patch 4 and patch 5 since those
were previously ACKed on the list.
Differences in v3:
- Add error checking to PyModule_AddIntConstant.
- Use API_VERSION constant instead of function.
- Add max API version supported to --dump-plugin output.
- Print API_VERSION selected by the module in debug output.
- Allow .cache to be used from v1 API. Since it's a newly added
function we just use the same API as v2.
Differences in tests patch:
- conv...
2019 Nov 22
8
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
On 11/22/19 1:53 PM, Richard W.M. Jones wrote:
> To avoid breaking existing plugins, Python plugins wishing to use
> version 2 of the API must opt in by declaring:
>
> def api_version():
> return 2
>
> (Plugins which do not do this are assumed to want API version 1).
Could we also permit the python code to declare a global variable
instead of a function? But a function is just fine (and easier to
integrate the way we do all our other callbacks).
> +++ b/p...
2019 Nov 25
7
[PATCH nbdkit v2 0/7] Implement nbdkit API v2 for Python plugins.
v3 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00209.html
In v4:
- Rebase on top of current master. Includes various fixes and
updates required because of Nir's patches that went into master.
- Fix api_version() -> API_VERSION in patch 2 noted previously on the
mailing list.
Rich.
2019 Nov 21
10
[PATCH nbdkit 0/8] Implement nbdkit API v2 for Python plugins.
And fill out most of the missing bits of the API.
Rich.
2023 Jul 04
3
[PATCH v2 0/3] vduse: add support for networking devices
This small series enables virtio-net device type in VDUSE.
With it, basic operation have been tested, both with
virtio-vdpa and vhost-vdpa using DPDK Vhost library series
adding VDUSE support using split rings layout (merged in
DPDK v23.07-rc1).
Control queue support (and so multiqueue) has also been
tested, but requires a Kernel series from Jason Wang
relaxing control queue polling [1] to
2019 Nov 22
18
[PATCH nbdkit v2 00/10] Implement nbdkit API v2 for Python plugins.
v1:
https://www.redhat.com/archives/libguestfs/2019-November/msg00153.html
v2:
- Fix implementation of can_cache.
- Add implementation of can_fua.
- Add a very thorough test suite which tests every command + flag
combination.
2013 Nov 01
5
xend with XenAPI in stackless python-2.7
...:
File "<stdin>", line 1, in
<module>
File "/usr/lib/python2.7/site-packages/XenAPI.py", line 198, in
<lambda>
return lambda *params: self._login(name,
params)
File "/usr/lib/python2.7/site-packages/XenAPI.py", line 171, in
_login
self.API_version =
self._get_api_version()
File "/usr/lib/python2.7/site-packages/XenAPI.py", line 186, in
_get_api_version
pool =
self.xenapi.pool.get_all()[0]
File "/usr/lib/python2.7/site-packages/XenAPI.py", line 245, in
__call__
return self.__send(self.__name,
args)
File &q...
2019 Nov 21
5
Extending the nbdkit python plugin
We have an nbdkit plugin that lets you write NBD servers in Python.
An example of an existing Python plugin is here:
https://github.com/libguestfs/nbdkit/blob/master/plugins/python/example.py#L1
This morning I tried to modify the plugin to use the newer nbdkit API
(version 2). One of the things that would change would be passing
flags parameters to some functions, eg:
def pwrite (h, buf,
2019 Nov 22
0
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...:20 PM, Nir Soffer wrote:
>
> >>> +# There are several variants of the API. nbdkit will call this
> >>> +# function first to determine which one you want to use. This is the
> >>> +# latest version at the time this example was written.
> >>> +def api_version():
> >>> + return 2
> >>
> >> Matches the C counterpart of #define NBDKIT_API_VERSION 2 at the top of
> >> a plugin.
> >
> > This is the same thing I was thinking about. This makes it more clear
> > that the api
> > version is consta...
2013 Jan 29
0
How to stub a class inside a module with Mocha in Ruby?
...module TwitterOAuth
class Client
def initialize(options = {})
@consumer_key = options[:consumer_key]
@consumer_secret = options[:consumer_secret]
@token = options[:token]
@secret = options[:secret]
@proxy = options[:proxy]
@debug = options[:debug]
@api_version = options[:api_version] || ''1''
@api_host = options[:api_host] || ''api.twitter.com''
@search_host = options[:search_host] || ''search.twitter.com''
end
...
def request_token(options={})
consumer(:secure => true).get_...