search for: s_ret

Displaying 20 results from an estimated 33 matches for "s_ret".

Did you mean: __ret
2017 Apr 25
0
[PATCH] daemon: Use CLEANUP_* functions to avoid an explicit free in stub functions.
...r " size_t size = 1;\n"; - pr " char *r;\n" + pr " CLEANUP_FREE char *r = NULL;\n" ); if args_passed_to_daemon <> [] then ( @@ -384,19 +384,16 @@ let generate_daemon_stubs actions () = pr " struct guestfs_%s_ret ret;\n" name; pr " ret.%s = r;\n" n; pr " reply ((xdrproc_t) &xdr_guestfs_%s_ret, (char *) &ret);\n" - name; - pr " free (r);\n" + name | RStringList n | RHashtable n ->...
2019 Aug 13
0
[PATCH libnbd 2/6] generator: Create only one Python wrapper per closure.
...r " PyErr_PrintEx (0); /* print exception */\n"; + pr " };\n"; + pr "\n"; + List.iter ( + function + | CBArrayAndLen (UInt32 n, _) -> + pr " Py_DECREF (py_%s);\n" n + | CBMutable (Int n) -> + pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; + pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; + pr " Py_DECREF (py_%s_ret);\n" n; + pr " Py_DECREF (py_%s);\n" n + | CBBytesIn _ + | CBInt _ | CBInt64 _ + | CBStri...
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...) args; pr ");\n"; @@ -3327,14 +3343,21 @@ let print_python_binding name { args; ret } = function | ArrayAndLen (UInt32 n, _) -> pr " Py_DECREF (py_%s);\n" n + | Mutable (Int n) -> + pr " PyObject *py_%s_ret = PyObject_CallMethod (py_%s, \"value\", \"\");\n" n n; + pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; + pr " Py_DECREF (py_%s_ret);\n" n; + pr " Py_DECREF (py_%s);\n" n | BytesIn _ | Str...
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...tor/daemon.ml index 0300dc54b..2ae462864 100644 --- a/generator/daemon.ml +++ b/generator/daemon.ml @@ -397,7 +397,7 @@ let generate_daemon_stubs actions () = | RStringList (RPlainString, n) | RHashtable (RPlainString, RPlainString, n) -> pr " struct guestfs_%s_ret ret;\n" name; - pr " ret.%s.%s_len = count_strings (r);\n" n n; + pr " ret.%s.%s_len = guestfs_int_count_strings (r);\n" n n; pr " ret.%s.%s_val = r;\n" n n; pr " reply ((xdrproc_t) &xdr_guestfs_%s_ret,...
2017 May 04
4
[PATCH 0/3] generator: Allow returned strings to be annotated as devices.
If we want to permit more than 255 drives to be added, then we will have to add the disks to the same virtio-scsi target using different unit (LUN) numbers. Unfortunately SCSI LUN enumeration in the Linux is not deterministic (eg. two disks with target=0, lun=[0,1] can be enumerated as /dev/sda or /dev/sdb randomly). Dealing with that will require some very complex device name translation on the
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...uot; PyErr_PrintEx (0); /* print exception */\n"; + pr " };\n"; + pr "\n"; + List.iter ( + function + | ArrayAndLen (UInt32 n, _) -> + pr " Py_DECREF (py_%s);\n" n + | Mutable (Int n) -> + pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; + pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; + pr " Py_DECREF (py_%s_ret);\n" n; + pr " Py_DECREF (py_%s);\n" n + | BytesIn _ + | Int _ | Int64 _ + | String...
2019 Aug 12
0
[PATCH libnbd 7/7] api: Remove the valid_flag from all callbacks.
...t;; pr "\n"; List.iter ( function | CBArrayAndLen (UInt32 n, _) -> - pr " Py_DECREF (py_%s);\n" n + pr " Py_DECREF (py_%s);\n" n | CBMutable (Int n) -> - pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; - pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; - pr " Py_DECREF (py_%s_ret);\n" n; - pr " Py_DECREF (py_%s);\n" n + pr " PyObject *py_%s_ret...
2009 Sep 24
1
[PATCH libguestfs] maint: use spaces, not TABs for indentation
...quot; n ) (snd style); pr " putchar ('\\n');\n"; pr " }\n"; @@ -4759,16 +4759,16 @@ check_state (guestfs_h *g, const char *caller) pr " guestfs_message_header hdr;\n"; pr " guestfs_message_error err;\n"; let has_ret = - match fst style with - | RErr -> false - | RConstString _ | RConstOptString _ -> + match fst style with + | RErr -> false + | RConstString _ | RConstOptString _ -> failwithf "RConstString|RConstOptString cannot be used by daemon functions"...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of breaking OCaml bindings), but I'm open to ideas on how to improve it. Eric Blake (2): generator: Tweak print_c_arg_list to take alternate first arg RFC: generator: Handle shared callbacks in Python generator/generator | 556 ++++++++++++++++++++++---------------------- 1 file changed, 280 insertions(+), 276 deletions(-) --
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...> pr " bool %s;\n" n + | Int n -> pr " int %s;\n" n + | FileIn _ | FileOut _ -> () + ) args; + pr "};\n\n" ); (match fst style with | RErr -> () | RInt n -> - pr "struct %s_ret {\n" name; - pr " int %s;\n" n; - pr "};\n\n" + pr "struct %s_ret {\n" name; + pr " int %s;\n" n; + pr "};\n\n" | RInt64 n -> - pr "struct %s_ret {\n" name; - pr " hyper %s;...
2019 Aug 13
0
[PATCH libnbd 2/4] api: Add free function and remove valid_flag parameter.
...ption */\n"; + pr " };\n"; pr "\n"; List.iter ( function | CBArrayAndLen (UInt32 n, _) -> - pr " Py_DECREF (py_%s);\n" n + pr " Py_DECREF (py_%s);\n" n | CBMutable (Int n) -> - pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; - pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; - pr " Py_DECREF (py_%s_ret);\n" n; - pr " Py_DECREF (py_%s);\n" n + pr " PyObject *py_%s_ret = PyObject_GetAttrSt...
2019 Jul 24
0
[PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
...\n"; pr "\n"; List.iter ( function | ArrayAndLen (UInt32 n, _) -> - pr " Py_DECREF (py_%s);\n" n + pr " Py_DECREF (py_%s);\n" n | Mutable (Int n) -> - pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; - pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; - pr " Py_DECREF (py_%s_ret);\n" n; - pr " Py_DECREF (py_%s);\n" n + pr " PyObject *py_%s_ret = Py...
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
...; - pr " };\n"; - pr "\n"; - List.iter ( - function - | ArrayAndLen (UInt32 n, _) -> - pr " Py_DECREF (py_%s);\n" n - | Mutable (Int n) -> - pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; - pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; - pr " Py_DECREF (py_%s_ret);\n" n; - pr " Py_DECREF (py_%s);\n" n - | BytesIn _ -...
2019 Jul 24
8
[PATCH libnbd v2 0/5] lib: Implement closure lifetimes.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00231 The changes address everything that Eric picked up in his review of the first two patches. I have also added two more patches (4 and 5) which respectively fix docs and change int status -> unsigned status, as discussed. Passes make, check, check-valgrind. Rich.
2019 Aug 10
7
[PATCH libnbd 0/5] WIP: python: Add test for doing asynch copy.
This doesn't yet work. However it does make me more convinced than ever that we really need to sort out persistent buffer lifetimes in the library (similar to what we did for closures). Rich.
2019 Aug 13
12
[PATCH 0/6] Implement OClosure.
Patches 1-4 are basically uncontroversial, straightforward refactoring and IMHO we should just push them. Possibly 1-3 should be squashed together, but I posted them separately so they are easier to review. Patches 5 and 6 together implement OClosure. Patch 5 adds the feature and is simple to understand. Patch 6 changes the Closure completion callbacks into OClosure, but because it doesn't
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...ser_data);\n"; + pr "}\n"; + pr "\n"; + ); + List.iter ( - function - | ArrayAndLen (UInt32 n, _) -> - pr " Py_DECREF (py_%s);\n" n - | Mutable (Int n) -> - pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; - pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; - pr " Py_DECREF (py_%s_ret);\n" n; - pr " Py_DECREF (py_%s);\n" n - | BytesIn _ - | Int _ | Int64 _...
2019 Jun 29
0
[libnbd PATCH 3/6] generator: Allow Int64 in callbacks
...- | Flags _ | Int64 _ | Mutable _ + | Flags _ | Mutable _ | Path _ | SockAddrAndLen _ | StringList _ | UInt _ | UInt32 _ -> assert false ) args; @@ -3599,7 +3601,7 @@ let print_python_binding name { args; ret } = pr " Py_DECREF (py_%s_ret);\n" n; pr " Py_DECREF (py_%s);\n" n | BytesIn _ - | Int _ + | Int _ | Int64 _ | Opaque _ | String _ | UInt64 _ -> () @@ -3607,7 +3609,7 @@ let print_python_binding name { args; ret } = | ArrayAndLen _...
2019 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD. Rich.
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...uot;; List.iter ( function - | ArrayAndLen (UInt32 n, _) -> + | CBArrayAndLen (UInt32 n, _) -> pr " Py_DECREF (py_%s);\n" n - | Mutable (Int n) -> + | CBMutable (Int n) -> pr " PyObject *py_%s_ret = PyObject_GetAttrString (py_%s, \"value\");\n" n n; pr " *%s = PyLong_AsLong (py_%s_ret);\n" n n; pr " Py_DECREF (py_%s_ret);\n" n; pr " Py_DECREF (py_%s);\n" n - | BytesIn _ - | Int _ | In...