Displaying 16 results from an estimated 16 matches for "guestfs_event_to_string".
2015 Oct 02
1
[PATCH] ruby: improve rdoc markup
...delete_event_callback}[http://libguestfs.org/guestfs.3.html#guestfs_delete_event_callback]
* to delete an event callback.
*/
static VALUE
@@ -328,7 +328,7 @@ ruby_delete_event_callback (VALUE gv, VALUE event_handlev)
* Guestfs::Guestfs.event_to_string(events) -> string
*
* Call
- * +guestfs_event_to_string+[http://libguestfs.org/guestfs.3.html#guestfs_event_to_string]
+ * {guestfs_event_to_string}[http://libguestfs.org/guestfs.3.html#guestfs_event_to_string]
* to convert an event or event bitmask into a printable string.
*/
static VALUE
@@ -477,13 +477,18 @@ get_all_event_callbacks (guestfs_h *g...
2017 May 11
1
[PATCH] python: improve few exceptions thrown on error
...---
python/handle.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/python/handle.c b/python/handle.c
index 88024e1..9746dca 100644
--- a/python/handle.c
+++ b/python/handle.c
@@ -237,7 +237,7 @@ guestfs_int_py_event_to_string (PyObject *self, PyObject *args)
str = guestfs_event_to_string (events);
if (str == NULL) {
- PyErr_SetString (PyExc_RuntimeError, strerror (errno));
+ PyErr_SetFromErrno (PyExc_RuntimeError);
return NULL;
}
@@ -271,7 +271,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
/* Copy them into the return array. */
r = malloc (si...
2019 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...C" {
+ fn guestfs_set_event_callback(
+ g: *const base::guestfs_h,
+ cb: GuestfsEventCallback,
+ event_bitmask: u64,
+ flags: i32,
+ opaque: *const c_void,
+ ) -> i32;
+ fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32);
+ fn guestfs_event_to_string(bitmask: u64) -> *const c_char;
+ fn free(buf: *const c_void);
+}
+
+#[derive(Hash, PartialEq, Eq)]
+pub struct EventHandle {
+ eh: i32,
+}
+
+pub type Callback = FnMut(guestfs::Event, EventHandle, &[i8], &[u64]);
+
+fn events_to_bitmask(v: &[guestfs::Event]) -> u64 {
+ l...
2019 Jul 30
0
Re: [PATCH] Rust bindings: Implement Event features
...ent_callback(
>+ g: *const base::guestfs_h,
>+ cb: GuestfsEventCallback,
>+ event_bitmask: u64,
>+ flags: i32,
>+ opaque: *const c_void,
>+ ) -> i32;
>+ fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32);
>+ fn guestfs_event_to_string(bitmask: u64) -> *const c_char;
>+ fn free(buf: *const c_void);
>+}
>+
>+#[derive(Hash, PartialEq, Eq)]
>+pub struct EventHandle {
>+ eh: i32,
>+}
>+
>+pub type Callback = FnMut(guestfs::Event, EventHandle, &[i8], &[u64]);
>+
>+fn events_to_bitmask(...
2019 Jul 30
1
Re: [PATCH] Rust bindings: Implement Event features
...t base::guestfs_h,
> >+ cb: GuestfsEventCallback,
> >+ event_bitmask: u64,
> >+ flags: i32,
> >+ opaque: *const c_void,
> >+ ) -> i32;
> >+ fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32);
> >+ fn guestfs_event_to_string(bitmask: u64) -> *const c_char;
> >+ fn free(buf: *const c_void);
> >+}
> >+
> >+#[derive(Hash, PartialEq, Eq)]
> >+pub struct EventHandle {
> >+ eh: i32,
> >+}
> >+
> >+pub type Callback = FnMut(guestfs::Event, EventHandle, &[i8],...
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...C" {
+ fn guestfs_set_event_callback(
+ g: *const base::guestfs_h,
+ cb: GuestfsEventCallback,
+ event_bitmask: u64,
+ flags: i32,
+ opaque: *const c_void,
+ ) -> i32;
+ fn guestfs_delete_event_callback(g: *const base::guestfs_h, eh: i32);
+ fn guestfs_event_to_string(bitmask: u64) -> *const c_char;
+ fn free(buf: *const c_void);
+}
+
#[derive(Hash, PartialEq, Eq)]
pub struct EventHandle {
eh: i32,
}
+
+fn events_to_bitmask(v: &[guestfs::Event]) -> u64 {
+ let mut r = 0u64;
+ for x in v.iter() {
+ r |= x.to_u64();
+ }
+ r...
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
...nge in an own
> small patch? This way it can be documented why it was changed.
>
> > +pub fn event_to_string(events: &[guestfs::Event]) -> Result<String,
> error::Error> {
> > + let bitmask = events_to_bitmask(events);
> > +
> > + let r = unsafe { guestfs_event_to_string(bitmask) };
> > + if r.is_null() {
> > + Err(error::unix_error("event_to_string"))
> > + } else {
> > + let s = unsafe { ffi::CStr::from_ptr(r) };
> > + let s = s.to_str()?.to_string();
>
> These two look like utils::char_ptr_...
2015 May 26
6
[PATCH 0/6] Update the way that API versions are generated for the man page.
The existing mechanism was clunky, slow and used ~ 10 MB of
local disk.
Rich.
2019 Jul 31
0
Re: [PATCH] Rust bindings: Implement Event features
...dle -> Handle<'a> change in an own
small patch? This way it can be documented why it was changed.
> +pub fn event_to_string(events: &[guestfs::Event]) -> Result<String, error::Error> {
> + let bitmask = events_to_bitmask(events);
> +
> + let r = unsafe { guestfs_event_to_string(bitmask) };
> + if r.is_null() {
> + Err(error::unix_error("event_to_string"))
> + } else {
> + let s = unsafe { ffi::CStr::from_ptr(r) };
> + let s = s.to_str()?.to_string();
These two look like utils::char_ptr_to_string().
> diff --git a/ru...
2018 Jan 22
2
[PATCH] lua, perl: Use thread-safe strerror_r instead of strerror (RHBZ#1536763).
...luaL_error (L, \"get_string_list: malloc failed: %%s\", err);
/*NOTREACHED*/
return NULL;
}
diff --git a/generator/perl.ml b/generator/perl.ml
index bd7e328cd..240bf3b54 100644
--- a/generator/perl.ml
+++ b/generator/perl.ml
@@ -308,7 +308,7 @@ PREINIT:
CODE:
str = guestfs_event_to_string (event_bitmask);
if (str == NULL)
- croak (\"%%s\", strerror (errno));
+ croak (\"%%m\");
RETVAL = newSVpv (str, 0);
free (str);
OUTPUT:
diff --git a/lua/Makefile.am b/lua/Makefile.am
index f90c1d7cb..a26c0baee 100644
--- a/lua/Makefile.am
++...
2016 Mar 19
1
[PATCH] tests/qemu: Add program for tracing and analyzing boot times.
...elapsed time %" PRIi64 " ns\n", pass_data[i].elapsed_ns);
+ for (j = 0; j < pass_data[i].nr_events; ++j) {
+ int64_t ns;
+ CLEANUP_FREE char *event_str = NULL;
+
+ ns = timespec_diff (&pass_data[i].start_t, &pass_data[i].events[j].t);
+ event_str = guestfs_event_to_string (pass_data[i].events[j].source);
+ printf (" #%zu: +%" PRIi64 " [%s] \"", j, ns, event_str);
+ print_escaped_string (pass_data[i].events[j].message);
+ printf ("\"\n");
+ }
+ }
+}
+
+/* Add an activity to the global list. */
+static stru...
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...assert.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include <errno.h>
+#include <error.h>
#include <guestfs.h>
@@ -261,10 +263,8 @@ print_event_set (uint64_t event_bitmask, FILE *fp)
fputs ("*", fp);
else {
CLEANUP_FREE char *str = guestfs_event_to_string (event_bitmask);
- if (!str) {
- perror ("guestfs_event_to_string");
- exit (EXIT_FAILURE);
- }
+ if (!str)
+ error (EXIT_FAILURE, errno, "guestfs_event_to_string");
fputs (str, fp);
}
}
diff --git a/fish/fish.c b/fish/fish.c
index 1e29639..6f9c7...
2016 Mar 23
7
[PATCH v4 0/6] tests/qemu: Add program for tracing and analyzing boot times.
v4:
- Lots more analysis of the /init script and other parts.
- Display a list of the longest to shortest activities.
- Rebase on top of current head.
Rich.
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...quot;
- (String.uppercase c_name) (String.uppercase n);
+ (String.uppercase_ascii c_name) (String.uppercase_ascii n);
pr " optargs_s.%s = va_arg (args, " n;
(match argt with
| OBool _ | OInt _ -> pr "int"
@@ -2273,7 +2275,8 @@ guestfs_event_to_string (uint64_t event)
List.iter (
fun name ->
- pr " if ((event & GUESTFS_EVENT_%s) != 0) {\n" (String.uppercase name);
+ pr " if ((event & GUESTFS_EVENT_%s) != 0) {\n"
+ (String.uppercase_ascii name);
pr " strcpy (&ret[len]...
2016 Mar 22
19
[PATCH v3 0/11] tests/qemu: Add program for tracing and analyzing boot times.
Lots of changes since v2, too much to remember or summarize.
Please ignore patch 11/11, it's just for my testing.
Rich.
2016 Mar 20
14
[PATCH v2 0/7] tests/qemu: Add program for tracing and analyzing boot times.
v1 was here:
https://www.redhat.com/archives/libguestfs/2016-March/thread.html#00157
Not running the 'hwclock' command reduces boot times considerably.
However I'm not sure if it is safe. See the question I posted on
qemu-devel:
http://thread.gmane.org/gmane.comp.emulators.qemu/402194
At the moment, about 50% of the time is consumed by SeaBIOS. Of this,
about ⅓rd is SGABIOS