search for: offsetv

Displaying 20 results from an estimated 28 matches for "offsetv".

Did you mean: offset
2019 Apr 23
0
[PATCH nbdkit v2 1/2] ocaml: Change pread method to avoid leaking heap memory.
...plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c index d854f48..39704e2 100644 --- a/plugins/ocaml/ocaml.c +++ b/plugins/ocaml/ocaml.c @@ -439,15 +439,16 @@ pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset, uint32_t flags) { CAMLparam0 (); - CAMLlocal4 (rv, strv, offsetv, flagsv); + CAMLlocal4 (rv, countv, offsetv, flagsv); + mlsize_t len; caml_leave_blocking_section (); - strv = caml_alloc_string (count); + countv = caml_copy_int32 (count); offsetv = caml_copy_int64 (offset); flagsv = Val_flags (flags); - value args[] = { *(value *) h, strv, of...
2017 Jan 27
2
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...a short piece of asm which preserves errno. However you'll need to save errno around caml_enter_blocking_section since that unblocks and processes signals. IOW: static int pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset) { CAMLparam0 (); CAMLlocal3 (rv, strv, offsetv); + int saved_errno; ... rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv); + saved_errno = errno; if (Is_exception_result (rv)) { nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); caml_enter_blocking_section (); + errno = saved...
2019 May 16
0
[nbdkit PATCH v2 08/24] ocaml: Implement .cache script callback
...exception (rv))); + caml_enter_blocking_section (); + CAMLreturnT (int, -1); + } + + caml_enter_blocking_section (); + CAMLreturnT (int, Int_val (rv)); +} + +static int +cache_wrapper (void *h, uint32_t count, uint64_t offset, uint32_t flags) +{ + CAMLparam0 (); + CAMLlocal4 (rv, countv, offsetv, flagsv); + + caml_leave_blocking_section (); + + countv = caml_copy_int32 (count); + offsetv = caml_copy_int32 (offset); + flagsv = Val_flags (flags); + + value args[] = { *(value *) h, countv, offsetv, flagsv }; + rv = caml_callbackN_exn (cache_fn, sizeof args / sizeof args[0], args); + if...
2019 Mar 29
0
[PATCH v2 1/3] common/mlpcre: add offset flag for PCRE.matches
...s_int_pcre_compile (value anchoredv, value caselessv, value dotallv, value extendedv, value multilinev, @@ -165,9 +174,9 @@ guestfs_int_pcre_compile_byte (value *argv, int argn) } value -guestfs_int_pcre_matches (value rev, value strv) +guestfs_int_pcre_matches (value offsetv, value rev, value strv) { - CAMLparam2 (rev, strv); + CAMLparam3 (offsetv, rev, strv); pcre *re = Regexp_val (rev); struct last_match *m, *oldm; size_t len = caml_string_length (strv); @@ -205,7 +214,8 @@ guestfs_int_pcre_matches (value rev, value strv) caml_raise_out_of_memory ();...
2019 Feb 25
0
[PATCH 1/3] common/mlpcre: add offset flag for PCRE.matches
...s_int_pcre_compile (value anchoredv, value caselessv, value dotallv, value extendedv, value multilinev, @@ -165,9 +174,9 @@ guestfs_int_pcre_compile_byte (value *argv, int argn) } value -guestfs_int_pcre_matches (value rev, value strv) +guestfs_int_pcre_matches (value offsetv, value rev, value strv) { - CAMLparam2 (rev, strv); + CAMLparam3 (offsetv, rev, strv); pcre *re = Regexp_val (rev); struct last_match *m, *oldm; size_t len = caml_string_length (strv); @@ -205,7 +214,8 @@ guestfs_int_pcre_matches (value rev, value strv) caml_raise_out_of_memory ();...
2005 Jul 26
2
[LLVMdev] llvm::ConvertibleToGEP
But it's completely empty, no? const Type *llvm::ConvertibleToGEP(const Type *Ty, Value *OffsetVal, std::vector<Value*> &Indices, const TargetData &TD, BasicBlock::iterator *BI) { return 0; } in lib/Transforms/TransformInternals.cpp, how can this be? Naftali On Tue, 2...
2019 Apr 23
4
[PATCH nbdkit v2 0/2] Be careful not to leak server heap memory to the client.
Version 1 was here: https://www.redhat.com/archives/libguestfs/2019-April/msg00144.html Version 2 makes a couple of much larger changes: The OCaml patch changes the API of the pread method so it matches what other language bindings are already doing, ie. get the language plugin to return a newly allocated buffer, check it is long enough, copy out the data. The server patch implements a
2017 Jan 27
0
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...However you'll need to save errno around caml_enter_blocking_section > since that unblocks and processes signals. > > IOW: > > static int > pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset) > { > CAMLparam0 (); > CAMLlocal3 (rv, strv, offsetv); > + int saved_errno; > ... > rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv); > + saved_errno = errno; > if (Is_exception_result (rv)) { > nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); > caml_enter_block...
2005 Jul 26
0
[LLVMdev] llvm::ConvertibleToGEP
On Tue, 26 Jul 2005, Naftali Schwartz wrote: > But it's completely empty, no? > > const Type *llvm::ConvertibleToGEP(const Type *Ty, Value *OffsetVal, > std::vector<Value*> &Indices, > const TargetData &TD, > BasicBlock::iterator *BI) { > return 0; > } > > in lib/Transforms/TransformInternals.cpp, how can th...
2005 Jul 26
2
[LLVMdev] llvm::ConvertibleToGEP
...unctionality is already present elsewhere or is simply not needed anymore? Naftali On Tue, 26 Jul 2005, Chris Lattner wrote: > On Tue, 26 Jul 2005, Naftali Schwartz wrote: >> But it's completely empty, no? >> >> const Type *llvm::ConvertibleToGEP(const Type *Ty, Value *OffsetVal, >> std::vector<Value*> &Indices, >> const TargetData &TD, >> BasicBlock::iterator *BI) { >> return 0; >> } >> >> in lib/Transforms/Trans...
2005 Jul 26
0
[LLVMdev] llvm::ConvertibleToGEP
...he optimizer has already cleaned them up for you. -Chris > On Tue, 26 Jul 2005, Chris Lattner wrote: > >> On Tue, 26 Jul 2005, Naftali Schwartz wrote: >>> But it's completely empty, no? >>> >>> const Type *llvm::ConvertibleToGEP(const Type *Ty, Value *OffsetVal, >>> std::vector<Value*> &Indices, >>> const TargetData &TD, >>> BasicBlock::iterator *BI) { >>> return 0; >>> } >>> >>...
2005 Jul 26
1
[LLVMdev] llvm::ConvertibleToGEP
...for you. > > -Chris > > >> On Tue, 26 Jul 2005, Chris Lattner wrote: >> >>> On Tue, 26 Jul 2005, Naftali Schwartz wrote: >>>> But it's completely empty, no? >>>> >>>> const Type *llvm::ConvertibleToGEP(const Type *Ty, Value *OffsetVal, >>>> std::vector<Value*> &Indices, >>>> const TargetData &TD, >>>> BasicBlock::iterator *BI) { >>>> return 0; >>>> } &g...
2019 Mar 29
5
[PATCH v2 0/3] v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json. It produces local files, just like -o local, although the metadata produced is a JSON file with data that v2v collected in the conversion process. This can be useful for converting to unsupported destinations, still based on QEMU/KVM. In addition to a simple different metadata, it offers a way to relocate the disks, with
2019 Apr 23
4
[PATCH nbdkit 0/2] Be careful not to leak heap memory to the client.
This bug was found by Eric Blake. In the .pread method we allocate a buffer in the server and pass it to the plugin. The plugin is supposed to fill it with data. The buffer was uninitialized so initially contained random heap data, but that's OK provided the plugin fully overwrote it with data. All correctly written plugins ought to do this, however there is the possibility of an
2019 Apr 23
0
[PATCH nbdkit 1/2] ocaml: Initialize pread buffer with zeroes to avoid leaking heap memory.
...6 +444,10 @@ pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset, caml_leave_blocking_section (); strv = caml_alloc_string (count); + /* Initialize the buffer with zeroes in case the plugin does not + * fill it completely. + */ + memset (String_val (strv), 0, count); offsetv = caml_copy_int64 (offset); flagsv = Val_flags (flags); -- 2.20.1
2005 Jul 26
2
[LLVMdev] llvm::ConvertibleToGEP
It seems like general dependence analysis in LLVM should require that this function be, well, functional. Is it simply a placeholder waiting for someone to come and fill in the details? It also appears that some other things besides dependence analysis depend on it as well...anyone working on this? Naftali
2005 Jul 26
0
[LLVMdev] llvm::ConvertibleToGEP
On Tue, 26 Jul 2005, Naftali Schwartz wrote: > It seems like general dependence analysis in LLVM should require that this > function be, well, functional. Is it simply a placeholder waiting for > someone to come and fill in the details? It also appears that some other > things besides dependence analysis depend on it as well...anyone working on > this? I don't understand
2019 Feb 25
7
[PATCH 0/3] RFC: v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json. It produces local files, just like -o local, although the metadata produced is a JSON file with data that v2v collected in the conversion process. This can be useful for converting to unsupported destinations, still based on QEMU/KVM. In addition to a simple different metadata, it offers a way to relocate the disks, with
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
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 errno from non-C plugins plugins: Add new nbdkit_set_error() utility function python:
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...l_copy_int64 (stats.tx_packets); Store_field (rv, 5, v); + v = caml_copy_int64 (stats.tx_errs); Store_field (rv, 6, v); + v = caml_copy_int64 (stats.tx_drop); Store_field (rv, 7, v); + + CAMLreturn (rv); +} + +CAMLprim value +ocaml_libvirt_domain_block_peek_native (value domv, value pathv, value offsetv, value sizev, value bufferv, value boffv) +{ + CAMLparam5 (domv, pathv, offsetv, sizev, bufferv); + CAMLxparam1 (boffv); + virDomainPtr dom = Domain_val (domv); + const char *path = String_val (pathv); + unsigned long long offset = Int64_val (offsetv); + size_t size = Int_val (sizev); + char...