Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
v2v: Remove -o rhv-upload -oa preallocated
Using -oa preallocated with -o rhv-upload always gave an error.  We
should be able to implement this properly in modular virt-v2v, but as
this option did nothing here remove it to simplify things.
  • Loading branch information
rwmjones committed Jul 2, 2021
1 parent afa85ab commit 18084f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion v2v/cmdline.ml
Expand Up @@ -699,7 +699,7 @@ read the man page virt-v2v(1).
| Some os -> os in
if qemu_boot then
error_option_cannot_be_used_in_output_mode "rhv-upload" "--qemu-boot";
Output_rhv_upload.output_rhv_upload output_alloc output_conn
Output_rhv_upload.output_rhv_upload output_conn
output_password os
rhv_options,
output_format, output_alloc
Expand Down
15 changes: 2 additions & 13 deletions v2v/output_rhv_upload.ml
Expand Up @@ -154,15 +154,11 @@ let error_unless_nbdkit_compiled_with_selinux config =
let error_current_limitation required_param =
error (f_"rhv-upload: currently you must use ‘%s’. This restriction will be loosened in a future version.") required_param

let error_unless_output_alloc_sparse output_alloc =
if output_alloc <> Sparse then
error_current_limitation "-oa sparse"

let json_optstring = function
| Some s -> JSON.String s
| None -> JSON.Null

class output_rhv_upload output_alloc output_conn
class output_rhv_upload output_conn
output_password output_storage
rhv_options =
(* Create a temporary directory which will be deleted on exit. *)
Expand Down Expand Up @@ -197,9 +193,6 @@ class output_rhv_upload output_alloc output_conn
"output_conn", JSON.String output_conn;
"output_password", JSON.String output_password;
"output_storage", JSON.String output_storage;
"output_sparse", JSON.Bool (match output_alloc with
| Sparse -> true
| Preallocated -> false);
"rhv_cafile", json_optstring rhv_options.rhv_cafile;
"rhv_cluster",
JSON.String (Option.default "Default" rhv_options.rhv_cluster);
Expand Down Expand Up @@ -265,7 +258,6 @@ object
error_unless_nbdkit_min_version config;
error_unless_nbdkit_python_plugin_working plugin_script;
error_unless_nbdkit_compiled_with_selinux config;
error_unless_output_alloc_sparse output_alloc;

(* Python code prechecks. *)
let json_params = match rhv_options.rhv_disk_uuids with
Expand All @@ -291,9 +283,6 @@ object

method as_options =
"-o rhv-upload" ^
(match output_alloc with
| Sparse -> "" (* default, don't need to print it *)
| Preallocated -> " -oa preallocated") ^
sprintf " -oc %s -op %s -os %s"
output_conn output_password output_storage

Expand Down Expand Up @@ -447,7 +436,7 @@ object
(* Create the metadata. *)
let ovf =
Create_ovf.create_ovf source inspect target_meta targets
output_alloc sd_uuid image_uuids vol_uuids vm_uuid
Sparse sd_uuid image_uuids vol_uuids vm_uuid
OVirt in
let ovf = DOM.doc_to_string ovf in

Expand Down
7 changes: 3 additions & 4 deletions v2v/output_rhv_upload.mli
Expand Up @@ -25,9 +25,8 @@ val print_output_options : unit -> unit
val parse_output_options : (string * string) list -> rhv_options
(** Print and parse rhv-upload -oo options. *)

val output_rhv_upload : Types.output_allocation -> string -> string ->
string -> rhv_options -> Types.output
(** [output_rhv_upload output_alloc output_conn output_password output_storage
rhv_options]
val output_rhv_upload : string -> string -> string -> rhv_options ->
Types.output
(** [output_rhv_upload output_conn output_password output_storage rhv_options]
creates and returns a new {!Types.output} object specialized for writing
output to oVirt or RHV directly via RHV APIs. *)
1 change: 0 additions & 1 deletion v2v/rhv-upload-plugin.py
Expand Up @@ -491,7 +491,6 @@ def create_disk(connection):
# size, based on qemu-img measure of the overlay.
initial_size=params['disk_size'],
provisioned_size=params['disk_size'],
# XXX Ignores params['output_sparse'].
# Handling this properly will be complex, see:
# https://www.redhat.com/archives/libguestfs/2018-March/msg00177.html
sparse=True,
Expand Down

0 comments on commit 18084f9

Please sign in to comment.