Displaying 18 results from an estimated 18 matches for "c_msg".
Did you mean:
e_msg
2019 Aug 05
0
[PATCH 1/2] Rust bindings: Add Event structs, Clarify Handle lifetime
...c/error.rs
+++ b/rust/src/error.rs
@@ -56,7 +56,7 @@ impl convert::From<str::Utf8Error> for Error {
}
}
-impl base::Handle {
+impl<'a> base::Handle<'a> {
pub(crate) fn get_error_from_handle(&self, operation: &'static str) -> Error {
let c_msg = unsafe { guestfs_last_error(self.g) };
let message = unsafe { utils::char_ptr_to_string(c_msg).unwrap() };
diff --git a/rust/src/event.rs b/rust/src/event.rs
new file mode 100644
index 000000000..c363e913a
--- /dev/null
+++ b/rust/src/event.rs
@@ -0,0 +1,4 @@
+#[derive(Hash, PartialEq, E...
2019 Jun 27
0
[PATCH 7/9] Rust bindings: Complete actions
...Err(\"failed to create guestfs handle\")
} else {
@@ -163,10 +227,13 @@ impl Handle {
Ok(Handle { g })
}
}
-}\
-pub struct Error {
- // TODO
+ fn get_error_from_handle(&self, operation: &'static str) -> Error {
+ let c_msg = unsafe { guestfs_last_error(self.g) };
+ let message = unsafe { ffi::CStr::from_ptr(c_msg).to_str().unwrap().to_string() };
+ let errno = unsafe { guestfs_last_errno(self.g) } ;
+ Error { operation, message, errno }
+ }
}
pub struct UUID {
@@ -177,6 +244,9 @@ impl UUID...
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
I fixed based on comments.
I'll send these two patches to this mailing list.
- Fix Handle -> Handle<'a>
- Add events
Regards,
Hiroyuki
2019年8月1日(木) 0:01 Pino Toscano <ptoscano@redhat.com>:
> Hi Hiroyuki,
>
> On Tuesday, 30 July 2019 07:51:37 CEST Hiroyuki Katsura wrote:
> > This patch includes:
> >
> > - Event callback handlers
> > -
2019 Jun 27
0
Re: [PATCH 08/11] Rust bindings: Fix memory management and format the file
...+impl convert::From<str::Utf8Error> for Error {
+ fn from(error: str::Utf8Error) -> Self {
+ Error::Utf8Error(error)
+ }
}
impl Handle {
@@ -231,13 +297,17 @@ impl Handle {
fn get_error_from_handle(&self, operation: &'static str) -> Error {
let c_msg = unsafe { guestfs_last_error(self.g) };
let message = unsafe { ffi::CStr::from_ptr(c_msg).to_str().unwrap().to_string() };
- let errno = unsafe { guestfs_last_errno(self.g) } ;
- Error { operation, message, errno }
+ let errno = unsafe { guestfs_last_errno(self.g) };...
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...+pub(crate) fn unix_error(operation: &'static str) -> Error {
+ Error::UnixError(io::Error::last_os_error(), operation)
+}
+
impl<'a> base::Handle<'a> {
pub(crate) fn get_error_from_handle(&self, operation: &'static str) -> Error {
let c_msg = unsafe { guestfs_last_error(self.g) };
diff --git a/rust/src/event.rs b/rust/src/event.rs
index c363e913a..752e73610 100644
--- a/rust/src/event.rs
+++ b/rust/src/event.rs
@@ -1,4 +1,150 @@
+/* libguestfs Rust bindings
+ * Copyright (C) 2019 Hiroyuki Katsura <hiroyuki.katsura.0513@gmail.com>...
2019 Jun 27
4
Re: [PATCH 9/9] Rust bindings: Complete bindings
Patch 9 is a kind of dumping ground of all kinds of stuff. It may be
better to spend some time with git rebase -i trying to work this into
more coherent patches.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live
2019 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...+pub(crate) fn unix_error(operation: &'static str) -> Error {
+ Error::UnixError(io::Error::last_os_error(), operation)
+}
+
+impl<'a> base::Handle<'a> {
pub(crate) fn get_error_from_handle(&self, operation: &'static str) -> Error {
let c_msg = unsafe { guestfs_last_error(self.g) };
let message = unsafe { utils::char_ptr_to_string(c_msg).unwrap() };
diff --git a/rust/src/event.rs b/rust/src/event.rs
new file mode 100644
index 000000000..942feec69
--- /dev/null
+++ b/rust/src/event.rs
@@ -0,0 +1,158 @@
+/* libguestfs Rust bindin...
2019 Jul 02
16
[PATCH] Add Rust bindings
I fixed the patch I submitted before based on comments, and there are some
commits which are merged or divided. So, I will re-send all the patches.
Regards,
Hiroyuki Katsura
2019 Jun 27
0
[PATCH 9/9] Rust bindings: Complete bindings
...+impl convert::From<str::Utf8Error> for Error {
+ fn from(error: str::Utf8Error) -> Self {
+ Error::Utf8Error(error)
+ }
}
impl Handle {
@@ -271,13 +297,17 @@ impl Handle {
fn get_error_from_handle(&self, operation: &'static str) -> Error {
let c_msg = unsafe { guestfs_last_error(self.g) };
let message = unsafe { ffi::CStr::from_ptr(c_msg).to_str().unwrap().to_string() };
- let errno = unsafe { guestfs_last_errno(self.g) } ;
- Error { operation, message, errno }
+ let errno = unsafe { guestfs_last_errno(self.g) };...
2019 Jul 20
0
[PATCH] Rust bindings: Add Rust bindings
...], [disable Rust language bindings]),
+ [],
+ [enable_rust=yes])
+AS_IF([test "x$enable_rust" != "xno"],[
+ AC_CHECK_PROG([RUSTC],[rustc],[rustc],[no])
+ AC_CHECK_PROG([CARGO],[cargo],[cargo],[no])
+
+ AS_IF([test "x$RUSTC" == "xno"], [AC_MSG_WARN([rustc not found])])
+ AS_IF([test "x$CARGO" == "xno"], [AC_MSG_WARN([cargo not found])])
+],[
+ RUSTC=no
+ CARGO=no
+ ])
+AM_CONDITIONAL([HAVE_RUST],[test "x$RUSTC" != "xno" && test "x$CARGO" != "xno"])
diff --git...
2019 Jul 23
2
Re: [PATCH] Rust bindings: Add Rust bindings
...),
> + [],
> + [enable_rust=yes])
> +AS_IF([test "x$enable_rust" != "xno"],[
> + AC_CHECK_PROG([RUSTC],[rustc],[rustc],[no])
> + AC_CHECK_PROG([CARGO],[cargo],[cargo],[no])
> +
> + AS_IF([test "x$RUSTC" == "xno"], [AC_MSG_WARN([rustc not found])])
> + AS_IF([test "x$CARGO" == "xno"], [AC_MSG_WARN([cargo not found])])
> +],[
> + RUSTC=no
> + CARGO=no
> + ])
> +AM_CONDITIONAL([HAVE_RUST],[test "x$RUSTC" != "xno" && test "x$CARGO" !...
2019 Jul 23
0
Re: [PATCH] Rust bindings: Add Rust bindings
...], [disable Rust language bindings]),
+ [],
+ [enable_rust=yes])
+AS_IF([test "x$enable_rust" != "xno"],[
+ AC_CHECK_PROG([RUSTC],[rustc],[rustc],[no])
+ AC_CHECK_PROG([CARGO],[cargo],[cargo],[no])
+
+ AS_IF([test "x$RUSTC" == "xno"], [AC_MSG_WARN([rustc not found])])
+ AS_IF([test "x$CARGO" == "xno"], [AC_MSG_WARN([cargo not found])])
+],[
+ RUSTC=no
+ CARGO=no
+ ])
+AM_CONDITIONAL([HAVE_RUST],[test "x$RUSTC" != "xno" && test "x$CARGO" != "xno"])
diff --git...
2019 Jul 20
2
Re: [PATCH] Rust bindings: Add Rust bindings
> Is this just trying if the guestfs can be linked with?
Yes. In OCaml bindings, there is the corresponding test(
https://github.com/libguestfs/libguestfs/blob/master/ocaml/t/guestfs_010_load.ml).
I just mimicked it. If it is not required, I will remove it.
divided the generated files and handmade files in rust/src/ directory. I'll
send this fixed patch to this mailing list.
I'm not
2019 Jun 27
16
[PATCH 1/9] Rust bindings: Add Rust bindings
From: Hiroyuki_Katsura <hiroyuki.katsura.0513@gmail.com>
---
Makefile.am | 4 ++++
configure.ac | 3 +++
generator/Makefile.am | 3 +++
generator/bindtests.ml | 3 +++
generator/bindtests.mli | 1 +
generator/main.ml | 5 +++++
generator/rust.ml | 34 ++++++++++++++++++++++++++++++++++
generator/rust.mli | 19 +++++++++++++++++++
2019 Jul 08
2
Re: [PATCH] Add Rust bindings
On Mon, Jul 08, 2019 at 10:04:57AM +0100, Richard W.M. Jones wrote:
>On Mon, Jul 08, 2019 at 10:49:55AM +0200, Martin Kletzander wrote:
>> On Mon, Jul 08, 2019 at 10:10:10AM +0200, Pino Toscano wrote:
>> >On Saturday, 6 July 2019 13:03:24 CEST Martin Kletzander wrote:
>> >>Just one thing, the Cargo.toml includes a version under which the crate would be
>>
2019 Jul 29
1
Re: [PATCH] Rust bindings: Add Rust bindings
...], [disable Rust language bindings]),
+ [],
+ [enable_rust=yes])
+AS_IF([test "x$enable_rust" != "xno"],[
+ AC_CHECK_PROG([RUSTC],[rustc],[rustc],[no])
+ AC_CHECK_PROG([CARGO],[cargo],[cargo],[no])
+
+ AS_IF([test "x$RUSTC" == "xno"], [AC_MSG_WARN([rustc not found])])
+ AS_IF([test "x$CARGO" == "xno"], [AC_MSG_WARN([cargo not found])])
+],[
+ RUSTC=no
+ CARGO=no
+ ])
+AM_CONDITIONAL([HAVE_RUST],[test "x$RUSTC" != "xno" && test "x$CARGO" != "xno"])
diff --git...
2019 Jul 17
2
[PATCH] Rust bindings: Add Rust bindings
...tfs_create_flags(flags.to_libc_int()) };
+ if g.is_null() {
+ Err(\"failed to create guestfs handle\")
+ } else {
+ Ok(Handle { g })
+ }
+ }
+
+ fn get_error_from_handle(&self, operation: &'static str) -> Error {
+ let c_msg = unsafe { guestfs_last_error(self.g) };
+ let message = unsafe { ffi::CStr::from_ptr(c_msg).to_str().unwrap().to_string() };
+ let errno = unsafe { guestfs_last_errno(self.g) };
+ Error::API(APIError {
+ operation,
+ message,
+ errno,
+...
2019 Jul 26
4
Re: [PATCH] Rust bindings: Add Rust bindings
Hi Hiroyuki,
sorry for the late reply.
Most of the work is definitely nice! There are few notes below,
although they are not big issues. I will check this patch once more
on monday, especially the rust parts.
Otherwise, I'd say that we are close to merging this :)
On Tuesday, 23 July 2019 10:37:17 CEST Hiroyuki Katsura wrote:
> From: Hiroyuki_Katsura