[Libguestfs] [PATCH v2v 2/2] Remove guestcaps_block_type Virtio_SCSI
Laszlo Ersek
lersek at redhat.com
Mon Nov 8 11:46:36 UTC 2021
On 11/08/21 10:12, Richard W.M. Jones wrote:
> Since we no longer support requesting virtio-scsi, this constructor
> was never used.
> ---
> convert/convert.ml | 2 +-
> convert/convert_linux.ml | 9 ++-------
> convert/target_bus_assignment.ml | 1 -
> lib/create_ovf.ml | 1 -
> lib/types.ml | 3 +--
> lib/types.mli | 2 +-
> output/create_json.ml | 1 -
> output/openstack_image_properties.ml | 7 -------
> 8 files changed, 5 insertions(+), 21 deletions(-)
Acked-by: Laszlo Ersek <lersek at redhat.com>
Thanks,
Laszlo
>
> diff --git a/convert/convert.ml b/convert/convert.ml
> index 109e55284..2fc618420 100644
> --- a/convert/convert.ml
> +++ b/convert/convert.ml
> @@ -392,7 +392,7 @@ and do_convert g source inspect keep_serial_console interfaces =
> (* Did we manage to install virtio drivers? *)
> if not (quiet ()) then (
> match guestcaps.gcaps_block_bus with
> - | Virtio_blk | Virtio_SCSI ->
> + | Virtio_blk ->
> info (f_"This guest has virtio drivers installed.")
> | IDE ->
> info (f_"This guest does not have virtio drivers installed.")
> diff --git a/convert/convert_linux.ml b/convert/convert_linux.ml
> index b0b5d916d..41bc4218e 100644
> --- a/convert/convert_linux.ml
> +++ b/convert/convert_linux.ml
> @@ -915,12 +915,8 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
> (* Update 'alias scsi_hostadapter ...' *)
> let paths = augeas_modprobe ". =~ regexp('scsi_hostadapter.*')" in
> (match block_type with
> - | Virtio_blk | Virtio_SCSI ->
> - let block_module =
> - match block_type with
> - | Virtio_blk -> "virtio_blk"
> - | Virtio_SCSI -> "virtio_scsi"
> - | IDE -> assert false in
> + | Virtio_blk ->
> + let block_module = "virtio_blk" in
>
> if paths <> [] then (
> (* There's only 1 scsi controller in the converted guest.
> @@ -993,7 +989,6 @@ let convert (g : G.guestfs) source inspect keep_serial_console _ =
> let block_prefix_after_conversion =
> match block_type with
> | Virtio_blk -> "vd"
> - | Virtio_SCSI -> "sd"
> | IDE -> ide_block_prefix in
>
> let map =
> diff --git a/convert/target_bus_assignment.ml b/convert/target_bus_assignment.ml
> index 5c149afbb..4b56a6e17 100644
> --- a/convert/target_bus_assignment.ml
> +++ b/convert/target_bus_assignment.ml
> @@ -35,7 +35,6 @@ let rec target_bus_assignment source_disks source_removables guestcaps =
> let bus =
> match guestcaps.gcaps_block_bus with
> | Virtio_blk -> virtio_blk_bus
> - | Virtio_SCSI -> scsi_bus
> | IDE -> ide_bus in
> List.iteri (
> fun i d ->
> diff --git a/lib/create_ovf.ml b/lib/create_ovf.ml
> index 470a90bd6..3991b66dd 100644
> --- a/lib/create_ovf.ml
> +++ b/lib/create_ovf.ml
> @@ -891,7 +891,6 @@ and add_disks sizes guestcaps output_alloc output_format
> "ovf:disk-interface",
> (match guestcaps.gcaps_block_bus with
> | Virtio_blk -> "VirtIO"
> - | Virtio_SCSI -> "VirtIO_SCSI"
> | IDE -> "IDE");
> "ovf:disk-type", "System"; (* RHBZ#744538 *)
> "ovf:boot", if is_bootable_drive then "True" else "False";
> diff --git a/lib/types.ml b/lib/types.ml
> index 9be3e6fcd..aeb7d71ae 100644
> --- a/lib/types.ml
> +++ b/lib/types.ml
> @@ -422,14 +422,13 @@ type guestcaps = {
> gcaps_arch : string;
> gcaps_acpi : bool;
> }
> -and guestcaps_block_type = Virtio_blk | Virtio_SCSI | IDE
> +and guestcaps_block_type = Virtio_blk | IDE
> and guestcaps_net_type = Virtio_net | E1000 | RTL8139
> and guestcaps_video_type = QXL | Cirrus
> and guestcaps_machine = I440FX | Q35 | Virt
>
> let string_of_block_type = function
> | Virtio_blk -> "virtio-blk"
> - | Virtio_SCSI -> "virtio-scsi"
> | IDE -> "ide"
> let string_of_net_type = function
> | Virtio_net -> "virtio-net"
> diff --git a/lib/types.mli b/lib/types.mli
> index 4d4049605..3aab1ea7e 100644
> --- a/lib/types.mli
> +++ b/lib/types.mli
> @@ -282,7 +282,7 @@ type guestcaps = {
> }
> (** Guest capabilities after conversion. eg. Was virtio found or installed? *)
>
> -and guestcaps_block_type = Virtio_blk | Virtio_SCSI | IDE
> +and guestcaps_block_type = Virtio_blk | IDE
> and guestcaps_net_type = Virtio_net | E1000 | RTL8139
> and guestcaps_video_type = QXL | Cirrus
> and guestcaps_machine = I440FX | Q35 | Virt
> diff --git a/output/create_json.ml b/output/create_json.ml
> index 5fa2805a2..211cd5d64 100644
> --- a/output/create_json.ml
> +++ b/output/create_json.ml
> @@ -195,7 +195,6 @@ let create_json_metadata source inspect
> let block_bus =
> match guestcaps.gcaps_block_bus with
> | Virtio_blk -> "virtio-blk"
> - | Virtio_SCSI -> "virtio-scsi"
> | IDE -> "ide" in
> let net_bus =
> match guestcaps.gcaps_net_bus with
> diff --git a/output/openstack_image_properties.ml b/output/openstack_image_properties.ml
> index 66f539921..bca0766e2 100644
> --- a/output/openstack_image_properties.ml
> +++ b/output/openstack_image_properties.ml
> @@ -35,7 +35,6 @@ let create source inspect { target_buses; guestcaps; target_firmware } =
> "hw_disk_bus",
> (match guestcaps.gcaps_block_bus with
> | Virtio_blk -> "virtio"
> - | Virtio_SCSI -> "scsi"
> | IDE -> "ide");
> "hw_vif_model",
> (match guestcaps.gcaps_net_bus with
> @@ -73,12 +72,6 @@ let create source inspect { target_buses; guestcaps; target_firmware } =
> List.push_back properties ("hw_cpu_threads", string_of_int threads);
> );
>
> - (match guestcaps.gcaps_block_bus with
> - | Virtio_SCSI ->
> - List.push_back properties ("hw_scsi_model", "virtio-scsi")
> - | Virtio_blk | IDE -> ()
> - );
> -
> (match inspect.i_major_version, inspect.i_minor_version with
> | 0, 0 -> ()
> | x, 0 -> List.push_back properties ("os_version", string_of_int x)
>
More information about the Libguestfs
mailing list