Displaying 20 results from an estimated 154 matches for "open_guestfs".
2015 Nov 10
0
[PATCH 4/4] mllib, v2v: Allow open_guestfs to set the handle identifier.
Extend open_guestfs to take an optional ?identifier parameter.
Use this parameter in virt-v2v which is currently the only place where
we use the handle identifier.
---
mllib/common_utils.ml | 3 ++-
mllib/common_utils.mli | 2 +-
v2v/output_rhev.ml | 3 +--
v2v/output_vdsm.ml | 3 +--
v2v/v2v.ml...
2015 Nov 10
1
[PATCH] OCaml tools: use open_guestfs everywhere
Instead of creating Guestfs handles and manually apply common options
(e.g. debug and trace), use the open_guestfs in Common_utils.
This also applies the common options to handles which didn't set them
before, so we can inspect also their messages if needed.
---
builder/builder.ml | 8 ++------
customize/customize_main.ml | 4 +---
dib/dib.ml | 4 +---
get-kernel/get_kernel.ml...
2015 Oct 21
2
[PATCH] v2v: use open_guestfs everywhere
Use the common open_guestfs to open Guestfs handles, so we get
debugging, tracing, and other common options set.
---
v2v/convert_windows.ml | 4 +---
v2v/input_disk.ml | 2 +-
v2v/input_libvirt_other.ml | 2 +-
v2v/input_ova.ml | 2 +-
v2v/output_glance.ml | 2 +-
v2v/output_null.ml | 2 +...
2015 Oct 21
1
[PATCH] v2v: move open_guestfs to Types
Move most of open_guestfs to Types, so a common function to open a
Guestfs handle is available. Since it does not do all the things the
old open_guestfs did, the two operations have been moved to the only
place requiring them.
This function has been placed in Types and not Utils, as will be needed
by other functions in Ty...
2015 Oct 21
0
Re: [PATCH] v2v: use open_guestfs everywhere
On Wed, Oct 21, 2015 at 03:53:33PM +0200, Pino Toscano wrote:
> Use the common open_guestfs to open Guestfs handles, so we get
> debugging, tracing, and other common options set.
> ---
> v2v/convert_windows.ml | 4 +---
> v2v/input_disk.ml | 2 +-
> v2v/input_libvirt_other.ml | 2 +-
> v2v/input_ova.ml | 2 +-
> v2v/output_glance.ml | 2 +...
2015 Nov 10
7
[PATCH 0/4]: mllib: Add 'may' function, and refactoring.
The 'may' function is a higher-order function (HOF) that replaces:
match x with
| None -> ()
| Some x -> f x
with:
may f x
The idea comes from lablgtk (OCaml Gtk bindings) where it is widely
used.
If this change is clearer than previous code, then this could be used
in many more places. However I previously steered clear from using
HOFs like this because they can be
2015 Nov 11
1
Re: [PATCH 4/4] mllib, v2v: Allow open_guestfs to set the handle identifier.
On Tuesday 10 November 2015 20:25:58 Richard W.M. Jones wrote:
> Extend open_guestfs to take an optional ?identifier parameter.
>
> Use this parameter in virt-v2v which is currently the only place where
> we use the handle identifier.
> ---
LGTM -- could a shorter ?id could do it as well?
--
Pino Toscano
2020 Apr 06
0
[PATCH virt-v2v v2 2/2] v2v: Allow large temporary directory to be set on a global basis.
...5d3bece18..d78a5ce82 100644
--- a/v2v/input_ova.ml
+++ b/v2v/input_ova.ml
@@ -132,8 +132,8 @@ class input_ova ova = object
(* The spec allows the file to be gzip-compressed, in
* which case we must uncompress it into a temporary.
*)
- let temp_dir = (open_guestfs ())#get_cachedir () in
- let new_filename = Filename.temp_file ~temp_dir "ova" ".vmdk" in
+ let new_filename =
+ Filename.temp_file ~temp_dir:Utils.large_tmpdir "ova" ".vmdk" in
unlink_on_exit new_filename;...
2020 Apr 06
4
[v2v PATCH 1/2] v2v: nbdkit: change base dir for nbdkit sockets/pidfiles
...place the socket and PID file. *)
+ (* Create a temporary directory where we place the socket and PID file.
+ * Use the libguestfs socket directory, so it is more likely the full path
+ * of the UNIX sockets will fit in the (limited) socket pathname.
+ *)
let tmpdir =
- let base_dir = (open_guestfs ())#get_cachedir () in
+ let base_dir = (open_guestfs ())#get_sockdir () in
let t = Mkdtemp.temp_dir ~base_dir "v2vnbdkit." in
(* tmpdir must be readable (but not writable) by "other" so that
* qemu can open the sockets.
--
2.25.1
2020 Apr 06
0
[v2v PATCH 2/2] Consolidate handling of temporary files/dirs
...d can
* contain hrefs referencing snapshots. The href will be something
@@ -132,9 +133,7 @@ class input_ova ova = object
(* The spec allows the file to be gzip-compressed, in
* which case we must uncompress it into a temporary.
*)
- let temp_dir = (open_guestfs ())#get_cachedir () in
- let new_filename = Filename.temp_file ~temp_dir "ova" ".vmdk" in
- unlink_on_exit new_filename;
+ let new_filename = Filename.temp_file ~temp_dir:cachedir "ova" ".vmdk" in
let cmd =...
2020 Apr 06
6
[PATCH virt-v2v v2 0/2] v2v: Large temporary directory handling.
v1 was here:
https://www.redhat.com/archives/libguestfs/2020-April/msg00007.html
There's a BZ for this now which I forgot to add to the commit message:
https://bugzilla.redhat.com/show_bug.cgi?id=1814611
For v2:
- Fix incorrect reference to $TMPDIR in existing manual.
- Separate handling for small temporary files and large temporary
files. Small temporary files go into $TMPDIR
2015 Oct 20
1
[PATCH v3 10/13] v2v: factor out opening and populating guestfs handle
...then g#set_verbose true;
- g#set_network true;
- List.iter (
- fun ({ov_overlay_file = overlay_file}) ->
- g#add_drive_opts overlay_file
- ~format:"qcow2" ~cachemode:"unsafe" ~discard:"besteffort"
- ~copyonread:true
- ) overlays;
+ let g = open_guestfs () in
+ populate_overlays g overlays;
g#launch ();
@@ -261,6 +251,24 @@ and init_targets overlays source output output_format =
output#prepare_targets source targets
+and open_guestfs () =
+ (* Open the guestfs handle. *)
+ let g = new G.guestfs () in
+ g#set_identifier "v2v&...
2016 Sep 12
2
[PATCH] v2v: ova: Make OVA directory public readable to work around libvirt bug (RHBZ#1375157).
...loded in
+ (* If virt-v2v is running as root, and the backend is libvirt, then
+ * we have to chmod the directory to 0755 and files to 0644
+ * so it is readable by qemu.qemu. This is libvirt bug RHBZ#890291.
+ *)
+ if Unix.geteuid () = 0 then (
+ let libguestfs_backend = (open_guestfs ())#get_backend () in
+ if libguestfs_backend = "libvirt" then (
+ warning (f_"making OVA directory public readable to workaround libvirt bug https://bugzilla.redhat.com/890291");
+ let cmd = [ "chmod"; "-R"; "go=u,go-w"; exploded...
2020 Apr 02
6
[PATCH virt-v2v] v2v: Allow temporary directory to be set on a global basis.
...5d3bece18..86f81e1f9 100644
--- a/v2v/input_ova.ml
+++ b/v2v/input_ova.ml
@@ -132,8 +132,8 @@ class input_ova ova = object
(* The spec allows the file to be gzip-compressed, in
* which case we must uncompress it into a temporary.
*)
- let temp_dir = (open_guestfs ())#get_cachedir () in
- let new_filename = Filename.temp_file ~temp_dir "ova" ".vmdk" in
+ let new_filename =
+ Filename.temp_file ~temp_dir:Utils.tmpdir "ova" ".vmdk" in
unlink_on_exit new_filename;
le...
2015 Oct 21
1
[PATCH] v2v: fix identifier
...ion(+), 1 deletion(-)
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
index 099ced2..fbd3ce1 100644
--- a/v2v/convert_windows.ml
+++ b/v2v/convert_windows.ml
@@ -296,7 +296,7 @@ echo uninstalling Xen PV driver
else if is_regular_file virtio_win then (
try
let g2 = open_guestfs () in
- g#set_identifier "virtio_win";
+ g2#set_identifier "virtio_win";
g2#add_drive_opts virtio_win ~readonly:true;
g2#launch ();
let vio_root = "/" in
--
2.1.0
2015 Nov 10
0
[PATCH] customize, dib, resize, sysprep: Use 'may' pattern in various places.
...21 deletions(-)
diff --git a/customize/customize_main.ml b/customize/customize_main.ml
index e161e82..13d40bc 100644
--- a/customize/customize_main.ml
+++ b/customize/customize_main.ml
@@ -166,9 +166,8 @@ read the man page virt-customize(1).
(* Connect to libguestfs. *)
let g =
let g = open_guestfs () in
-
- (match memsize with None -> () | Some memsize -> g#set_memsize memsize);
- (match smp with None -> () | Some smp -> g#set_smp smp);
+ may g#set_memsize memsize;
+ may g#set_smp smp;
g#set_network network;
(* Make sure to turn SELinux off to avoid awkward...
2015 Dec 04
1
[PATCH] builder: create temporary images in the cachedir (RHBZ#1288201)
...uilder/builder.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builder/builder.ml b/builder/builder.ml
index 957bc37..3750e5f 100644
--- a/builder/builder.ml
+++ b/builder/builder.ml
@@ -378,6 +378,8 @@ let main () =
goal_must, goal_must_not in
+ let cache_dir = (open_guestfs ())#get_cachedir () in
+
(* Planner: Transitions. *)
let transitions itags =
let is t = List.mem_assoc t itags in
@@ -394,7 +396,7 @@ let main () =
(* Since the final plan won't run in parallel, we don't only need
* to choose unique tempfiles per transition, so this is...
2016 Nov 30
0
[PATCH] v2v: -o vdsm, -o rhev: Don't create compat=0.10 images;
...v/output_vdsm.ml | 10 ----------
2 files changed, 14 deletions(-)
diff --git a/v2v/output_rhev.ml b/v2v/output_rhev.ml
index e45043b..3280150 100644
--- a/v2v/output_rhev.ml
+++ b/v2v/output_rhev.ml
@@ -248,10 +248,6 @@ object
Changeuid.func changeuid_t (
fun () ->
let g = open_guestfs ~identifier:"rhev_disk_create" () in
- (* For qcow2, override v2v-supplied compat option, because RHEL 6
- * nodes cannot handle qcow2 v3 (RHBZ#1145582).
- *)
- let compat = if format <> "qcow2" then compat else Some "0.10" in...
2020 Sep 18
1
Re: [PATCH v2v] v2v: Set the number of vCPUs to same as host number of pCPUs.
On Friday, 18 September 2020 11:44:04 CEST Richard W.M. Jones wrote:
> let g = open_guestfs ~identifier:"v2v" () in
> g#set_memsize (g#get_memsize () * 14 / 5);
> + (* Setting the number of vCPUs allows parallel mkinitrd. *)
> + g#set_smp (Sysconf.nr_processors_online ());
IMHO this is not a good idea, for few reasons:
a) it unconditionally uses all the available...
2019 Sep 19
2
[PATCH 1/2] v2v: add optional tmpdir parameter for Python_script
...44
--- a/v2v/python_script.ml
+++ b/v2v/python_script.ml
@@ -31,12 +31,15 @@ type script = {
path : string; (* Path to script. *)
}
-let create ?(name = "script.py") code =
+let create ?(name = "script.py") ?tmpdir code =
let tmpdir =
- let base_dir = (open_guestfs ())#get_cachedir () in
- let t = Mkdtemp.temp_dir ~base_dir "v2v." in
- rmdir_on_exit t;
- t in
+ match tmpdir with
+ | None ->
+ let base_dir = (open_guestfs ())#get_cachedir () in
+ let t = Mkdtemp.temp_dir ~base_dir "v2v." in
+ rmdir_on_exit t...