search for: c_pointer

Displaying 20 results from an estimated 52 matches for "c_pointer".

2016 Jan 28
1
[PATCH] python: stop using parens-less print in tests
...and not rex.match (machine): - print "skipping test: arch is not x86 and does not support IDE" + print ("skipping test: arch is not x86 and does not support IDE") exit (77) conn = libvirt.open (None) # Check we're using the version of libvirt-python that has c_pointer() methods. if not "c_pointer" in dir (conn): - print "skipping test: libvirt-python doesn't support c_pointer()" + print ("skipping test: libvirt-python doesn't support c_pointer()") exit (77) # Create a test disk. @@ -86,12 +86,12 @@ dom = conn....
2016 Apr 12
3
[PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
In v1 of this patch, there was the (small) possibility that 'g' might have been garbage collected while we were in the C function. Avoid this by passing 'g' to the function as well as the C pointer, so that 'g' is pinned as a garbage collector root [by CAMLparam5] so it cannot be collected while we're in the function. Rich.
2016 Apr 11
0
[PATCH] customize/perl_edit-c.c: Don't use internal APIs.
We can now use the Guestfs.c_pointer method to access the underlying guestfs_h *. So no need to use internal APIs for this. --- customize/perl_edit-c.c | 12 +++--------- customize/perl_edit.ml | 5 +++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/customize/perl_edit-c.c b/customize/perl_edit-c.c index 753d990...
2016 Apr 12
0
[PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
We can now use the Guestfs.c_pointer method to access the underlying guestfs_h *. So no need to use internal APIs for this. --- customize/perl_edit-c.c | 18 ++++++------------ customize/perl_edit.ml | 10 ++++++++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/customize/perl_edit-c.c b/customize/perl_edit-c.c i...
2016 Apr 12
1
Re: [PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
On Tuesday 12 April 2016 08:41:37 Richard W.M. Jones wrote: > We can now use the Guestfs.c_pointer method to access the underlying > guestfs_h *. So no need to use internal APIs for this. > --- LGTM. Did it cause any particular issue? (Not that it is a problem, just to know whether it was doing anything problematic.) Thanks, -- Pino Toscano
2016 May 04
9
[PATCH 0/8] python: PEP 8 fixes
Hi, this series cleans up the Python sources, either static or generated, including also tests, to make them PEP 8 compliant; see https://www.python.org/dev/peps/pep-0008/ and tools like pep8. Almost all the issues reported by pep8 are fixed, reducing the issues from 3818 to 7. The changes should have no effect on the actual code, while it will help Python users with consistency with other
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...hine () -rex = re.compile ("i.86") -if machine != "x86_64" and not rex.match (machine): - print ("skipping test: arch is not x86 and does not support IDE") - exit (77) - -conn = libvirt.open (None) - -# Check we're using the version of libvirt-python that has c_pointer() methods. -if not "c_pointer" in dir (conn): - print ("skipping test: libvirt-python doesn't support c_pointer()") - exit (77) - -class Test820RHBZ912499 (unittest.TestCase): - def setUp (self): - # Create a test disk. - self.filename = os.getcwd () +...
2016 Apr 14
1
Re: [PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
On Tuesday 12 April 2016 08:41:37 Richard W.M. Jones wrote: > We can now use the Guestfs.c_pointer method to access the underlying > guestfs_h *. So no need to use internal APIs for this. > --- > customize/perl_edit-c.c | 18 ++++++------------ > customize/perl_edit.ml | 10 ++++++++-- > 2 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/customize/perl_e...
2015 Mar 03
2
[PATCH] actions: improve man page links
...as C<guestfs_stat> except that if C<path> is a symbolic link, then the link is stat-ed, not the file it refers to. -This is the same as the C<lstat(2)> system call." }; +This is the same as the L<lstat(2)> system call." }; { defaults with name = "c_pointer"; @@ -4475,7 +4475,7 @@ Returns file system statistics for any mounted file system. C<path> should be a file or directory in the mounted file system (typically it is the mount point itself, but it doesn't need to be). -This is the same as the C<statvfs(2)> system call.&quot...
2017 Mar 07
0
[PATCH v4 7/9] dib: move do_cp to mllib.Commun_utils
...hen str ^ "\n" else str diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index e1d63292e..945728b5e 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1167,3 +1167,8 @@ let inspect_decrypt g = * function. *) c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) + +let do_cp src destdir = + let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in + if run_command cmd <> 0 then + error (f_"copy of %s to %s failed") src destdir diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 1cd38ba...
2017 Mar 23
0
[PATCH v5 07/10] dib: move do_cp to mllib.Commun_utils
...hen str ^ "\n" else str diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index e1d63292e..945728b5e 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1167,3 +1167,8 @@ let inspect_decrypt g = * function. *) c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) + +let do_cp src destdir = + let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in + if run_command cmd <> 0 then + error (f_"copy of %s to %s failed") src destdir diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 1cd38ba...
2017 Apr 12
0
[PATCH v6 07/10] dib: move do_cp to mllib.Commun_utils
...hen str ^ "\n" else str diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 63d8dd92e..ceac57711 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -1186,3 +1186,8 @@ let inspect_decrypt g = * function. *) c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) + +let do_cp src destdir = + let cmd = [ "cp"; "-t"; destdir; "-a"; src ] in + if run_command cmd <> 0 then + error (f_"copy of %s to %s failed") src destdir diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index ec41a8f...
2017 Sep 12
0
[PATCH v8 5/7] mllib: add do_mv helper function to Common_utils
...+++ 2 files changed, 9 insertions(+) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 597128967..1126f233b 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -561,3 +561,9 @@ let inspect_decrypt g = * function. *) c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) + +let do_mv src dest = + let cmd = [ "mv"; src; dest ] in + let r = run_command cmd in + if r <> 0 then + error (f_"moving file '%s' to '%s' failed") src dest diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index fa4d1505...
2018 Sep 20
2
Re: [PATCH 2/2] Introduce a --key option in tools that accept keys
...iginal 'g' even though it is not used by the > * callee. This is so that 'g' is kept as a root on the stack, and > * so cannot be garbage collected while we are in the c_inspect_decrypt > * function. > *) > c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) > + keys_as_list An array would be even easier, but I guess you've written the list code now :-) - - - I think Eric's / qemu's shared key stuff sounds very complex, and I wonder who uses it. But in any case what you've proposed is extensible enough that we...
2020 Jan 22
0
[PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
...rypt g ks = +let inspect_decrypt g ?(allow_discards = false) ks = (* Turn the keys in the key_store into a simpler struct, so it is possible * to read it using the C API. *) @@ -664,7 +664,7 @@ let inspect_decrypt g ks = * function. *) c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) - keys_as_list + keys_as_list allow_discards let with_timeout op timeout ?(sleep = 2) fn = let start_t = Unix.gettimeofday () in diff --git a/mltools/tools_utils.mli b/mltools/tools_utils.mli index ab70f58..309a033 100644 --- a/mltools/tools_utils.mli +++ b/mltools/tools...
2014 Dec 11
4
[PATCH v3 0/4] Implement guestfs_add_libvirt_dom.
A hopefully cleaner implementation this time. It doesn't require any special insights into how libvirt-python is implemented. Instead, it requires a change to libvirt-python to add a .c_pointer() method: https://www.redhat.com/archives/libvir-list/2014-December/msg00615.html Rich.
2014 Dec 11
6
[PATCH v4 0/6] Implement guestfs_add_libvirt_dom.
Since v3: - Fix labelling over overlays (see 6/6) - Tested it with a test program which simulates what virt-manager will do. See the attachment here: https://bugzilla.redhat.com/show_bug.cgi?id=1075164#c7 Rich.
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...crypt g = + (* Note we pass original 'g' even though it is not used by the + * callee. This is so that 'g' is kept as a root on the stack, and + * so cannot be garbage collected while we are in the c_edit_file + * function. + *) + c_inspect_decrypt g#ocaml_handle (Guestfs.c_pointer g#ocaml_handle) diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index de95f9d..68c0d54 100644 --- a/mllib/common_utils.mli +++ b/mllib/common_utils.mli @@ -260,10 +260,13 @@ val parse_resize : int64 -> string -> int64 val human_size : int64 -> string (** Converts a size in b...
2017 Feb 10
0
[PATCH v3 06/10] mllib: ocaml wrapper for lib/osinfo
...Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) +open Common_utils + +type osinfo_db_callback = string -> unit + +external c_read_osinfo_db : int64 -> osinfo_db_callback -> unit = + "guestfs_int_mllib_read_osinfo_db" + +let read_osinfo_db g f = + c_read_osinfo_db (Guestfs.c_pointer g) f diff --git a/mllib/osinfo.mli b/mllib/osinfo.mli new file mode 100644 index 000000000..306cbce0f --- /dev/null +++ b/mllib/osinfo.mli @@ -0,0 +1,31 @@ +(* virt-builder + * Copyright (C) 2016 - SUSE Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under t...
2017 Mar 07
0
[PATCH v4 3/9] mllib: ocaml wrapper for lib/osinfo
...Street, Fifth Floor, Boston, MA 02110-1301 USA. + *) +open Common_utils + +type osinfo_db_callback = string -> unit + +external c_read_osinfo_db : int64 -> osinfo_db_callback -> unit = + "guestfs_int_mllib_read_osinfo_db" + +let read_osinfo_db g f = + c_read_osinfo_db (Guestfs.c_pointer g) f diff --git a/mllib/osinfo.mli b/mllib/osinfo.mli new file mode 100644 index 000000000..306cbce0f --- /dev/null +++ b/mllib/osinfo.mli @@ -0,0 +1,31 @@ +(* virt-builder + * Copyright (C) 2016 - SUSE Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under t...