[libvirt] [libvirt-rust PATCH 1/1] Make creating safe wrapper from raw pointer unsafe

2019-09-25 Thread Linus Färnstrand
Giving an invalid pointer to the safe wrapper types causes undefined behavior when methods are later called on said wrapper Properly document safety contract of using unsafe constructor --- src/connect.rs | 10 -- src/domain.rs | 10 -- src/domain_snapshot.rs | 10

[libvirt] [libvirt-rust PATCH 0/1] Fix unsoundness in wrapper new constructor

2019-09-25 Thread Linus Färnstrand
instantiating these types, they should likely not be called `new`, but rather something like `from_ptr`. Let's see if I manage to make the patch appear under the same email thread this time. Linus Färnstrand (1): Make creating safe wrapper from raw pointer unsafe src/connect.rs

Re: [libvirt] [PATCH 1/2] libvirt-rust: Fix bugs in Stream::recv

2019-09-22 Thread Linus Färnstrand
‐‐‐ Original Message ‐‐‐ On Friday, September 20, 2019 9:58 AM, Martin Kletzander wrote: > On Thu, Sep 19, 2019 at 05:48:37AM +0000, Linus Färnstrand wrote: > > > - pass same size to virStreamRecv as the buffer has allocated > > - Handle -2 error case > >

[libvirt] [PATCH 1/2] libvirt-rust: Fix bugs in Stream::recv

2019-09-19 Thread Linus Färnstrand
as a string Signed-off-by: Linus Färnstrand --- src/stream.rs | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/stream.rs b/src/stream.rs index 8333ee5..af6c8ec 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -18,6 +18,7 @@ extern crate libc;

[libvirt] [PATCH 2/2] libvirt-rust Fix Stream::send

2019-09-19 Thread Linus Färnstrand
* Handle the -2 error case * Allow sending arbitrary byte array, not just UTF-8 strings * Fix FFI declaration, takes size_t, not c_uint * Return usize to be more idiomatic (type used for slice indexing) Signed-off-by: Linus Färnstrand --- src/stream.rs | 21 ++--- 1 file changed

[libvirt] [PATCH 0/2] libvirt-rust: Fixing bugs in Stream::{send, recv}

2019-09-19 Thread Linus Färnstrand
x27;t have access to SMTP on my dev machine. Hope ProtonMail does not reformat this. Have a great day Linus Färnstrand Linus Färnstrand (2): Fix bugs in Stream::recv Fix Stream::send src/stream.rs | 42 +- 1 file changed, 21 insertions(+), 21 dele