diff --git a/.gitignore b/.gitignore index 479aabe..10fd57f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -SOURCES/RHEV-Application-Provisioning-Tool.exe_4.43-3 +SOURCES/RHEV-Application-Provisioning-Tool.exe_4.43-5 SOURCES/libguestfs-1.40.2.tar.gz SOURCES/libguestfs.keyring SOURCES/rhsrvany.exe diff --git a/.libguestfs.metadata b/.libguestfs.metadata index b63e4dd..355ef3d 100644 --- a/.libguestfs.metadata +++ b/.libguestfs.metadata @@ -1,4 +1,4 @@ -ac8722917cc31c36836e241bd7a4beb5f8a8b0c8 SOURCES/RHEV-Application-Provisioning-Tool.exe_4.43-3 +130adbc011dc0af736465b813c2b22a600c128c1 SOURCES/RHEV-Application-Provisioning-Tool.exe_4.43-5 45755f0f73b503790974484053ff482f32665b13 SOURCES/libguestfs-1.40.2.tar.gz 1bbc40f501a7fef9eef2a39b701a71aee2fea7c4 SOURCES/libguestfs.keyring 2bd96e478fc004cd323b5bd754c856641877dac6 SOURCES/rhsrvany.exe diff --git a/SOURCES/0001-common-mlpcre-add-offset-flag-for-PCRE.matches.patch b/SOURCES/0001-common-mlpcre-add-offset-flag-for-PCRE.matches.patch index 1267d12..3edbb8d 100644 --- a/SOURCES/0001-common-mlpcre-add-offset-flag-for-PCRE.matches.patch +++ b/SOURCES/0001-common-mlpcre-add-offset-flag-for-PCRE.matches.patch @@ -122,5 +122,5 @@ index 346019c40..3e5981107 100644 assert (replace ~global:true re0 "dd" "abcabcaabccca" = "ddcddcddccca"); -- -2.24.1 +2.25.4 diff --git a/SOURCES/0002-v2v-add-Var_expander.patch b/SOURCES/0002-v2v-add-Var_expander.patch index 6acf6d8..219a332 100644 --- a/SOURCES/0002-v2v-add-Var_expander.patch +++ b/SOURCES/0002-v2v-add-Var_expander.patch @@ -411,5 +411,5 @@ index 000000000..35b628369 + ignore (run_test_tt_main suite); + Printf.fprintf stderr "\n" -- -2.24.1 +2.25.4 diff --git a/SOURCES/0003-v2v-add-o-json-output-mode.patch b/SOURCES/0003-v2v-add-o-json-output-mode.patch index b105a3d..21e3c52 100644 --- a/SOURCES/0003-v2v-add-o-json-output-mode.patch +++ b/SOURCES/0003-v2v-add-o-json-output-mode.patch @@ -781,5 +781,5 @@ index cf9464834..9a555c3be 100644 For I<-o rhv-upload>, this is the name of the destination Storage Domain. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0004-inspect-fix-icon-of-RHEL.patch b/SOURCES/0004-inspect-fix-icon-of-RHEL.patch index bbc55f6..181d99e 100644 --- a/SOURCES/0004-inspect-fix-icon-of-RHEL.patch +++ b/SOURCES/0004-inspect-fix-icon-of-RHEL.patch @@ -28,5 +28,5 @@ index 623591aa6..19f3f87af 100644 return get_png (g, shadowman, size_r, 102400); } -- -2.24.1 +2.25.4 diff --git a/SOURCES/0005-v2v-warn-when-the-guest-has-direct-network-interface.patch b/SOURCES/0005-v2v-warn-when-the-guest-has-direct-network-interface.patch index 8f3c240..0f115f4 100644 --- a/SOURCES/0005-v2v-warn-when-the-guest-has-direct-network-interface.patch +++ b/SOURCES/0005-v2v-warn-when-the-guest-has-direct-network-interface.patch @@ -44,5 +44,5 @@ index d5d78d367..b9970cee8 100644 s_hypervisor = hypervisor; s_name = name; s_orig_name = name; -- -2.24.1 +2.25.4 diff --git a/SOURCES/0006-v2v-update-documentation-on-nbdkit-RHBZ-1605242.patch b/SOURCES/0006-v2v-update-documentation-on-nbdkit-RHBZ-1605242.patch index 91678e5..c3ef027 100644 --- a/SOURCES/0006-v2v-update-documentation-on-nbdkit-RHBZ-1605242.patch +++ b/SOURCES/0006-v2v-update-documentation-on-nbdkit-RHBZ-1605242.patch @@ -51,5 +51,5 @@ index 2b6dbaeec..b3ebda182 100644 =item 3. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0007-v2v-linux-do-not-uninstall-open-vm-tools-w-ubuntu-se.patch b/SOURCES/0007-v2v-linux-do-not-uninstall-open-vm-tools-w-ubuntu-se.patch index 4eca51c..f7ec87f 100644 --- a/SOURCES/0007-v2v-linux-do-not-uninstall-open-vm-tools-w-ubuntu-se.patch +++ b/SOURCES/0007-v2v-linux-do-not-uninstall-open-vm-tools-w-ubuntu-se.patch @@ -53,5 +53,5 @@ index 3d61400b5..b4b2f24c4 100644 ) inspect.i_apps; let libraries = !libraries in -- -2.24.1 +2.25.4 diff --git a/SOURCES/0008-v2v-linux-canonicalize-module-path-for-arch-detectio.patch b/SOURCES/0008-v2v-linux-canonicalize-module-path-for-arch-detectio.patch index 04f21e3..6691d7a 100644 --- a/SOURCES/0008-v2v-linux-canonicalize-module-path-for-arch-detectio.patch +++ b/SOURCES/0008-v2v-linux-canonicalize-module-path-for-arch-detectio.patch @@ -32,5 +32,5 @@ index 3313aabc7..889ec2f2a 100644 (* Just return the module names, without path or extension. *) let modules = List.filter_map ( -- -2.24.1 +2.25.4 diff --git a/SOURCES/0009-v2v-linux-improve-arch-detection-from-modules-RHBZ-1.patch b/SOURCES/0009-v2v-linux-improve-arch-detection-from-modules-RHBZ-1.patch index f415237..ce35612 100644 --- a/SOURCES/0009-v2v-linux-improve-arch-detection-from-modules-RHBZ-1.patch +++ b/SOURCES/0009-v2v-linux-improve-arch-detection-from-modules-RHBZ-1.patch @@ -57,5 +57,5 @@ index 889ec2f2a..30160f0da 100644 (* Just return the module names, without path or extension. *) let modules = List.filter_map ( -- -2.24.1 +2.25.4 diff --git a/SOURCES/0010-Use-proper-label-for-nbdkit-sockets.patch b/SOURCES/0010-Use-proper-label-for-nbdkit-sockets.patch index b5474d3..6b66ed9 100644 --- a/SOURCES/0010-Use-proper-label-for-nbdkit-sockets.patch +++ b/SOURCES/0010-Use-proper-label-for-nbdkit-sockets.patch @@ -59,5 +59,5 @@ index 77c39107e..c2a5c72c7 100644 args in -- -2.24.1 +2.25.4 diff --git a/SOURCES/0011-v2v-start-reading-the-new-libvirt-firmware-autoselec.patch b/SOURCES/0011-v2v-start-reading-the-new-libvirt-firmware-autoselec.patch index c0dcd97..7c688b1 100644 --- a/SOURCES/0011-v2v-start-reading-the-new-libvirt-firmware-autoselec.patch +++ b/SOURCES/0011-v2v-start-reading-the-new-libvirt-firmware-autoselec.patch @@ -41,5 +41,5 @@ index b9970cee8..14cd82afd 100644 s_video = video; s_sound = sound; -- -2.24.1 +2.25.4 diff --git a/SOURCES/0012-common-mltools-move-the-code-for-machine-readable-up.patch b/SOURCES/0012-common-mltools-move-the-code-for-machine-readable-up.patch index faa7314..ac06365 100644 --- a/SOURCES/0012-common-mltools-move-the-code-for-machine-readable-up.patch +++ b/SOURCES/0012-common-mltools-move-the-code-for-machine-readable-up.patch @@ -92,5 +92,5 @@ index 24641369e..5a35708cd 100644 getopt : Getopt.t; ks : key_store; -- -2.24.1 +2.25.4 diff --git a/SOURCES/0013-common-mltools-make-sure-machine-readable-output-is-.patch b/SOURCES/0013-common-mltools-make-sure-machine-readable-output-is-.patch index 88b744d..febcfd1 100644 --- a/SOURCES/0013-common-mltools-make-sure-machine-readable-output-is-.patch +++ b/SOURCES/0013-common-mltools-make-sure-machine-readable-output-is-.patch @@ -30,5 +30,5 @@ index 5a35708cd..ade4cb37f 100644 Some { pr } -- -2.24.1 +2.25.4 diff --git a/SOURCES/0014-common-mltools-allow-fd-for-machine-readable-output.patch b/SOURCES/0014-common-mltools-allow-fd-for-machine-readable-output.patch index d93b64e..8f9a207 100644 --- a/SOURCES/0014-common-mltools-allow-fd-for-machine-readable-output.patch +++ b/SOURCES/0014-common-mltools-allow-fd-for-machine-readable-output.patch @@ -83,5 +83,5 @@ index 53cece2da..f11028466 100644 The output goes to the specified F. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0015-OCaml-tools-output-messages-into-JSON-for-machine-re.patch b/SOURCES/0015-OCaml-tools-output-messages-into-JSON-for-machine-re.patch index 4539ffe..7fa6ab5 100644 --- a/SOURCES/0015-OCaml-tools-output-messages-into-JSON-for-machine-re.patch +++ b/SOURCES/0015-OCaml-tools-output-messages-into-JSON-for-machine-re.patch @@ -510,5 +510,5 @@ index f11028466..3c1d635c5 100644 passed to the I<--machine-readable> option: this string specifies where the machine-readable output will go. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0016-OCaml-tools-fix-3999-3339-typo.patch b/SOURCES/0016-OCaml-tools-fix-3999-3339-typo.patch index 2122a42..e4e9f0f 100644 --- a/SOURCES/0016-OCaml-tools-fix-3999-3339-typo.patch +++ b/SOURCES/0016-OCaml-tools-fix-3999-3339-typo.patch @@ -73,5 +73,5 @@ index 3c1d635c5..af944ddb7 100644 In addition to that, a subset of these tools support an extra string -- -2.24.1 +2.25.4 diff --git a/SOURCES/0017-v2v-remove-extra-nbdkit-bit-from-documentation-RHBZ-.patch b/SOURCES/0017-v2v-remove-extra-nbdkit-bit-from-documentation-RHBZ-.patch index 97c3066..d05b5b2 100644 --- a/SOURCES/0017-v2v-remove-extra-nbdkit-bit-from-documentation-RHBZ-.patch +++ b/SOURCES/0017-v2v-remove-extra-nbdkit-bit-from-documentation-RHBZ-.patch @@ -27,5 +27,5 @@ index b3ebda182..3acdd773e 100644 -ic 'vpx://root@vcenter.example.com/Datacenter/esxi?no_verify=1' \ -it vddk \ -- -2.24.1 +2.25.4 diff --git a/SOURCES/0018-v2v-i-vmx-Use-scp-T-option-if-available-to-unbreak-s.patch b/SOURCES/0018-v2v-i-vmx-Use-scp-T-option-if-available-to-unbreak-s.patch index 0ca42b5..8c3611a 100644 --- a/SOURCES/0018-v2v-i-vmx-Use-scp-T-option-if-available-to-unbreak-s.patch +++ b/SOURCES/0018-v2v-i-vmx-Use-scp-T-option-if-available-to-unbreak-s.patch @@ -45,5 +45,5 @@ index b169b2537..e3469308d 100644 | None -> "" | Some port -> sprintf " -P %d" port) -- -2.24.1 +2.25.4 diff --git a/SOURCES/0019-v2v-Allow-Windows-virtio-ISO-to-be-a-block-device-as.patch b/SOURCES/0019-v2v-Allow-Windows-virtio-ISO-to-be-a-block-device-as.patch index 5f1d636..6c92927 100644 --- a/SOURCES/0019-v2v-Allow-Windows-virtio-ISO-to-be-a-block-device-as.patch +++ b/SOURCES/0019-v2v-Allow-Windows-virtio-ISO-to-be-a-block-device-as.patch @@ -24,5 +24,5 @@ index 92bf3ec60..a6dc29f2c 100644 try -- -2.24.1 +2.25.4 diff --git a/SOURCES/0020-v2v-Set-DISKTYPE-2-in-RHV-and-VDSM-meta-files-RHBZ-1.patch b/SOURCES/0020-v2v-Set-DISKTYPE-2-in-RHV-and-VDSM-meta-files-RHBZ-1.patch index 0e7f62b..7f81ba9 100644 --- a/SOURCES/0020-v2v-Set-DISKTYPE-2-in-RHV-and-VDSM-meta-files-RHBZ-1.patch +++ b/SOURCES/0020-v2v-Set-DISKTYPE-2-in-RHV-and-VDSM-meta-files-RHBZ-1.patch @@ -42,5 +42,5 @@ index 91ff5198d..9aad5dd15 100644 bpf "LEGALITY=LEGAL\n"; bpf "POOL_UUID=\n"; -- -2.24.1 +2.25.4 diff --git a/SOURCES/0021-v2v-rhv-upload-plugin-improve-wait-logic-after-final.patch b/SOURCES/0021-v2v-rhv-upload-plugin-improve-wait-logic-after-final.patch index 48f1eff..6f063b4 100644 --- a/SOURCES/0021-v2v-rhv-upload-plugin-improve-wait-logic-after-final.patch +++ b/SOURCES/0021-v2v-rhv-upload-plugin-improve-wait-logic-after-final.patch @@ -51,5 +51,5 @@ index 2a950c5ed..4d61a089b 100644 # Write the disk ID file. Only do this on successful completion. with builtins.open(params['diskid_file'], 'w') as fp: -- -2.24.1 +2.25.4 diff --git a/SOURCES/0022-v2v-o-rhv-upload-check-whether-the-cluster-exists.patch b/SOURCES/0022-v2v-o-rhv-upload-check-whether-the-cluster-exists.patch index 41f9370..b01b226 100644 --- a/SOURCES/0022-v2v-o-rhv-upload-check-whether-the-cluster-exists.patch +++ b/SOURCES/0022-v2v-o-rhv-upload-check-whether-the-cluster-exists.patch @@ -57,5 +57,5 @@ index 8d1058d67..cc4224ccd 100644 def list(self, search=None, case_sensitive=False): return [] -- -2.24.1 +2.25.4 diff --git a/SOURCES/0023-v2v-o-rhv-upload-split-vmcheck-out-of-precheck.patch b/SOURCES/0023-v2v-o-rhv-upload-split-vmcheck-out-of-precheck.patch index c231942..0f2c916 100644 --- a/SOURCES/0023-v2v-o-rhv-upload-split-vmcheck-out-of-precheck.patch +++ b/SOURCES/0023-v2v-o-rhv-upload-split-vmcheck-out-of-precheck.patch @@ -260,5 +260,5 @@ index 000000000..fbb884b94 + +# Otherwise everything is OK, exit with no error. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0024-v2v-o-rhv-upload-change-precheck-script-to-return-a-.patch b/SOURCES/0024-v2v-o-rhv-upload-change-precheck-script-to-return-a-.patch index c86a6cd..60862e1 100644 --- a/SOURCES/0024-v2v-o-rhv-upload-change-precheck-script-to-return-a-.patch +++ b/SOURCES/0024-v2v-o-rhv-upload-change-precheck-script-to-return-a-.patch @@ -49,5 +49,5 @@ index d6a58f0fc..de8a66c05 100644 + +json.dump(results, sys.stdout) -- -2.24.1 +2.25.4 diff --git a/SOURCES/0025-v2v-o-rhv-upload-improve-lookup-of-specified-resourc.patch b/SOURCES/0025-v2v-o-rhv-upload-improve-lookup-of-specified-resourc.patch index 75e2a6b..0560c10 100644 --- a/SOURCES/0025-v2v-o-rhv-upload-improve-lookup-of-specified-resourc.patch +++ b/SOURCES/0025-v2v-o-rhv-upload-improve-lookup-of-specified-resourc.patch @@ -165,5 +165,5 @@ index de8a66c05..725a8dc9e 100644 json.dump(results, sys.stdout) -- -2.24.1 +2.25.4 diff --git a/SOURCES/0026-v2v-o-rhv-upload-tell-whether-a-SD-actually-exists.patch b/SOURCES/0026-v2v-o-rhv-upload-tell-whether-a-SD-actually-exists.patch index e14154f..b2235af 100644 --- a/SOURCES/0026-v2v-o-rhv-upload-tell-whether-a-SD-actually-exists.patch +++ b/SOURCES/0026-v2v-o-rhv-upload-tell-whether-a-SD-actually-exists.patch @@ -32,5 +32,5 @@ index 725a8dc9e..1b344ba27 100644 # (shouldn't happen, would fail on disk creation). raise RuntimeError("The storage domain ‘%s’ is not attached to a DC" % -- -2.24.1 +2.25.4 diff --git a/SOURCES/0027-v2v-add-output-disk_copied-hook.patch b/SOURCES/0027-v2v-add-output-disk_copied-hook.patch index d5a0110..ed609b4 100644 --- a/SOURCES/0027-v2v-add-output-disk_copied-hook.patch +++ b/SOURCES/0027-v2v-add-output-disk_copied-hook.patch @@ -72,5 +72,5 @@ index 277d8f2c7..63e809030 100644 (* Update the target_actual_size field in the target structure. *) -- -2.24.1 +2.25.4 diff --git a/SOURCES/0028-v2v-o-rhv-upload-collect-disks-UUIDs-right-after-cop.patch b/SOURCES/0028-v2v-o-rhv-upload-collect-disks-UUIDs-right-after-cop.patch index e3426b5..1040341 100644 --- a/SOURCES/0028-v2v-o-rhv-upload-collect-disks-UUIDs-right-after-cop.patch +++ b/SOURCES/0028-v2v-o-rhv-upload-collect-disks-UUIDs-right-after-cop.patch @@ -80,5 +80,5 @@ index 19bdfcf05..382ad0d93 100644 let ovf = DOM.doc_to_string ovf in -- -2.24.1 +2.25.4 diff --git a/SOURCES/0029-v2v-o-rhv-upload-add-oo-rhv-disk-uuid-option.patch b/SOURCES/0029-v2v-o-rhv-upload-add-oo-rhv-disk-uuid-option.patch index 350a44e..fc7c385 100644 --- a/SOURCES/0029-v2v-o-rhv-upload-add-oo-rhv-disk-uuid-option.patch +++ b/SOURCES/0029-v2v-o-rhv-upload-add-oo-rhv-disk-uuid-option.patch @@ -197,5 +197,5 @@ index 651f61dae..e840ca78d 100644 If this option is given then virt-v2v will attempt to directly upload -- -2.24.1 +2.25.4 diff --git a/SOURCES/0030-v2v-o-rhv-upload-make-oo-rhv-cafile-optional.patch b/SOURCES/0030-v2v-o-rhv-upload-make-oo-rhv-cafile-optional.patch index 6f6de40..38d803d 100644 --- a/SOURCES/0030-v2v-o-rhv-upload-make-oo-rhv-cafile-optional.patch +++ b/SOURCES/0030-v2v-o-rhv-upload-make-oo-rhv-cafile-optional.patch @@ -83,5 +83,5 @@ index e840ca78d..04a894268 100644 Set the RHV Cluster Name. If not given it uses C. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0031-v2v-Fix-default-graphics-driver-for-SUSE-guests.patch b/SOURCES/0031-v2v-Fix-default-graphics-driver-for-SUSE-guests.patch index b59226b..47694b3 100644 --- a/SOURCES/0031-v2v-Fix-default-graphics-driver-for-SUSE-guests.patch +++ b/SOURCES/0031-v2v-Fix-default-graphics-driver-for-SUSE-guests.patch @@ -36,5 +36,5 @@ index b4b2f24c4..f9e811c8d 100644 let video_driver = match video with QXL -> "qxl" | Cirrus -> "cirrus" in -- -2.24.1 +2.25.4 diff --git a/SOURCES/0032-v2v-windows-Add-a-helper-function-for-installing-Pow.patch b/SOURCES/0032-v2v-windows-Add-a-helper-function-for-installing-Pow.patch index 2de879a..da0c9aa 100644 --- a/SOURCES/0032-v2v-windows-Add-a-helper-function-for-installing-Pow.patch +++ b/SOURCES/0032-v2v-windows-Add-a-helper-function-for-installing-Pow.patch @@ -69,5 +69,5 @@ index 016ef2a78..6db7874b0 100644 + Powershell script (the lines of code) as a firstboot script in + the Windows VM. *) -- -2.24.1 +2.25.4 diff --git a/SOURCES/0033-v2v-Copy-static-IP-address-information-over-for-Wind.patch b/SOURCES/0033-v2v-Copy-static-IP-address-information-over-for-Wind.patch index 71b2720..62740d1 100644 --- a/SOURCES/0033-v2v-Copy-static-IP-address-information-over-for-Wind.patch +++ b/SOURCES/0033-v2v-Copy-static-IP-address-information-over-for-Wind.patch @@ -419,5 +419,5 @@ index 9a555c3be..0642d158f 100644 =item B<--machine-readable>=format -- -2.24.1 +2.25.4 diff --git a/SOURCES/0034-New-API-luks_uuid.patch b/SOURCES/0034-New-API-luks_uuid.patch index 55535c2..37368da 100644 --- a/SOURCES/0034-New-API-luks_uuid.patch +++ b/SOURCES/0034-New-API-luks_uuid.patch @@ -83,5 +83,5 @@ index 80e3e6eab..055b6671a 100644 -506 +507 -- -2.24.1 +2.25.4 diff --git a/SOURCES/0035-options-Fix-segfault-when-multiple-key-parameters-gi.patch b/SOURCES/0035-options-Fix-segfault-when-multiple-key-parameters-gi.patch index 06dbebd..ed0daf9 100644 --- a/SOURCES/0035-options-Fix-segfault-when-multiple-key-parameters-gi.patch +++ b/SOURCES/0035-options-Fix-segfault-when-multiple-key-parameters-gi.patch @@ -43,5 +43,5 @@ index 7f689866b..f783066ff 100644 error (EXIT_FAILURE, errno, "realloc"); -- -2.24.1 +2.25.4 diff --git a/SOURCES/0036-options-Simplify-selector-parsing-for-key-options.patch b/SOURCES/0036-options-Simplify-selector-parsing-for-key-options.patch index c7de53d..a157bbf 100644 --- a/SOURCES/0036-options-Simplify-selector-parsing-for-key-options.patch +++ b/SOURCES/0036-options-Simplify-selector-parsing-for-key-options.patch @@ -81,5 +81,5 @@ index f783066ff..74b549731 100644 error (EXIT_FAILURE, errno, "strdup"); break; -- -2.24.1 +2.25.4 diff --git a/SOURCES/0037-options-Allow-multiple-key-parameters.patch b/SOURCES/0037-options-Allow-multiple-key-parameters.patch index 0f4f23f..080c6c4 100644 --- a/SOURCES/0037-options-Allow-multiple-key-parameters.patch +++ b/SOURCES/0037-options-Allow-multiple-key-parameters.patch @@ -177,5 +177,5 @@ index 6fadf1e76..510e8a8a9 100644 extern struct key_store *key_store_import_key (struct key_store *ks, const struct key_store_key *key); extern void free_key_store (struct key_store *ks); -- -2.24.1 +2.25.4 diff --git a/SOURCES/0038-options-rename-key.device-as-key.id.patch b/SOURCES/0038-options-rename-key.device-as-key.id.patch index 6bb34c7..667cdf5 100644 --- a/SOURCES/0038-options-rename-key.device-as-key.id.patch +++ b/SOURCES/0038-options-rename-key.device-as-key.id.patch @@ -433,5 +433,5 @@ index 0642d158f..8c2867814 100644 Read the passphrase from F. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0039-options-allow-a-UUID-as-identifier-for-key.patch b/SOURCES/0039-options-allow-a-UUID-as-identifier-for-key.patch index 68fa58c..9b3fc9c 100644 --- a/SOURCES/0039-options-allow-a-UUID-as-identifier-for-key.patch +++ b/SOURCES/0039-options-allow-a-UUID-as-identifier-for-key.patch @@ -309,5 +309,5 @@ index 8c2867814..25041d0ec 100644 =over 4 -- -2.24.1 +2.25.4 diff --git a/SOURCES/0040-docs-remove-paragraph-about-VMware-tools-on-Windows-.patch b/SOURCES/0040-docs-remove-paragraph-about-VMware-tools-on-Windows-.patch index 70f6ff0..e94bcd6 100644 --- a/SOURCES/0040-docs-remove-paragraph-about-VMware-tools-on-Windows-.patch +++ b/SOURCES/0040-docs-remove-paragraph-about-VMware-tools-on-Windows-.patch @@ -78,5 +78,5 @@ index 3acdd773e..16ddb045f 100644 The libvirt URI of a vCenter server looks something like this: -- -2.24.1 +2.25.4 diff --git a/SOURCES/0041-mlcustomize-Trim-whitespaces-from-commands-read-from.patch b/SOURCES/0041-mlcustomize-Trim-whitespaces-from-commands-read-from.patch index c37e2f4..2d9be80 100644 --- a/SOURCES/0041-mlcustomize-Trim-whitespaces-from-commands-read-from.patch +++ b/SOURCES/0041-mlcustomize-Trim-whitespaces-from-commands-read-from.patch @@ -25,5 +25,5 @@ index c278347c1..0b256e2d2 100644 fun line -> String.length line > 0 && line.[0] <> '#' -- -2.24.1 +2.25.4 diff --git a/SOURCES/0042-openstack-Increase-Cinder-volume-attach-timeout-to-5.patch b/SOURCES/0042-openstack-Increase-Cinder-volume-attach-timeout-to-5.patch index 1fb3f3e..651d86d 100644 --- a/SOURCES/0042-openstack-Increase-Cinder-volume-attach-timeout-to-5.patch +++ b/SOURCES/0042-openstack-Increase-Cinder-volume-attach-timeout-to-5.patch @@ -39,5 +39,5 @@ index d187f1d5d..bebf9af18 100644 attach_timeout (fun () -> -- -2.24.1 +2.25.4 diff --git a/SOURCES/0043-v2v-o-rhv-upload-check-for-a-valid-image-transfer-ri.patch b/SOURCES/0043-v2v-o-rhv-upload-check-for-a-valid-image-transfer-ri.patch index b309cdf..397077e 100644 --- a/SOURCES/0043-v2v-o-rhv-upload-check-for-a-valid-image-transfer-ri.patch +++ b/SOURCES/0043-v2v-o-rhv-upload-check-for-a-valid-image-transfer-ri.patch @@ -31,5 +31,5 @@ index 6ec74a5d4..7f62b4e3b 100644 # Now we have permission to start the transfer. if params['rhv_direct']: -- -2.24.1 +2.25.4 diff --git a/SOURCES/0044-rhv-upload-Check-status-more-frequently.patch b/SOURCES/0044-rhv-upload-Check-status-more-frequently.patch index 4eefc88..350f32b 100644 --- a/SOURCES/0044-rhv-upload-Check-status-more-frequently.patch +++ b/SOURCES/0044-rhv-upload-Check-status-more-frequently.patch @@ -45,5 +45,5 @@ index 7f62b4e3b..f13405df1 100644 # Now we have permission to start the transfer. if params['rhv_direct']: -- -2.24.1 +2.25.4 diff --git a/SOURCES/0045-rhv-upload-Show-transfer-id-in-error-message.patch b/SOURCES/0045-rhv-upload-Show-transfer-id-in-error-message.patch index 61b35e6..68b32cb 100644 --- a/SOURCES/0045-rhv-upload-Show-transfer-id-in-error-message.patch +++ b/SOURCES/0045-rhv-upload-Show-transfer-id-in-error-message.patch @@ -27,5 +27,5 @@ index f13405df1..9b83d1cfa 100644 # Now we have permission to start the transfer. -- -2.24.1 +2.25.4 diff --git a/SOURCES/0046-rhv-upload-Fix-waiting-for-transfer.patch b/SOURCES/0046-rhv-upload-Fix-waiting-for-transfer.patch index 575b378..cc6fd5b 100644 --- a/SOURCES/0046-rhv-upload-Fix-waiting-for-transfer.patch +++ b/SOURCES/0046-rhv-upload-Fix-waiting-for-transfer.patch @@ -85,5 +85,5 @@ index 9b83d1cfa..14d4e37fb 100644 # Now we have permission to start the transfer. if params['rhv_direct']: -- -2.24.1 +2.25.4 diff --git a/SOURCES/0047-v2v-Optimize-convert-for-images-with-small-holes.patch b/SOURCES/0047-v2v-Optimize-convert-for-images-with-small-holes.patch index 400401e..e09d484 100644 --- a/SOURCES/0047-v2v-Optimize-convert-for-images-with-small-holes.patch +++ b/SOURCES/0047-v2v-Optimize-convert-for-images-with-small-holes.patch @@ -80,5 +80,5 @@ index d7a868659..a81a2320a 100644 let start_time = gettimeofday () in if run_command cmd <> 0 then -- -2.24.1 +2.25.4 diff --git a/SOURCES/0048-v2v-o-rhv-upload-Make-oo-rhv-cafile-optional-in-all-.patch b/SOURCES/0048-v2v-o-rhv-upload-Make-oo-rhv-cafile-optional-in-all-.patch index adf223a..c18d6c9 100644 --- a/SOURCES/0048-v2v-o-rhv-upload-Make-oo-rhv-cafile-optional-in-all-.patch +++ b/SOURCES/0048-v2v-o-rhv-upload-Make-oo-rhv-cafile-optional-in-all-.patch @@ -45,5 +45,5 @@ index 04a894268..4520c9184 100644 =item I<-oo rhv-cluster=>C -- -2.24.1 +2.25.4 diff --git a/SOURCES/0049-docs-Fix-update-crypto-policies-command-RHBZ-1791257.patch b/SOURCES/0049-docs-Fix-update-crypto-policies-command-RHBZ-1791257.patch index 48722fb..378986c 100644 --- a/SOURCES/0049-docs-Fix-update-crypto-policies-command-RHBZ-1791257.patch +++ b/SOURCES/0049-docs-Fix-update-crypto-policies-command-RHBZ-1791257.patch @@ -29,5 +29,5 @@ index 4bb5d2dc2..9fd5065f1 100644 =head2 Test libvirt connection to remote Xen host -- -2.24.1 +2.25.4 diff --git a/SOURCES/0050-add-versioned-directory-for-guest-agent-on-EL8.patch b/SOURCES/0050-add-versioned-directory-for-guest-agent-on-EL8.patch index 4f34a08..e06ddaf 100644 --- a/SOURCES/0050-add-versioned-directory-for-guest-agent-on-EL8.patch +++ b/SOURCES/0050-add-versioned-directory-for-guest-agent-on-EL8.patch @@ -31,5 +31,5 @@ index a6dc29f2c..7be63a316 100644 | "sles" | "suse-based" | "opensuse" -> Some "lp151" | _ -> None in -- -2.24.1 +2.25.4 diff --git a/SOURCES/0051-v2v-fix-path-to-source-when-copying-files-from-guest.patch b/SOURCES/0051-v2v-fix-path-to-source-when-copying-files-from-guest.patch index af269e5..7210464 100644 --- a/SOURCES/0051-v2v-fix-path-to-source-when-copying-files-from-guest.patch +++ b/SOURCES/0051-v2v-fix-path-to-source-when-copying-files-from-guest.patch @@ -37,5 +37,5 @@ index 7be63a316..70f0bf09d 100644 let cmd = sprintf "cd %s && find -L -type f" (quote dir) in let paths = external_command cmd in -- -2.24.1 +2.25.4 diff --git a/SOURCES/0052-v2v-windows-install-QEMU-Guest-Agent-MSI.patch b/SOURCES/0052-v2v-windows-install-QEMU-Guest-Agent-MSI.patch index 27eb48f..2f0b7ae 100644 --- a/SOURCES/0052-v2v-windows-install-QEMU-Guest-Agent-MSI.patch +++ b/SOURCES/0052-v2v-windows-install-QEMU-Guest-Agent-MSI.patch @@ -115,5 +115,5 @@ index ae3b7e865..731dbd6f0 100644 (* The following function is only exported for unit tests. *) -- -2.24.1 +2.25.4 diff --git a/SOURCES/0053-windows-small-tweaks-of-qemu-ga-firstboot-script.patch b/SOURCES/0053-windows-small-tweaks-of-qemu-ga-firstboot-script.patch index 9827b49..70aec69 100644 --- a/SOURCES/0053-windows-small-tweaks-of-qemu-ga-firstboot-script.patch +++ b/SOURCES/0053-windows-small-tweaks-of-qemu-ga-firstboot-script.patch @@ -38,5 +38,5 @@ index bdb0092c3..43c1f85de 100644 Firstboot.add_firstboot_script g inspect.i_root ("install " ^ msi_path) fb_script; -- -2.24.1 +2.25.4 diff --git a/SOURCES/0054-windows-fix-detection-of-qemu-ga-installer-on-RHV.patch b/SOURCES/0054-windows-fix-detection-of-qemu-ga-installer-on-RHV.patch index 1dd44dd..3f307ef 100644 --- a/SOURCES/0054-windows-fix-detection-of-qemu-ga-installer-on-RHV.patch +++ b/SOURCES/0054-windows-fix-detection-of-qemu-ga-installer-on-RHV.patch @@ -39,5 +39,5 @@ index ea7e5c02d..9a7297344 100644 (* The following function is only exported for unit tests. *) -- -2.24.1 +2.25.4 diff --git a/SOURCES/0055-windows-delay-installation-of-qemu-ga-MSI.patch b/SOURCES/0055-windows-delay-installation-of-qemu-ga-MSI.patch index 6e956ea..41d1548 100644 --- a/SOURCES/0055-windows-delay-installation-of-qemu-ga-MSI.patch +++ b/SOURCES/0055-windows-delay-installation-of-qemu-ga-MSI.patch @@ -63,5 +63,5 @@ index 43c1f85de..088cd33d9 100644 ("install " ^ msi_path) fb_script; ) files -- -2.24.1 +2.25.4 diff --git a/SOURCES/0056-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch b/SOURCES/0056-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch deleted file mode 100644 index e458c77..0000000 --- a/SOURCES/0056-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f9ceb4fd65f882c9e6aad6310567ce40d19c4070 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 21 Dec 2012 15:50:11 +0000 -Subject: [PATCH] RHEL 8: Remove libguestfs live (RHBZ#798980). - -This isn't supported in RHEL 8. ---- - lib/launch-unix.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/lib/launch-unix.c b/lib/launch-unix.c -index 4794a7b13..993b83601 100644 ---- a/lib/launch-unix.c -+++ b/lib/launch-unix.c -@@ -37,6 +37,12 @@ - static int - launch_unix (guestfs_h *g, void *datav, const char *sockpath) - { -+ error (g, -+ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" -+ "In particular, \"libguestfs live\" is not supported."); -+ return -1; -+ -+#if 0 - int r, daemon_sock = -1; - struct sockaddr_un addr; - uint32_t size; -@@ -106,6 +112,7 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath) - g->conn = NULL; - } - return -1; -+#endif - } - - static int --- -2.24.1 - diff --git a/SOURCES/0056-daemon-xattr-Refactor-code-which-splits-attr-names-f.patch b/SOURCES/0056-daemon-xattr-Refactor-code-which-splits-attr-names-f.patch new file mode 100644 index 0000000..a998da3 --- /dev/null +++ b/SOURCES/0056-daemon-xattr-Refactor-code-which-splits-attr-names-f.patch @@ -0,0 +1,283 @@ +From 052549a055bbedc402418bc52bcbfa3bfcb97952 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 12 Mar 2020 13:57:06 +0000 +Subject: [PATCH] daemon: xattr: Refactor code which splits attr names from the + kernel. + +The kernel returns xattr names in a slightly peculiar format. We +parsed this format several times in the code. Refactor this parsing +so we only do it in one place. + +(cherry picked from commit 5c175fe73264bbf1d3ef79bb066dfb6aff902ad1) +--- + daemon/xattr.c | 127 ++++++++++++++++++++++++++++++------------------- + 1 file changed, 79 insertions(+), 48 deletions(-) + +diff --git a/daemon/xattr.c b/daemon/xattr.c +index bc5c2df97..3e1144963 100644 +--- a/daemon/xattr.c ++++ b/daemon/xattr.c +@@ -89,6 +89,36 @@ do_lremovexattr (const char *xattr, const char *path) + return _removexattr (xattr, path, lremovexattr); + } + ++/** ++ * L returns the string C<"foo\0bar\0baz"> of length ++ * C. (The last string in the list is \0-terminated but the \0 ++ * is not included in C). ++ * ++ * This function splits it into a regular list of strings. ++ * ++ * B that the returned list contains pointers to the original ++ * strings in C so be careful that you do not double-free them. ++ */ ++static char ** ++split_attr_names (char *buf, size_t len) ++{ ++ size_t i; ++ DECLARE_STRINGSBUF (ret); ++ ++ for (i = 0; i < len; i += strlen (&buf[i]) + 1) { ++ if (add_string_nodup (&ret, &buf[i]) == -1) { ++ free (ret.argv); ++ return NULL; ++ } ++ } ++ if (end_stringsbuf (&ret) == -1) { ++ free (ret.argv); ++ return NULL; ++ } ++ ++ return take_stringsbuf (&ret); ++} ++ + static int + compare_xattrs (const void *vxa1, const void *vxa2) + { +@@ -106,7 +136,8 @@ getxattrs (const char *path, + { + ssize_t len, vlen; + CLEANUP_FREE char *buf = NULL; +- size_t i, j; ++ CLEANUP_FREE /* not string list */ char **names = NULL; ++ size_t i; + guestfs_int_xattr_list *r = NULL; + + buf = _listxattrs (path, listxattr, &len); +@@ -114,18 +145,17 @@ getxattrs (const char *path, + /* _listxattrs issues reply_with_perror already. */ + goto error; + ++ names = split_attr_names (buf, len); ++ if (names == NULL) ++ goto error; ++ + r = calloc (1, sizeof (*r)); + if (r == NULL) { + reply_with_perror ("calloc"); + goto error; + } + +- /* What we get from the kernel is a string "foo\0bar\0baz" of length +- * len. First count the strings. +- */ +- r->guestfs_int_xattr_list_len = 0; +- for (i = 0; i < (size_t) len; i += strlen (&buf[i]) + 1) +- r->guestfs_int_xattr_list_len++; ++ r->guestfs_int_xattr_list_len = guestfs_int_count_strings (names); + + r->guestfs_int_xattr_list_val = + calloc (r->guestfs_int_xattr_list_len, sizeof (guestfs_int_xattr)); +@@ -134,34 +164,34 @@ getxattrs (const char *path, + goto error; + } + +- for (i = 0, j = 0; i < (size_t) len; i += strlen (&buf[i]) + 1, ++j) { ++ for (i = 0; names[i] != NULL; ++i) { + CHROOT_IN; +- vlen = getxattr (path, &buf[i], NULL, 0); ++ vlen = getxattr (path, names[i], NULL, 0); + CHROOT_OUT; + if (vlen == -1) { +- reply_with_perror ("getxattr"); ++ reply_with_perror ("getxattr: %s", names[i]); + goto error; + } + + if (vlen > XATTR_SIZE_MAX) { + /* The next call to getxattr will fail anyway, so ... */ +- reply_with_error ("extended attribute is too large"); ++ reply_with_error ("%s: extended attribute is too large", names[i]); + goto error; + } + +- r->guestfs_int_xattr_list_val[j].attrname = strdup (&buf[i]); +- r->guestfs_int_xattr_list_val[j].attrval.attrval_val = malloc (vlen); +- r->guestfs_int_xattr_list_val[j].attrval.attrval_len = vlen; ++ r->guestfs_int_xattr_list_val[i].attrname = strdup (names[i]); ++ r->guestfs_int_xattr_list_val[i].attrval.attrval_val = malloc (vlen); ++ r->guestfs_int_xattr_list_val[i].attrval.attrval_len = vlen; + +- if (r->guestfs_int_xattr_list_val[j].attrname == NULL || +- r->guestfs_int_xattr_list_val[j].attrval.attrval_val == NULL) { ++ if (r->guestfs_int_xattr_list_val[i].attrname == NULL || ++ r->guestfs_int_xattr_list_val[i].attrval.attrval_val == NULL) { + reply_with_perror ("malloc"); + goto error; + } + + CHROOT_IN; +- vlen = getxattr (path, &buf[i], +- r->guestfs_int_xattr_list_val[j].attrval.attrval_val, ++ vlen = getxattr (path, names[i], ++ r->guestfs_int_xattr_list_val[i].attrval.attrval_val, + vlen); + CHROOT_OUT; + if (vlen == -1) { +@@ -276,7 +306,7 @@ guestfs_int_xattr_list * + do_internal_lxattrlist (const char *path, char *const *names) + { + guestfs_int_xattr_list *ret = NULL; +- size_t i, j; ++ size_t i; + size_t k, m, nr_attrs; + ssize_t len, vlen; + +@@ -293,6 +323,7 @@ do_internal_lxattrlist (const char *path, char *const *names) + void *newptr; + CLEANUP_FREE char *pathname = NULL; + CLEANUP_FREE char *buf = NULL; ++ CLEANUP_FREE /* not string list */ char **attrnames = NULL; + + /* Be careful in this loop about which errors cause the whole call + * to abort, and which errors allow us to continue processing +@@ -350,12 +381,10 @@ do_internal_lxattrlist (const char *path, char *const *names) + if (len == -1) + continue; /* not fatal */ + +- /* What we get from the kernel is a string "foo\0bar\0baz" of length +- * len. First count the strings. +- */ +- nr_attrs = 0; +- for (i = 0; i < (size_t) len; i += strlen (&buf[i]) + 1) +- nr_attrs++; ++ attrnames = split_attr_names (buf, len); ++ if (attrnames == NULL) ++ goto error; ++ nr_attrs = guestfs_int_count_strings (attrnames); + + newptr = + realloc (ret->guestfs_int_xattr_list_val, +@@ -378,36 +407,36 @@ do_internal_lxattrlist (const char *path, char *const *names) + entry[m].attrval.attrval_val = NULL; + } + +- for (i = 0, j = 0; i < (size_t) len; i += strlen (&buf[i]) + 1, ++j) { ++ for (i = 0; attrnames[i] != NULL; ++i) { + CHROOT_IN; +- vlen = lgetxattr (pathname, &buf[i], NULL, 0); ++ vlen = lgetxattr (pathname, attrnames[i], NULL, 0); + CHROOT_OUT; + if (vlen == -1) { +- reply_with_perror ("getxattr"); ++ reply_with_perror ("getxattr: %s", attrnames[i]); + goto error; + } + + if (vlen > XATTR_SIZE_MAX) { +- reply_with_error ("extended attribute is too large"); ++ reply_with_error ("%s: extended attribute is too large", attrnames[i]); + goto error; + } + +- entry[j+1].attrname = strdup (&buf[i]); +- entry[j+1].attrval.attrval_val = malloc (vlen); +- entry[j+1].attrval.attrval_len = vlen; ++ entry[i+1].attrname = strdup (attrnames[i]); ++ entry[i+1].attrval.attrval_val = malloc (vlen); ++ entry[i+1].attrval.attrval_len = vlen; + +- if (entry[j+1].attrname == NULL || +- entry[j+1].attrval.attrval_val == NULL) { ++ if (entry[i+1].attrname == NULL || ++ entry[i+1].attrval.attrval_val == NULL) { + reply_with_perror ("malloc"); + goto error; + } + + CHROOT_IN; +- vlen = lgetxattr (pathname, &buf[i], +- entry[j+1].attrval.attrval_val, vlen); ++ vlen = lgetxattr (pathname, attrnames[i], ++ entry[i+1].attrval.attrval_val, vlen); + CHROOT_OUT; + if (vlen == -1) { +- reply_with_perror ("getxattr"); ++ reply_with_perror ("getxattr: %s", attrnames[i]); + goto error; + } + } +@@ -510,6 +539,7 @@ copy_xattrs (const char *src, const char *dest) + { + ssize_t len, vlen, ret, attrval_len = 0; + CLEANUP_FREE char *buf = NULL, *attrval = NULL; ++ CLEANUP_FREE /* not string list */ char **names = NULL; + size_t i; + + buf = _listxattrs (src, listxattr, &len); +@@ -517,21 +547,22 @@ copy_xattrs (const char *src, const char *dest) + /* _listxattrs issues reply_with_perror already. */ + goto error; + +- /* What we get from the kernel is a string "foo\0bar\0baz" of length +- * len. +- */ +- for (i = 0; i < (size_t) len; i += strlen (&buf[i]) + 1) { ++ names = split_attr_names (buf, len); ++ if (names == NULL) ++ goto error; ++ ++ for (i = 0; names[i] != NULL; ++i) { + CHROOT_IN; +- vlen = getxattr (src, &buf[i], NULL, 0); ++ vlen = getxattr (src, names[i], NULL, 0); + CHROOT_OUT; + if (vlen == -1) { +- reply_with_perror ("getxattr: %s, %s", src, &buf[i]); ++ reply_with_perror ("getxattr: %s, %s", src, names[i]); + goto error; + } + + if (vlen > XATTR_SIZE_MAX) { + /* The next call to getxattr will fail anyway, so ... */ +- reply_with_error ("extended attribute is too large"); ++ reply_with_error ("%s: extended attribute is too large", names[i]); + goto error; + } + +@@ -546,18 +577,18 @@ copy_xattrs (const char *src, const char *dest) + } + + CHROOT_IN; +- vlen = getxattr (src, &buf[i], attrval, vlen); ++ vlen = getxattr (src, names[i], attrval, vlen); + CHROOT_OUT; + if (vlen == -1) { +- reply_with_perror ("getxattr: %s, %s", src, &buf[i]); ++ reply_with_perror ("getxattr: %s, %s", src, names[i]); + goto error; + } + + CHROOT_IN; +- ret = setxattr (dest, &buf[i], attrval, vlen, 0); ++ ret = setxattr (dest, names[i], attrval, vlen, 0); + CHROOT_OUT; + if (ret == -1) { +- reply_with_perror ("setxattr: %s, %s", dest, &buf[i]); ++ reply_with_perror ("setxattr: %s, %s", dest, names[i]); + goto error; + } + } +-- +2.25.4 + diff --git a/SOURCES/0057-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch b/SOURCES/0057-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch deleted file mode 100644 index d8d37fd..0000000 --- a/SOURCES/0057-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch +++ /dev/null @@ -1,372 +0,0 @@ -From 468bfa7cb5db1294310c0193e51bc5a20092f4ce Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 18 Jul 2013 18:31:53 +0100 -Subject: [PATCH] RHEL 8: Remove 9p APIs from RHEL (RHBZ#921710). - ---- - Makefile.am | 2 +- - daemon/9p.c | 224 -------------------------------------- - daemon/Makefile.am | 1 - - docs/C_SOURCE_FILES | 1 - - generator/actions_core.ml | 21 ---- - generator/proc_nr.ml | 2 - - gobject/Makefile.inc | 2 - - po/POTFILES | 2 - - 8 files changed, 1 insertion(+), 254 deletions(-) - delete mode 100644 daemon/9p.c - -diff --git a/Makefile.am b/Makefile.am -index 0067d7b7b..e9351eadc 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -78,7 +78,7 @@ SUBDIRS += tests/xfs - SUBDIRS += tests/charsets - SUBDIRS += tests/xml - SUBDIRS += tests/mount-local --SUBDIRS += tests/9p -+#SUBDIRS += tests/9p - SUBDIRS += tests/rsync - SUBDIRS += tests/bigdirs - SUBDIRS += tests/disk-labels -diff --git a/daemon/9p.c b/daemon/9p.c -deleted file mode 100644 -index 55644249d..000000000 ---- a/daemon/9p.c -+++ /dev/null -@@ -1,224 +0,0 @@ --/* libguestfs - the guestfsd daemon -- * Copyright (C) 2011 Red Hat Inc. -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- */ -- --#include -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include "daemon.h" --#include "actions.h" -- --#define BUS_PATH "/sys/bus/virtio/drivers/9pnet_virtio" -- --static char *read_whole_file (const char *filename); -- --/* https://bugzilla.redhat.com/show_bug.cgi?id=714981#c1 */ --char ** --do_list_9p (void) --{ -- CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (r); -- -- DIR *dir; -- -- dir = opendir (BUS_PATH); -- if (!dir) { -- perror ("opendir: " BUS_PATH); -- if (errno != ENOENT) { -- reply_with_perror ("opendir: " BUS_PATH); -- return NULL; -- } -- -- /* If this directory doesn't exist, it probably means that -- * the virtio driver isn't loaded. Don't return an error -- * in this case, but return an empty list. -- */ -- if (end_stringsbuf (&r) == -1) -- return NULL; -- -- return take_stringsbuf (&r); -- } -- -- while (1) { -- struct dirent *d; -- -- errno = 0; -- d = readdir (dir); -- if (d == NULL) break; -- -- if (STRPREFIX (d->d_name, "virtio")) { -- CLEANUP_FREE char *mount_tag_path = NULL; -- if (asprintf (&mount_tag_path, BUS_PATH "/%s/mount_tag", -- d->d_name) == -1) { -- reply_with_perror ("asprintf"); -- closedir (dir); -- return NULL; -- } -- -- /* A bit unclear, but it looks like the virtio transport allows -- * the mount tag length to be unlimited (or up to 65536 bytes). -- * See: linux/include/linux/virtio_9p.h -- */ -- CLEANUP_FREE char *mount_tag = read_whole_file (mount_tag_path); -- if (mount_tag == 0) -- continue; -- -- if (add_string (&r, mount_tag) == -1) { -- closedir (dir); -- return NULL; -- } -- } -- } -- -- /* Check readdir didn't fail */ -- if (errno != 0) { -- reply_with_perror ("readdir: /sys/block"); -- closedir (dir); -- return NULL; -- } -- -- /* Close the directory handle */ -- if (closedir (dir) == -1) { -- reply_with_perror ("closedir: /sys/block"); -- return NULL; -- } -- -- /* Sort the tags. */ -- if (r.size > 0) -- sort_strings (r.argv, r.size); -- -- /* NULL terminate the list */ -- if (end_stringsbuf (&r) == -1) -- return NULL; -- -- return take_stringsbuf (&r); --} -- --/* Read whole file into dynamically allocated array. If there is an -- * error, DON'T call reply_with_perror, just return NULL. Returns a -- * \0-terminated string. -- */ --static char * --read_whole_file (const char *filename) --{ -- char *r = NULL; -- size_t alloc = 0, size = 0; -- int fd; -- -- fd = open (filename, O_RDONLY|O_CLOEXEC); -- if (fd == -1) { -- perror (filename); -- return NULL; -- } -- -- while (1) { -- alloc += 256; -- char *r2 = realloc (r, alloc); -- if (r2 == NULL) { -- perror ("realloc"); -- free (r); -- close (fd); -- return NULL; -- } -- r = r2; -- -- /* The '- 1' in the size calculation ensures there is space below -- * to add \0 to the end of the input. -- */ -- ssize_t n = read (fd, r + size, alloc - size - 1); -- if (n == -1) { -- fprintf (stderr, "read: %s: %m\n", filename); -- free (r); -- close (fd); -- return NULL; -- } -- if (n == 0) -- break; -- size += n; -- } -- -- if (close (fd) == -1) { -- fprintf (stderr, "close: %s: %m\n", filename); -- free (r); -- return NULL; -- } -- -- r[size] = '\0'; -- -- return r; --} -- --/* Takes optional arguments, consult optargs_bitmask. */ --int --do_mount_9p (const char *mount_tag, const char *mountpoint, const char *options) --{ -- CLEANUP_FREE char *mp = NULL, *opts = NULL, *err = NULL; -- struct stat statbuf; -- int r; -- -- ABS_PATH (mountpoint, 0, return -1); -- -- mp = sysroot_path (mountpoint); -- if (!mp) { -- reply_with_perror ("malloc"); -- return -1; -- } -- -- /* Check the mountpoint exists and is a directory. */ -- if (stat (mp, &statbuf) == -1) { -- reply_with_perror ("%s", mountpoint); -- return -1; -- } -- if (!S_ISDIR (statbuf.st_mode)) { -- reply_with_perror ("%s: mount point is not a directory", mountpoint); -- return -1; -- } -- -- /* Add trans=virtio to the options. */ -- if ((optargs_bitmask & GUESTFS_MOUNT_9P_OPTIONS_BITMASK) && -- STRNEQ (options, "")) { -- if (asprintf (&opts, "trans=virtio,%s", options) == -1) { -- reply_with_perror ("asprintf"); -- return -1; -- } -- } -- else { -- opts = strdup ("trans=virtio"); -- if (opts == NULL) { -- reply_with_perror ("strdup"); -- return -1; -- } -- } -- -- r = command (NULL, &err, -- "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); -- if (r == -1) { -- reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); -- return -1; -- } -- -- return 0; --} -diff --git a/daemon/Makefile.am b/daemon/Makefile.am -index 5d1c222db..a9b40be25 100644 ---- a/daemon/Makefile.am -+++ b/daemon/Makefile.am -@@ -76,7 +76,6 @@ guestfsd_SOURCES = \ - ../common/protocol/guestfs_protocol.h \ - ../common/utils/cleanups.h \ - ../common/utils/guestfs-utils.h \ -- 9p.c \ - acl.c \ - actions.h \ - available.c \ -diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES -index 7f1c60b30..f45e7124d 100644 ---- a/docs/C_SOURCE_FILES -+++ b/docs/C_SOURCE_FILES -@@ -71,7 +71,6 @@ common/windows/windows.h - customize/crypt-c.c - customize/dummy.c - customize/perl_edit-c.c --daemon/9p.c - daemon/acl.c - daemon/actions.h - daemon/augeas.c -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index deda483a9..f466600df 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -6167,27 +6167,6 @@ This returns true iff the device exists and contains all zero bytes. - - Note that for large devices this can take a long time to run." }; - -- { defaults with -- name = "list_9p"; added = (1, 11, 12); -- style = RStringList (RPlainString, "mounttags"), [], []; -- shortdesc = "list 9p filesystems"; -- longdesc = "\ --List all 9p filesystems attached to the guest. A list of --mount tags is returned." }; -- -- { defaults with -- name = "mount_9p"; added = (1, 11, 12); -- style = RErr, [String (PlainString, "mounttag"); String (PlainString, "mountpoint")], [OString "options"]; -- camel_name = "Mount9P"; -- shortdesc = "mount 9p filesystem"; -- longdesc = "\ --Mount the virtio-9p filesystem with the tag C on the --directory C. -- --If required, C will be automatically added to the options. --Any other options required can be passed in the optional C --parameter." }; -- - { defaults with - name = "list_dm_devices"; added = (1, 11, 15); - style = RStringList (RDevice, "devices"), [], []; -diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml -index 11a557076..1ef5ba0b7 100644 ---- a/generator/proc_nr.ml -+++ b/generator/proc_nr.ml -@@ -295,8 +295,6 @@ let proc_nr = [ - 282, "internal_autosync"; - 283, "is_zero"; - 284, "is_zero_device"; --285, "list_9p"; --286, "mount_9p"; - 287, "list_dm_devices"; - 288, "ntfsresize"; - 289, "btrfs_filesystem_resize"; -diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc -index 067f861a9..7afe83c59 100644 ---- a/gobject/Makefile.inc -+++ b/gobject/Makefile.inc -@@ -93,7 +93,6 @@ guestfs_gobject_headers= \ - include/guestfs-gobject/optargs-mksquashfs.h \ - include/guestfs-gobject/optargs-mkswap.h \ - include/guestfs-gobject/optargs-mktemp.h \ -- include/guestfs-gobject/optargs-mount_9p.h \ - include/guestfs-gobject/optargs-mount_local.h \ - include/guestfs-gobject/optargs-ntfsclone_out.h \ - include/guestfs-gobject/optargs-ntfsfix.h \ -@@ -186,7 +185,6 @@ guestfs_gobject_sources= \ - src/optargs-mksquashfs.c \ - src/optargs-mkswap.c \ - src/optargs-mktemp.c \ -- src/optargs-mount_9p.c \ - src/optargs-mount_local.c \ - src/optargs-ntfsclone_out.c \ - src/optargs-ntfsfix.c \ -diff --git a/po/POTFILES b/po/POTFILES -index 79f4b8c56..b99333d0d 100644 ---- a/po/POTFILES -+++ b/po/POTFILES -@@ -58,7 +58,6 @@ customize/crypt-c.c - customize/dummy.c - customize/perl_edit-c.c - customize/test-password.pl --daemon/9p.c - daemon/acl.c - daemon/augeas.c - daemon/available.c -@@ -291,7 +290,6 @@ gobject/src/optargs-mkfs_btrfs.c - gobject/src/optargs-mksquashfs.c - gobject/src/optargs-mkswap.c - gobject/src/optargs-mktemp.c --gobject/src/optargs-mount_9p.c - gobject/src/optargs-mount_local.c - gobject/src/optargs-ntfsclone_out.c - gobject/src/optargs-ntfsfix.c --- -2.24.1 - diff --git a/SOURCES/0057-daemon-Add-filter_list-utility-function.patch b/SOURCES/0057-daemon-Add-filter_list-utility-function.patch new file mode 100644 index 0000000..db1e1d8 --- /dev/null +++ b/SOURCES/0057-daemon-Add-filter_list-utility-function.patch @@ -0,0 +1,84 @@ +From 1c976cc5d1add98eee09c38ac8e01634c94f3778 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 12 Mar 2020 13:59:05 +0000 +Subject: [PATCH] daemon: Add filter_list utility function. + +For filtering lists of strings based on a predicate. + +(cherry picked from commit af8ed266a282bb20882a9ffb611bd64243d19218) +--- + daemon/daemon.h | 2 ++ + daemon/utils.c | 30 ++++++++++++++++++++++++++++++ + 2 files changed, 32 insertions(+) + +diff --git a/daemon/daemon.h b/daemon/daemon.h +index 66bfdc49e..115591728 100644 +--- a/daemon/daemon.h ++++ b/daemon/daemon.h +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -74,6 +75,7 @@ extern void free_stringsbuf (struct stringsbuf *sb); + extern struct stringsbuf split_lines_sb (char *str); + extern char **split_lines (char *str); + extern char **empty_list (void); ++extern char **filter_list (bool (*p) (const char *), char **strs); + extern int is_power_of_2 (unsigned long v); + extern void trim (char *str); + extern int parse_btrfsvol (const char *desc, mountable_t *mountable); +diff --git a/daemon/utils.c b/daemon/utils.c +index c3f88bcab..e87233d0f 100644 +--- a/daemon/utils.c ++++ b/daemon/utils.c +@@ -24,6 +24,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -482,6 +483,35 @@ empty_list (void) + return ret.argv; + } + ++/** ++ * Filter a list of strings. Returns a newly allocated list of only ++ * the strings where C

. ++ * ++ * B it does not copy the strings, be careful not to double-free ++ * them. ++ */ ++char ** ++filter_list (bool (*p) (const char *str), char **strs) ++{ ++ DECLARE_STRINGSBUF (ret); ++ size_t i; ++ ++ for (i = 0; strs[i] != NULL; ++i) { ++ if (p (strs[i])) { ++ if (add_string_nodup (&ret, strs[i]) == -1) { ++ free (ret.argv); ++ return NULL; ++ } ++ } ++ } ++ if (end_stringsbuf (&ret) == -1) { ++ free (ret.argv); ++ return NULL; ++ } ++ ++ return take_stringsbuf (&ret); ++} ++ + /** + * Skip leading and trailing whitespace, updating the original string + * in-place. +-- +2.25.4 + diff --git a/SOURCES/0058-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch b/SOURCES/0058-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch deleted file mode 100644 index 0e9b8d4..0000000 --- a/SOURCES/0058-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch +++ /dev/null @@ -1,609 +0,0 @@ -From d20dddb121c5f367cbec71639a64c4fca6737bf2 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 29 Jul 2013 14:47:56 +0100 -Subject: [PATCH] RHEL 8: Disable unsupported remote drive protocols - (RHBZ#962113). - -This disables support for unsupported remote drive protocols: - - * ftp - * ftps - * http - * https - * tftp - * gluster - * iscsi - * sheepdog - * ssh - -Note 'nbd' is not disabled, and of course 'file' works. - -We hope to gradually add some of these back over the lifetime of RHEL 8. ---- - docs/guestfs-testing.pod | 20 ----- - fish/guestfish.pod | 66 ++-------------- - fish/test-add-uri.sh | 32 -------- - generator/actions_core.ml | 50 +------------ - lib/drives.c | 8 ++ - lib/guestfs.pod | 100 ------------------------- - tests/disks/test-qemu-drive-libvirt.sh | 28 ------- - tests/disks/test-qemu-drive.sh | 60 --------------- - 8 files changed, 16 insertions(+), 348 deletions(-) - -diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod -index f558964bf..8f264ed17 100644 ---- a/docs/guestfs-testing.pod -+++ b/docs/guestfs-testing.pod -@@ -109,26 +109,6 @@ image. To exit, type C. - If you get an error, try enabling debugging (add C<-v> to the command - line). Also make sure that L succeeds. - --=head2 Try to open a remote guest image with guestfish. -- --You may also have to disable libvirt by setting this: -- -- export LIBGUESTFS_BACKEND=direct -- --If you have a disk image available over HTTP/FTP, try to open it. -- -- guestfish --ro -i --format=raw -a http://www.example.com/disk.img -- --For SSH you will need to make sure that ssh-agent is set up so you --don't need a password to log in to the remote machine. Then a command --similar to this should work: -- -- guestfish --ro -i --format=raw \ -- -a ssh://remote.example.com/path/to/disk.img -- --If you get an error, try enabling debugging (add C<-v> to the command --line). Also make sure that L succeeds. -- - =head2 Run virt-alignment-scan on all your guests. - - Run L on guests or disk images: -diff --git a/fish/guestfish.pod b/fish/guestfish.pod -index f1fdf094d..bacb60e0b 100644 ---- a/fish/guestfish.pod -+++ b/fish/guestfish.pod -@@ -131,9 +131,9 @@ To list what is available do: - - =head2 Remote drives - --Access a remote disk using ssh: -+Access a remote disk using NBD: - -- guestfish -a ssh://example.com/path/to/disk.img -+ guestfish -a nbd://example.com - - =head2 Remote control - -@@ -1145,12 +1145,12 @@ L>. - On the command line, you can use the I<-a> option to add network - block devices using a URI-style format, for example: - -- guestfish -a ssh://root@example.com/disk.img -+ guestfish -a nbd://example.com - - URIs I be used with the L command. The equivalent - command using the API directly is: - -- > add /disk.img protocol:ssh server:tcp:example.com username:root -+ > add /disk.img protocol:nbd server:tcp:example.com - - The possible I<-a URI> formats are described below. - -@@ -1160,40 +1160,6 @@ The possible I<-a URI> formats are described below. - - Add the local disk image (or device) called F. - --=head2 B<-a ftp://[user@]example.com[:port]/disk.img> -- --=head2 B<-a ftps://[user@]example.com[:port]/disk.img> -- --=head2 B<-a http://[user@]example.com[:port]/disk.img> -- --=head2 B<-a https://[user@]example.com[:port]/disk.img> -- --=head2 B<-a tftp://[user@]example.com[:port]/disk.img> -- --Add a disk located on a remote FTP, HTTP or TFTP server. -- --The equivalent API command would be: -- -- > add /disk.img protocol:(ftp|...) server:tcp:example.com -- --=head2 B<-a gluster://example.com[:port]/volname/image> -- --Add a disk image located on GlusterFS storage. -- --The server is the one running C, and may be C. -- --The equivalent API command would be: -- -- > add volname/image protocol:gluster server:tcp:example.com -- --=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]> -- --Add a disk located on an iSCSI server. -- --The equivalent API command would be: -- -- > add target-iqn-name/lun protocol:iscsi server:tcp:example.com -- - =head2 B<-a nbd://example.com[:port]> - - =head2 B<-a nbd://example.com[:port]/exportname> -@@ -1228,35 +1194,13 @@ The equivalent API command would be: - - > add pool/disk protocol:rbd server:tcp:example.com:port - --=head2 B<-a sheepdog://[example.com[:port]]/volume/image> -- --Add a disk image located on a Sheepdog volume. -- --The server name is optional. Although libguestfs and Sheepdog --supports multiple servers, only at most one server can be specified --when using this URI syntax. -- --The equivalent API command would be: -- -- > add volume protocol:sheepdog [server:tcp:example.com] -- --=head2 B<-a ssh://[user@]example.com[:port]/disk.img> -- --Add a disk image located on a remote server, accessed using the Secure --Shell (ssh) SFTP protocol. SFTP is supported out of the box by all --major SSH servers. -- --The equivalent API command would be: -- -- > add /disk protocol:ssh server:tcp:example.com [username:user] -- - Note that the URIs follow the syntax of - L: in particular, there - are restrictions on the allowed characters for the various components - of the URI. Characters such as C<:>, C<@>, and C B be - percent-encoded: - -- $ guestfish -a ssh://user:pass%40word@example.com/disk.img -+ $ guestfish -a rbd://user:pass%40word@example.com[:port]/pool/disk - - In this case, the password is C. - -diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh -index 756df997b..8f84fd31b 100755 ---- a/fish/test-add-uri.sh -+++ b/fish/test-add-uri.sh -@@ -40,14 +40,6 @@ function fail () - $VG guestfish -x -a file://$abs_builddir/test-add-uri.img test-add-uri.out 2>&1 - grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail - --# curl --$VG guestfish -x -a ftp://user@example.com/disk.img test-add-uri.out 2>&1 --grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail -- --# gluster --$VG guestfish -x -a gluster://example.com/disk test-add-uri.out 2>&1 --grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail -- - # NBD - $VG guestfish -x -a nbd://example.com test-add-uri.out 2>&1 - grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail -@@ -67,29 +59,5 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te - $VG guestfish -x -a rbd:///pool/disk test-add-uri.out 2>&1 - grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail - --# sheepdog --$VG guestfish -x -a sheepdog:///volume/image test-add-uri.out 2>&1 --grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail -- --$VG guestfish -x -a sheepdog://example.com:3000/volume/image test-add-uri.out 2>&1 --grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail -- --# ssh --$VG guestfish -x -a ssh://example.com/disk.img test-add-uri.out 2>&1 --grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail -- --$VG guestfish -x -a ssh://user@example.com/disk.img test-add-uri.out 2>&1 --grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail -- --$VG guestfish -x -a ssh://user@example.com:2000/disk.img test-add-uri.out 2>&1 --grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail -- --# iSCSI --$VG guestfish -x -a iscsi://example.com/iqn.2015-12.com.libguestfs:test1/0 test-add-uri.out 2>&1 --grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test1/0" "protocol:iscsi" "server:tcp:example.com"' test-add-uri.out || fail -- --$VG guestfish -x -a iscsi://user:password@example.com/iqn.2015-12.com.libguestfs:test2/0 test-add-uri.out 2>&1 --grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test2/0" "protocol:iscsi" "server:tcp:example.com" "username:user" "secret:password"' test-add-uri.out || fail -- - rm test-add-uri.out - rm test-add-uri.img -diff --git a/generator/actions_core.ml b/generator/actions_core.ml -index f466600df..3893d0e8d 100644 ---- a/generator/actions_core.ml -+++ b/generator/actions_core.ml -@@ -297,29 +297,6 @@ F is interpreted as a local file or device. - This is the default if the optional protocol parameter - is omitted. - --=item C -- --Connect to a remote FTP, HTTP or TFTP server. --The C parameter must also be supplied - see below. -- --See also: L -- --=item C -- --Connect to the GlusterFS server. --The C parameter must also be supplied - see below. -- --See also: L -- --=item C -- --Connect to the iSCSI server. --The C parameter must also be supplied - see below. --The C parameter may be supplied. See below. --The C parameter may be supplied. See below. -- --See also: L. -- - =item C - - Connect to the Network Block Device server. -@@ -336,22 +313,6 @@ The C parameter may be supplied. See below. - - See also: L. - --=item C -- --Connect to the Sheepdog server. --The C parameter may also be supplied - see below. -- --See also: L. -- --=item C -- --Connect to the Secure Shell (ssh) server. -- --The C parameter must be supplied. --The C parameter may be supplied. See below. -- --See also: L. -- - =back - - =item C -@@ -362,13 +323,8 @@ is a list of server(s). - Protocol Number of servers required - -------- -------------------------- - file List must be empty or param not used at all -- ftp|ftps|http|https|tftp Exactly one -- gluster Exactly one -- iscsi Exactly one - nbd Exactly one - rbd Zero or more -- sheepdog Zero or more -- ssh Exactly one - - Each list element is a string specifying a server. The string must be - in one of the following formats: -@@ -384,10 +340,10 @@ for the protocol is used (see F). - - =item C - --For the C, C, C, C, C, C, C --and C protocols, this specifies the remote username. -+For the C -+protocol, this specifies the remote username. - --If not given, then the local username is used for C, and no authentication -+If not given, then no authentication - is attempted for ceph. But note this sometimes may give unexpected results, for - example if using the libvirt backend and if the libvirt backend is configured to - start the qemu appliance as a special user such as C. If in doubt, -diff --git a/lib/drives.c b/lib/drives.c -index 82ef30093..3d712c6e4 100644 ---- a/lib/drives.c -+++ b/lib/drives.c -@@ -165,6 +165,7 @@ create_drive_non_file (guestfs_h *g, - return drv; - } - -+#if 0 /* DISABLED IN RHEL 8 */ - static struct drive * - create_drive_curl (guestfs_h *g, - const struct drive_create_data *data) -@@ -223,6 +224,7 @@ create_drive_gluster (guestfs_h *g, - - return create_drive_non_file (g, data); - } -+#endif /* DISABLED IN RHEL 8 */ - - static int - nbd_port (void) -@@ -291,6 +293,7 @@ create_drive_rbd (guestfs_h *g, - return create_drive_non_file (g, data); - } - -+#if 0 /* DISABLED IN RHEL 8 */ - static struct drive * - create_drive_sheepdog (guestfs_h *g, - const struct drive_create_data *data) -@@ -391,6 +394,7 @@ create_drive_iscsi (guestfs_h *g, - - return create_drive_non_file (g, data); - } -+#endif /* DISABLED IN RHEL 8 */ - - /** - * Create the special F drive. -@@ -826,6 +830,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, - drv = create_drive_file (g, &data); - } - } -+#if 0 /* DISABLED IN RHEL 8 */ - else if (STREQ (protocol, "ftp")) { - data.protocol = drive_protocol_ftp; - drv = create_drive_curl (g, &data); -@@ -850,6 +855,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, - data.protocol = drive_protocol_iscsi; - drv = create_drive_iscsi (g, &data); - } -+#endif /* DISABLED IN RHEL 8 */ - else if (STREQ (protocol, "nbd")) { - data.protocol = drive_protocol_nbd; - drv = create_drive_nbd (g, &data); -@@ -858,6 +864,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, - data.protocol = drive_protocol_rbd; - drv = create_drive_rbd (g, &data); - } -+#if 0 /* DISABLED IN RHEL 8 */ - else if (STREQ (protocol, "sheepdog")) { - data.protocol = drive_protocol_sheepdog; - drv = create_drive_sheepdog (g, &data); -@@ -870,6 +877,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, - data.protocol = drive_protocol_tftp; - drv = create_drive_curl (g, &data); - } -+#endif /* DISABLED IN RHEL 8 */ - else { - error (g, _("unknown protocol ‘%s’"), protocol); - drv = NULL; /*FALLTHROUGH*/ -diff --git a/lib/guestfs.pod b/lib/guestfs.pod -index af944ddb7..58559a6b4 100644 ---- a/lib/guestfs.pod -+++ b/lib/guestfs.pod -@@ -714,70 +714,6 @@ servers. The server string is documented in - L. The C and C parameters are - also optional, and if not given, then no authentication will be used. - --=head3 FTP, HTTP AND TFTP -- --Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS --or TFTP protocols. -- --To do this, set the optional C and C parameters of --L like this: -- -- char **servers = { "www.example.org", NULL }; -- guestfs_add_drive_opts (g, "/disk.img", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "http", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, -- -1); -- --The C can be one of C<"ftp">, C<"ftps">, C<"http">, --C<"https"> or C<"tftp">. -- --C (the C parameter) is a list which must have a --single element. The single element is a string defining the web, --FTP or TFTP server. The format of this string is documented in --L. -- --=head3 GLUSTER -- --Libguestfs can access Gluster disks. -- --To do this, set the optional C and C parameters of --L like this: -- -- char **servers = { "gluster.example.org:24007", NULL }; -- guestfs_add_drive_opts (g, "volname/image", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "gluster", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, -- -1); -- --C (the C parameter) is a list which must have a --single element. The single element is a string defining the Gluster --server. The format of this string is documented in --L. -- --Note that gluster usually requires the client process (ie. libguestfs) --to run as B and will give unfathomable errors if it is not --(eg. "No data available"). -- --=head3 ISCSI -- --Libguestfs can access iSCSI disks remotely. -- --To do this, set the optional C and C parameters like --this: -- -- char **server = { "iscsi.example.org:3000", NULL }; -- guestfs_add_drive_opts (g, "target-iqn-name/lun", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "iscsi", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, -- -1); -- --The C parameter is a list which must have a single element. --The single element is a string defining the iSCSI server. The format --of this string is documented in L. -- - =head3 NETWORK BLOCK DEVICE - - Libguestfs can access Network Block Device (NBD) disks remotely. -@@ -840,42 +776,6 @@ L - - =back - --=head3 SHEEPDOG -- --Libguestfs can access Sheepdog disks. -- --To do this, set the optional C and C parameters of --L like this: -- -- char **servers = { /* optional servers ... */ NULL }; -- guestfs_add_drive_opts (g, "volume", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "sheepdog", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, -- -1); -- --The optional list of C may be zero or more server addresses --(C<"hostname:port">). The format of the server strings is documented --in L. -- --=head3 SSH -- --Libguestfs can access disks over a Secure Shell (SSH) connection. -- --To do this, set the C and C and (optionally) --C parameters of L like this: -- -- char **server = { "remote.example.com", NULL }; -- guestfs_add_drive_opts (g, "/path/to/disk.img", -- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "ssh", -- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, -- GUESTFS_ADD_DRIVE_OPTS_USERNAME, "remoteuser", -- -1); -- --The format of the server string is documented in --L. -- - =head2 INSPECTION - - Libguestfs has APIs for inspecting an unknown disk image to find out -diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh -index e49c69b43..9b1abc4ec 100755 ---- a/tests/disks/test-qemu-drive-libvirt.sh -+++ b/tests/disks/test-qemu-drive-libvirt.sh -@@ -64,34 +64,6 @@ check_output - grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2 - rm "$DEBUG_QEMU_FILE" - --# Gluster. -- --$guestfish -d gluster run ||: --check_output --grep -sq -- '-drive file=gluster://1.2.3.4:1234/volname/image,' "$DEBUG_QEMU_FILE" || fail gluster --rm "$DEBUG_QEMU_FILE" -- --# iSCSI. -- --$guestfish -d iscsi run ||: --check_output --grep -sq -- '-drive file=iscsi://1.2.3.4:1234/iqn.2003-01.org.linux-iscsi.fedora' "$DEBUG_QEMU_FILE" || fail iscsi --rm "$DEBUG_QEMU_FILE" -- --# NBD. -- --$guestfish -d nbd run ||: --check_output --grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail nbd --rm "$DEBUG_QEMU_FILE" -- --# Sheepdog. -- --$guestfish -d sheepdog run ||: --check_output --grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail sheepdog --rm "$DEBUG_QEMU_FILE" -- - # Local, stored in a pool. - - $guestfish -d pool1 run ||: -diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh -index 19dd60a2f..583e031bd 100755 ---- a/tests/disks/test-qemu-drive.sh -+++ b/tests/disks/test-qemu-drive.sh -@@ -62,45 +62,6 @@ check_output - grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail - rm "$DEBUG_QEMU_FILE" - --# HTTP. -- --guestfish < +Date: Thu, 12 Mar 2020 14:40:05 +0000 +Subject: [PATCH] daemon: xattr: Filter out user.WofCompressedData from xattrs + (RHBZ#1811539). + +See comment in code for justification. + +Thanks: Yongkui Guo for finding the bug. +(cherry picked from commit c2c11382bbeb4500f3388a31ffd08cfc18b0de40) +--- + daemon/xattr.c | 43 ++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 40 insertions(+), 3 deletions(-) + +diff --git a/daemon/xattr.c b/daemon/xattr.c +index 3e1144963..43e49384f 100644 +--- a/daemon/xattr.c ++++ b/daemon/xattr.c +@@ -19,6 +19,8 @@ + #include + + #include ++#include ++#include + #include + #include + +@@ -119,6 +121,29 @@ split_attr_names (char *buf, size_t len) + return take_stringsbuf (&ret); + } + ++/* We hide one extended attribute automatically. This is used by NTFS ++ * to store the compressed contents of a file when using "CompactOS" ++ * (per-file compression). I justify this by: ++ * ++ * (1) The attribute is only used internally by NTFS. The actual file ++ * contents are still available. ++ * ++ * (2) It's probably not valid to copy this attribute when copying the ++ * other attributes of a file. ntfs-3g-system-compression doesn't ++ * support writing compressed files. ++ * ++ * (3) This file isn't readable by the Linux kernel. Reading it will ++ * always return -E2BIG (RHBZ#1811539). So we can't read it even if ++ * we wanted to. ++ * ++ * (4) The Linux kernel itself hides other attributes. ++ */ ++static bool ++not_hidden_xattr (const char *attrname) ++{ ++ return STRNEQ (attrname, "user.WofCompressedData"); ++} ++ + static int + compare_xattrs (const void *vxa1, const void *vxa2) + { +@@ -136,6 +161,7 @@ getxattrs (const char *path, + { + ssize_t len, vlen; + CLEANUP_FREE char *buf = NULL; ++ CLEANUP_FREE /* not string list */ char **names_unfiltered = NULL; + CLEANUP_FREE /* not string list */ char **names = NULL; + size_t i; + guestfs_int_xattr_list *r = NULL; +@@ -145,7 +171,10 @@ getxattrs (const char *path, + /* _listxattrs issues reply_with_perror already. */ + goto error; + +- names = split_attr_names (buf, len); ++ names_unfiltered = split_attr_names (buf, len); ++ if (names_unfiltered == NULL) ++ goto error; ++ names = filter_list (not_hidden_xattr, names_unfiltered); + if (names == NULL) + goto error; + +@@ -323,6 +352,7 @@ do_internal_lxattrlist (const char *path, char *const *names) + void *newptr; + CLEANUP_FREE char *pathname = NULL; + CLEANUP_FREE char *buf = NULL; ++ CLEANUP_FREE /* not string list */ char **attrnames_unfiltered = NULL; + CLEANUP_FREE /* not string list */ char **attrnames = NULL; + + /* Be careful in this loop about which errors cause the whole call +@@ -381,7 +411,10 @@ do_internal_lxattrlist (const char *path, char *const *names) + if (len == -1) + continue; /* not fatal */ + +- attrnames = split_attr_names (buf, len); ++ attrnames_unfiltered = split_attr_names (buf, len); ++ if (attrnames_unfiltered == NULL) ++ goto error; ++ attrnames = filter_list (not_hidden_xattr, attrnames_unfiltered); + if (attrnames == NULL) + goto error; + nr_attrs = guestfs_int_count_strings (attrnames); +@@ -539,6 +572,7 @@ copy_xattrs (const char *src, const char *dest) + { + ssize_t len, vlen, ret, attrval_len = 0; + CLEANUP_FREE char *buf = NULL, *attrval = NULL; ++ CLEANUP_FREE /* not string list */ char **names_unfiltered = NULL; + CLEANUP_FREE /* not string list */ char **names = NULL; + size_t i; + +@@ -547,7 +581,10 @@ copy_xattrs (const char *src, const char *dest) + /* _listxattrs issues reply_with_perror already. */ + goto error; + +- names = split_attr_names (buf, len); ++ names_unfiltered = split_attr_names (buf, len); ++ if (names_unfiltered == NULL) ++ goto error; ++ names = filter_list (not_hidden_xattr, names_unfiltered); + if (names == NULL) + goto error; + +-- +2.25.4 + diff --git a/SOURCES/0059-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch b/SOURCES/0059-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch deleted file mode 100644 index 17c8279..0000000 --- a/SOURCES/0059-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6bf62d3c79aab0dd01ad5ab9cfc9a12b119976f6 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 19 Sep 2014 13:38:20 +0100 -Subject: [PATCH] RHEL 8: Remove User-Mode Linux (RHBZ#1144197). - -This isn't supported in RHEL 8. ---- - lib/launch-uml.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/lib/launch-uml.c b/lib/launch-uml.c -index da20c17d9..a5e0e8179 100644 ---- a/lib/launch-uml.c -+++ b/lib/launch-uml.c -@@ -44,7 +44,9 @@ struct backend_uml_data { - char umid[UML_UMID_LEN+1]; /* umid=<...> unique ID. */ - }; - -+#if 0 - static void print_vmlinux_command_line (guestfs_h *g, char **argv); -+#endif - - /* Run uml_mkcow to create a COW overlay. */ - static char * -@@ -81,6 +83,7 @@ create_cow_overlay_uml (guestfs_h *g, void *datav, struct drive *drv) - return make_cow_overlay (g, drv->src.u.path); - } - -+#if 0 - /* Test for features which are not supported by the UML backend. - * Possibly some of these should just be warnings, not errors. - */ -@@ -128,10 +131,17 @@ uml_supported (guestfs_h *g) - - return true; - } -+#endif - - static int - launch_uml (guestfs_h *g, void *datav, const char *arg) - { -+ error (g, -+ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" -+ "In particular, User-Mode Linux (UML) is not supported."); -+ return -1; -+ -+#if 0 - struct backend_uml_data *data = datav; - CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (cmdline); - int console_sock = -1, daemon_sock = -1; -@@ -491,8 +501,10 @@ launch_uml (guestfs_h *g, void *datav, const char *arg) - } - g->state = CONFIG; - return -1; -+#endif - } - -+#if 0 - /* This is called from the forked subprocess just before vmlinux runs, - * so it can just print the message straight to stderr, where it will - * be picked up and funnelled through the usual appliance event API. -@@ -522,6 +534,7 @@ print_vmlinux_command_line (guestfs_h *g, char **argv) - - fputc ('\n', stderr); - } -+#endif - - static int - shutdown_uml (guestfs_h *g, void *datav, int check_for_errors) --- -2.24.1 - diff --git a/SOURCES/0059-mltools-add-run_in_guest_command-helper.patch b/SOURCES/0059-mltools-add-run_in_guest_command-helper.patch new file mode 100644 index 0000000..506b6c4 --- /dev/null +++ b/SOURCES/0059-mltools-add-run_in_guest_command-helper.patch @@ -0,0 +1,95 @@ +From 1519dfe45d35dbc1f273d468fca3ea77d6cfdfad Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Mon, 4 May 2020 15:14:46 +0200 +Subject: [PATCH] mltools: add run_in_guest_command helper + +Add an helper function to run a command in the guest, checking for the +host/guest compatibility. This is mostly extracted from the internal +do_run helper currently in the Customize_run module of virt-customize. + +(cherry picked from commit e73eca3b73f7d0a54615c5dc55eadd09dc170035 +in libguestfs-common) +--- + common/mltools/tools_utils.ml | 50 ++++++++++++++++++++++++++++++++++ + common/mltools/tools_utils.mli | 10 +++++++ + 2 files changed, 60 insertions(+) + +diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml +index 127180225..d54ec581e 100644 +--- a/common/mltools/tools_utils.ml ++++ b/common/mltools/tools_utils.ml +@@ -679,3 +679,53 @@ let with_timeout op timeout ?(sleep = 2) fn = + loop () + in + loop () ++ ++let run_in_guest_command g root ?logfile ?incompatible_fn cmd = ++ (* Is the host_cpu compatible with the guest arch? ie. Can we ++ * run commands in this guest? ++ *) ++ let guest_arch = g#inspect_get_arch root in ++ let guest_arch_compatible = guest_arch_compatible guest_arch in ++ if not guest_arch_compatible then ( ++ match incompatible_fn with ++ | None -> () ++ | Some fn -> fn () ++ ) ++ else ( ++ (* Add a prologue to the scripts: ++ * - Pass environment variables through from the host. ++ * - Optionally send stdout and stderr to a log file so we capture ++ * all output in error messages. ++ * - Use setarch when running x86_64 host + i686 guest. ++ *) ++ let env_vars = ++ List.filter_map ( ++ fun name -> ++ try Some (sprintf "export %s=%s" name (quote (Sys.getenv name))) ++ with Not_found -> None ++ ) [ "http_proxy"; "https_proxy"; "ftp_proxy"; "no_proxy" ] in ++ let env_vars = String.concat "\n" env_vars ^ "\n" in ++ ++ let cmd = ++ match Guestfs_config.host_cpu, guest_arch with ++ | "x86_64", ("i386"|"i486"|"i586"|"i686") -> ++ sprintf "setarch i686 <<\"__EOCMD\" ++%s ++__EOCMD ++" cmd ++ | _ -> cmd in ++ ++ let logfile_redirect = ++ match logfile with ++ | None -> "" ++ | Some logfile -> sprintf "exec >>%s 2>&1" (quote logfile) in ++ ++ let cmd = sprintf "\ ++%s ++%s ++%s ++" (logfile_redirect) env_vars cmd in ++ ++ debug "running command:\n%s" cmd; ++ ignore (g#sh cmd) ++ ) +diff --git a/common/mltools/tools_utils.mli b/common/mltools/tools_utils.mli +index ab70f583e..102abff4d 100644 +--- a/common/mltools/tools_utils.mli ++++ b/common/mltools/tools_utils.mli +@@ -212,3 +212,13 @@ val with_timeout : string -> int -> ?sleep:int -> (unit -> 'a option) -> 'a + calls {!error} and the program exits. The error message will + contain the diagnostic string [op] to identify the operation + which timed out. *) ++ ++val run_in_guest_command : Guestfs.guestfs -> string -> ?logfile:string -> ?incompatible_fn:(unit -> unit) -> string -> unit ++(** [run_in_guest_command g root ?incompatible_archs_fn cmd] ++ runs a command in the guest, which is already mounted for the ++ specified [root]. The command is run directly in case the ++ architecture of the host and the guest are compatible, optionally ++ calling [?incompatible_fn] in case they are not. ++ ++ [?logfile] is an optional file in the guest to where redirect ++ stdout and stderr of the command. *) +-- +2.25.4 + diff --git a/SOURCES/0060-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch b/SOURCES/0060-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch deleted file mode 100644 index 855372d..0000000 --- a/SOURCES/0060-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 699137c5c84439597757f8c00373ebb53544223b Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sun, 28 Sep 2014 19:14:43 +0100 -Subject: [PATCH] RHEL 8: v2v: Select correct qemu binary for -o qemu mode - (RHBZ#1147313). - -RHEL 8 does not have qemu-system-x86_64 (etc), and in addition the -qemu binary is located in /usr/libexec. Encode the path to this -binary directly in the script. - -Note that we don't support people running qemu directly like this. -It's just for quick testing of converted VMs, and to help us with -support cases. ---- - v2v/output_qemu.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/v2v/output_qemu.ml b/v2v/output_qemu.ml -index 1f6798aaf..8665d7b5c 100644 ---- a/v2v/output_qemu.ml -+++ b/v2v/output_qemu.ml -@@ -81,7 +81,7 @@ object - * module deals with shell and qemu comma quoting. - *) - let cmd = Qemuopts.create () in -- Qemuopts.set_binary_by_arch cmd (Some guestcaps.gcaps_arch); -+ Qemuopts.set_binary cmd "/usr/libexec/qemu-kvm"; - - let flag = Qemuopts.flag cmd - and arg = Qemuopts.arg cmd --- -2.24.1 - diff --git a/SOURCES/0060-customize-port-do_run-to-run_in_guest_command.patch b/SOURCES/0060-customize-port-do_run-to-run_in_guest_command.patch new file mode 100644 index 0000000..d9162af --- /dev/null +++ b/SOURCES/0060-customize-port-do_run-to-run_in_guest_command.patch @@ -0,0 +1,83 @@ +From 63d711246f7e86c838c4471bec538a40abffbfb8 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Mon, 4 May 2020 11:55:41 +0200 +Subject: [PATCH] customize: port do_run to run_in_guest_command + +Make use of the new helper function in Tools_utils to run commands in +the guest. + +(cherry picked from commit b25e3495f522378f59d201526d7d2d02c2bf6f3f) +--- + customize/customize_run.ml | 48 ++++++-------------------------------- + 1 file changed, 7 insertions(+), 41 deletions(-) + +diff --git a/customize/customize_run.ml b/customize/customize_run.ml +index 3eacdaca0..f2ee20413 100644 +--- a/customize/customize_run.ml ++++ b/customize/customize_run.ml +@@ -30,12 +30,6 @@ open Append_line + module G = Guestfs + + let run (g : G.guestfs) root (ops : ops) = +- (* Is the host_cpu compatible with the guest arch? ie. Can we +- * run commands in this guest? +- *) +- let guest_arch = g#inspect_get_arch root in +- let guest_arch_compatible = guest_arch_compatible guest_arch in +- + (* Based on the guest type, choose a log file location. *) + let logfile = + match g#inspect_get_type root with +@@ -54,42 +48,14 @@ let run (g : G.guestfs) root (ops : ops) = + + (* Useful wrapper for scripts. *) + let do_run ~display ?(warn_failed_no_network = false) cmd = +- if not guest_arch_compatible then ++ let incompatible_fn () = ++ let guest_arch = g#inspect_get_arch root in + error (f_"host cpu (%s) and guest arch (%s) are not compatible, so you cannot use command line options that involve running commands in the guest. Use --firstboot scripts instead.") +- Guestfs_config.host_cpu guest_arch; +- +- (* Add a prologue to the scripts: +- * - Pass environment variables through from the host. +- * - Send stdout and stderr to a log file so we capture all output +- * in error messages. +- * - Use setarch when running x86_64 host + i686 guest. +- * Also catch errors and dump the log file completely on error. +- *) +- let env_vars = +- List.filter_map ( +- fun name -> +- try Some (sprintf "export %s=%s" name (quote (Sys.getenv name))) +- with Not_found -> None +- ) [ "http_proxy"; "https_proxy"; "ftp_proxy"; "no_proxy" ] in +- let env_vars = String.concat "\n" env_vars ^ "\n" in +- +- let cmd = +- match Guestfs_config.host_cpu, guest_arch with +- | "x86_64", ("i386"|"i486"|"i586"|"i686") -> +- sprintf "setarch i686 <<\"__EOCMD\" +-%s +-__EOCMD +-" cmd +- | _ -> cmd in +- +- let cmd = sprintf "\ +-exec >>%s 2>&1 +-%s +-%s +-" (quote logfile) env_vars cmd in +- +- debug "running command:\n%s" cmd; +- try ignore (g#sh cmd) ++ Guestfs_config.host_cpu guest_arch ++ in ++ ++ try ++ run_in_guest_command g root ~logfile ~incompatible_fn cmd + with + G.Error msg -> + debug_logfile (); +-- +2.25.4 + diff --git a/SOURCES/0061-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch b/SOURCES/0061-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch deleted file mode 100644 index 7fc57cb..0000000 --- a/SOURCES/0061-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 839672ac70f58af6ab4a7ff31335efc28b49df57 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 30 Sep 2014 10:50:27 +0100 -Subject: [PATCH] RHEL 8: v2v: Disable the --qemu-boot option (RHBZ#1147313). - -This cannot work because there is no Gtk or SDL output mode -in RHEL 8's qemu-kvm. - -In addition you will have to edit the -display option in the -qemu script. ---- - v2v/cmdline.ml | 3 ++- - v2v/virt-v2v-output-local.pod | 6 ++---- - v2v/virt-v2v.pod | 13 ------------- - 3 files changed, 4 insertions(+), 18 deletions(-) - -diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml -index 686631271..e3578ddcb 100644 ---- a/v2v/cmdline.ml -+++ b/v2v/cmdline.ml -@@ -262,7 +262,6 @@ let parse_cmdline () = - s_"Estimate size of source and stop"; - [ L"print-source" ], Getopt.Set print_source, - s_"Print source and stop"; -- [ L"qemu-boot" ], Getopt.Set qemu_boot, s_"Boot in qemu (-o qemu only)"; - [ L"root" ], Getopt.String ("ask|... ", set_root_choice), - s_"How to choose root filesystem"; - [ L"vddk-config" ], Getopt.String ("filename", set_input_option_compat "vddk-config"), -@@ -640,6 +639,8 @@ read the man page virt-v2v(1). - | Some d when not (is_directory d) -> - error (f_"-os %s: output directory does not exist or is not a directory") d - | Some d -> d in -+ if qemu_boot then -+ error (f_"-o qemu: the --qemu-boot option cannot be used in RHEL"); - Output_qemu.output_qemu os qemu_boot, - output_format, output_alloc - -diff --git a/v2v/virt-v2v-output-local.pod b/v2v/virt-v2v-output-local.pod -index 7c397c0a4..09a11a7b0 100644 ---- a/v2v/virt-v2v-output-local.pod -+++ b/v2v/virt-v2v-output-local.pod -@@ -9,7 +9,7 @@ or libvirt - - virt-v2v [-i* options] -o local -os DIRECTORY - -- virt-v2v [-i* options] -o qemu -os DIRECTORY [--qemu-boot] -+ virt-v2v [-i* options] -o qemu -os DIRECTORY - - virt-v2v [-i* options] -o json -os DIRECTORY - [-oo json-disks-pattern=PATTERN] -@@ -50,12 +50,10 @@ where C is the guest name. - - =item B<-o qemu -os> C - --=item B<-o qemu -os> C B<--qemu-boot> -- - This converts the guest to files in C. Unlike I<-o local> - above, a shell script is created which contains the raw qemu command - you would need to boot the guest. However the shell script is not --run, I you also add the I<--qemu-boot> option. -+run. - - =item B<-o json -os> C - -diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod -index 25041d0ec..bd606592b 100644 ---- a/v2v/virt-v2v.pod -+++ b/v2v/virt-v2v.pod -@@ -142,11 +142,6 @@ Since F contains the path(s) to the guest disk - image(s) you do not need to specify the name of the disk image on the - command line. - --To convert a local disk image and immediately boot it in local --qemu, do: -- -- virt-v2v -i disk disk.img -o qemu -os /var/tmp --qemu-boot -- - =head1 OPTIONS - - =over 4 -@@ -510,9 +505,6 @@ This is similar to I<-o local>, except that a shell script is written - which you can use to boot the guest in qemu. The converted disks and - shell script are written to the directory specified by I<-os>. - --When using this output mode, you can also specify the I<--qemu-boot> --option which boots the guest under qemu immediately. -- - =item B<-o> B - - This is the same as I<-o rhv>. -@@ -788,11 +780,6 @@ Print information about the source guest and stop. This option is - useful when you are setting up network and bridge maps. - See L. - --=item B<--qemu-boot> -- --When using I<-o qemu> only, this boots the guest immediately after --virt-v2v finishes. -- - =item B<-q> - - =item B<--quiet> --- -2.24.1 - diff --git a/SOURCES/0061-sysprep-add-a-update_system_ca_store-side-effect.patch b/SOURCES/0061-sysprep-add-a-update_system_ca_store-side-effect.patch new file mode 100644 index 0000000..7b66f71 --- /dev/null +++ b/SOURCES/0061-sysprep-add-a-update_system_ca_store-side-effect.patch @@ -0,0 +1,138 @@ +From f3fa23fd9db0723bbeccffc79ce12a707d284643 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Mon, 4 May 2020 12:05:18 +0200 +Subject: [PATCH] sysprep: add a update_system_ca_store side effect + +Add a simple side effect to make operation flag that a regeneration of +the system CA store is needed. In case it is flagged, regenerate the +system CA store directly, or using a firstboot script in case of +incompatible architectures. + +This change is almost a no-op, since no operation requires the +regeneration of the system CA store yet. + +(cherry picked from commit bb7fc6d0a1ed670d16a92d2afd9ff2f876edc595) +--- + sysprep/main.ml | 5 +++++ + sysprep/sysprep_operation.ml | 3 +++ + sysprep/sysprep_operation.mli | 2 ++ + sysprep/utils.ml | 32 ++++++++++++++++++++++++++++++++ + sysprep/utils.mli | 4 ++++ + 5 files changed, 46 insertions(+) + +diff --git a/sysprep/main.ml b/sysprep/main.ml +index 04fd7b23c..4b03d5b48 100644 +--- a/sysprep/main.ml ++++ b/sysprep/main.ml +@@ -25,6 +25,7 @@ open Common_gettext.Gettext + open Getopt.OptionName + + open Sysprep_operation ++open Utils + + module G = Guestfs + +@@ -236,6 +237,10 @@ read the man page virt-sysprep(1). + Sysprep_operation.perform_operations_on_filesystems + ?operations g root side_effects; + ++ (* Do we need to update the system CA store? *) ++ if side_effects#get_update_system_ca_store then ++ update_system_ca_store g root; ++ + (* Unmount everything in this guest. *) + g#umount_all (); + +diff --git a/sysprep/sysprep_operation.ml b/sysprep/sysprep_operation.ml +index 0013ff504..53f042402 100644 +--- a/sysprep/sysprep_operation.ml ++++ b/sysprep/sysprep_operation.ml +@@ -27,10 +27,13 @@ class filesystem_side_effects = + object + val mutable m_created_file = false + val mutable m_changed_file = false ++ val mutable m_update_system_ca_store = false + method created_file () = m_created_file <- true + method get_created_file = m_created_file + method changed_file () = m_changed_file <- true + method get_changed_file = m_changed_file ++ method update_system_ca_store () = m_update_system_ca_store <- true ++ method get_update_system_ca_store = m_update_system_ca_store + end + + class device_side_effects = object end +diff --git a/sysprep/sysprep_operation.mli b/sysprep/sysprep_operation.mli +index 3d9f12550..2a02d5e79 100644 +--- a/sysprep/sysprep_operation.mli ++++ b/sysprep/sysprep_operation.mli +@@ -23,6 +23,8 @@ class filesystem_side_effects : object + method get_created_file : bool + method changed_file : unit -> unit + method get_changed_file : bool ++ method update_system_ca_store : unit -> unit ++ method get_update_system_ca_store : bool + end + (** The callback should indicate if it has side effects by calling + methods in this class. *) +diff --git a/sysprep/utils.ml b/sysprep/utils.ml +index 4c45d42de..29460b3c0 100644 +--- a/sysprep/utils.ml ++++ b/sysprep/utils.ml +@@ -20,6 +20,9 @@ + + open Printf + ++open Tools_utils ++open Common_gettext.Gettext ++ + let rec pod_of_list ?(style = `Dot) xs = + match style with + | `Verbatim -> String.concat "\n" (List.map ((^) " ") xs) +@@ -31,3 +34,32 @@ and _pod_of_list delim xs = + "=over 4\n\n" ^ + String.concat "" (List.map (sprintf "=item %s\n\n%s\n\n" delim) xs) ^ + "=back" ++ ++let rec update_system_ca_store g root = ++ let cmd = update_system_ca_store_command g root in ++ match cmd with ++ | None -> () ++ | Some cmd -> ++ (* Try to run the command directly if possible, adding it as ++ * firstboot script in case of incompatible architectures. ++ *) ++ let cmd = String.concat " " cmd in ++ let incompatible_fn () = ++ Firstboot.add_firstboot_script g root cmd cmd ++ in ++ ++ run_in_guest_command g root ~incompatible_fn cmd ++ ++and update_system_ca_store_command g root = ++ let typ = g#inspect_get_type root in ++ let distro = g#inspect_get_distro root in ++ match typ, distro with ++ | "linux", ("fedora"|"rhel"|"centos"|"scientificlinux"|"oraclelinux"|"redhat-based") -> ++ Some [ "update-ca-trust"; "extract" ] ++ ++ | "linux", ("debian"|"ubuntu"|"kalilinux") -> ++ Some [ "update-ca-certificates" ] ++ ++ | _, _ -> ++ warning (f_"updating the system CA store on this guest %s/%s is not supported") typ distro; ++ None +diff --git a/sysprep/utils.mli b/sysprep/utils.mli +index a57a0d876..82779620e 100644 +--- a/sysprep/utils.mli ++++ b/sysprep/utils.mli +@@ -26,3 +26,7 @@ val pod_of_list : ?style:[`Verbatim|`Star|`Dash|`Dot] -> string list -> string + use a space-indented (verbatim) block. [`Star], [`Dash] or [`Dot] + meaning use a real list with [*], [-] or [·]. The default + style is [·] ([`Dot]). *) ++ ++val update_system_ca_store : Guestfs.guestfs -> string -> unit ++(** Update the system CA store on the guest for the specified root ++ (which is fully mounted). *) +-- +2.25.4 + diff --git a/SOURCES/0062-RHEL-8-Disable-alternate-Augeas-lenses.patch b/SOURCES/0062-RHEL-8-Disable-alternate-Augeas-lenses.patch deleted file mode 100644 index 9d20538..0000000 --- a/SOURCES/0062-RHEL-8-Disable-alternate-Augeas-lenses.patch +++ /dev/null @@ -1,60 +0,0 @@ -From e91337be55a8728125de3457dca8f1a998ad18c5 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Fri, 24 Oct 2014 16:33:50 +0100 -Subject: [PATCH] RHEL 8: Disable alternate Augeas lenses. - -These are included in the RHEL augeas package, and therefore not -required. - -See: -https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html ---- - appliance/Makefile.am | 1 - - daemon/augeas.c | 5 ++++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/appliance/Makefile.am b/appliance/Makefile.am -index fc424b1d0..5efc5c036 100644 ---- a/appliance/Makefile.am -+++ b/appliance/Makefile.am -@@ -91,7 +91,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug - rm -rf tmp-d - mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs - ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd -- ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug - ( cd tmp-d && tar zcf - * ) > $@-t - rm -r tmp-d - mv $@-t $@ -diff --git a/daemon/augeas.c b/daemon/augeas.c -index 453251337..5bbfffa2d 100644 ---- a/daemon/augeas.c -+++ b/daemon/augeas.c -@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags) - } - - /* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */ -- aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE); -+ aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE); - - if (!aug) { - reply_with_error ("augeas initialization failed"); -@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags) - return -1; - } - -+ /* We already have the needed lenses in RHEL 8 */ -+#if 0 - if (!augeas_is_version (1, 2, 1)) { - int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow", - 0 /* = included */); -@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags) - } - } - } -+#endif - - return 0; - } --- -2.24.1 - diff --git a/SOURCES/0062-sysprep-ca-certificates-request-system-CA-store-upda.patch b/SOURCES/0062-sysprep-ca-certificates-request-system-CA-store-upda.patch new file mode 100644 index 0000000..6505f87 --- /dev/null +++ b/SOURCES/0062-sysprep-ca-certificates-request-system-CA-store-upda.patch @@ -0,0 +1,42 @@ +From d78ec54de6b5ba915445d668ebf292bc9ff38a9a Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Mon, 4 May 2020 12:15:43 +0200 +Subject: [PATCH] sysprep: ca-certificates: request system CA store update + +In case any certificate is removed from the guest, regenerate the system +CA store. + +(cherry picked from commit b9065fa7adc93123c53f4827e11dad6b210b7d4b) +--- + sysprep/sysprep_operation_ca_certificates.ml | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/sysprep/sysprep_operation_ca_certificates.ml b/sysprep/sysprep_operation_ca_certificates.ml +index e481cebf8..a2b7986c1 100644 +--- a/sysprep/sysprep_operation_ca_certificates.ml ++++ b/sysprep/sysprep_operation_ca_certificates.ml +@@ -39,7 +39,11 @@ let ca_certificates_perform (g : Guestfs.guestfs) root side_effects = + let set = StringSet.diff set excepts in + StringSet.iter ( + fun filename -> +- try g#rm filename with G.Error _ -> () ++ try ++ g#rm filename; ++ side_effects#update_system_ca_store () ++ with ++ G.Error _ -> () + ) set + ) + +@@ -48,6 +52,8 @@ let op = { + name = "ca-certificates"; + enabled_by_default = false; + heading = s_"Remove CA certificates in the guest"; ++ pod_description = Some (s_"\ ++In case any certificate is removed, the system CA store is updated."); + perform_on_filesystems = Some ca_certificates_perform; + } + +-- +2.25.4 + diff --git a/SOURCES/0063-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch b/SOURCES/0063-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch deleted file mode 100644 index c294d3a..0000000 --- a/SOURCES/0063-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 2736193735e3e84d81993ac8464c64381119c679 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Fri, 24 Apr 2015 09:45:41 -0400 -Subject: [PATCH] RHEL 8: Fix list of supported sound cards to match RHEL qemu - (RHBZ#1176493). - ---- - v2v/utils.ml | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/v2v/utils.ml b/v2v/utils.ml -index 74b501f81..21e9c9c15 100644 ---- a/v2v/utils.ml -+++ b/v2v/utils.ml -@@ -51,13 +51,14 @@ let kvm_arch = function - (* Does qemu support the given sound card? *) - let qemu_supports_sound_card = function - | Types.AC97 -- | Types.ES1370 - | Types.ICH6 - | Types.ICH9 - | Types.PCSpeaker -+ -> true -+ | Types.ES1370 - | Types.SB16 - | Types.USBAudio -- -> true -+ -> false - - (* Find the UEFI firmware. *) - let find_uefi_firmware guest_arch = --- -2.24.1 - diff --git a/SOURCES/0063-sysprep-add-IPA-offline-unenrollment-RHBZ-1789592.patch b/SOURCES/0063-sysprep-add-IPA-offline-unenrollment-RHBZ-1789592.patch new file mode 100644 index 0000000..e3d6243 --- /dev/null +++ b/SOURCES/0063-sysprep-add-IPA-offline-unenrollment-RHBZ-1789592.patch @@ -0,0 +1,107 @@ +From fa3ff43b763d191ae542594f75987a3686c847b2 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Thu, 7 May 2020 13:53:21 +0200 +Subject: [PATCH] sysprep: add IPA offline unenrollment (RHBZ#1789592) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This new operation unenrolls the guest from a IPA server offline, by +removing the configuration files and certificates. + +Thanks to Christian Heimes and François Cami for the hints. + +(cherry picked from commit 0a53e2c7fc4fe2aa69052134230db0804849b470) +--- + sysprep/Makefile.am | 1 + + sysprep/sysprep_operation_ipa_client.ml | 66 +++++++++++++++++++++++++ + 2 files changed, 67 insertions(+) + create mode 100644 sysprep/sysprep_operation_ipa_client.ml + +diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am +index e6269c3f7..79266314b 100644 +--- a/sysprep/Makefile.am ++++ b/sysprep/Makefile.am +@@ -43,6 +43,7 @@ operations = \ + flag_reconfiguration \ + firewall_rules \ + fs_uuids \ ++ ipa_client \ + kerberos_data \ + lvm_uuids \ + logfiles \ +diff --git a/sysprep/sysprep_operation_ipa_client.ml b/sysprep/sysprep_operation_ipa_client.ml +new file mode 100644 +index 000000000..6e64a754a +--- /dev/null ++++ b/sysprep/sysprep_operation_ipa_client.ml +@@ -0,0 +1,66 @@ ++(* virt-sysprep ++ * Copyright (C) 2020 Red Hat Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License along ++ * with this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ *) ++ ++open Sysprep_operation ++open Common_gettext.Gettext ++ ++module G = Guestfs ++ ++let ipa_client_perform (g : Guestfs.guestfs) root side_effects = ++ let typ = g#inspect_get_type root in ++ if typ = "linux" then ( ++ (* Simple paths with no side effects. *) ++ let paths = [ "/etc/ipa/ca.crt"; ++ "/etc/ipa/default.conf"; ++ "/var/lib/ipa-client/sysrestore/*"; ++ "/var/lib/ipa-client/pki/*" ] in ++ let paths = List.concat (List.map Array.to_list (List.map g#glob_expand paths)) in ++ List.iter ( ++ fun filename -> ++ try g#rm filename with G.Error _ -> () ++ ) paths; ++ ++ (* Certificates in the system CA store. *) ++ let certs = [ "/etc/pki/ca-trust/source/anchors/ipa-ca.crt"; ++ "/usr/local/share/ca-certificates/ipa-ca.crt"; ++ "/etc/pki/ca-trust/source/ipa.p11-kit" ] in ++ List.iter ( ++ fun filename -> ++ try ++ g#rm filename; ++ side_effects#update_system_ca_store () ++ with ++ G.Error _ -> () ++ ) certs ++ ) ++ ++let op = { ++ defaults with ++ name = "ipa-client"; ++ enabled_by_default = true; ++ heading = s_"Remove the IPA files"; ++ pod_description = Some (s_"\ ++Remove all the files related to an IPA (Identity, Policy, Audit) system. ++This effectively unenrolls the guest from an IPA server without interacting ++with it. ++ ++This operation does not run C."); ++ perform_on_filesystems = Some ipa_client_perform; ++} ++ ++let () = register_operation op +-- +2.25.4 + diff --git a/SOURCES/0064-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch b/SOURCES/0064-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch deleted file mode 100644 index b64a2a6..0000000 --- a/SOURCES/0064-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 9f85ee42bc679642ead93582e3d44e5cf3c30503 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 7 Jul 2015 09:28:03 -0400 -Subject: [PATCH] RHEL 8: Reject use of libguestfs-winsupport features except - for virt-* tools (RHBZ#1240276). - ---- - generator/c.ml | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/generator/c.ml b/generator/c.ml -index 86f7d89a3..b5bb99f53 100644 ---- a/generator/c.ml -+++ b/generator/c.ml -@@ -1832,6 +1832,22 @@ and generate_client_actions actions () = - check_args_validity c_name style; - trace_call name c_name style; - -+ (* RHEL 8 *) -+ if name = "mount" || name = "mount_ro" || name = "mount_options" || -+ name = "mount_vfs" then ( -+ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n"; -+ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n"; -+ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n"; -+ pr " error (g, \"mount: unsupported filesystem type\");\n"; -+ pr " if (trace_flag)\n"; -+ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n"; -+ pr " \"%s\", \"-1\");\n" name; -+ pr " return %s;\n" (string_of_errcode errcode); -+ pr " }\n"; -+ pr " }\n"; -+ pr "\n"; -+ ); -+ - (* Calculate the total size of all FileIn arguments to pass - * as a progress bar hint. - *) --- -2.24.1 - diff --git a/SOURCES/0064-sysprep-add-Kerberos-keytab-file-removal.patch b/SOURCES/0064-sysprep-add-Kerberos-keytab-file-removal.patch new file mode 100644 index 0000000..96ecb64 --- /dev/null +++ b/SOURCES/0064-sysprep-add-Kerberos-keytab-file-removal.patch @@ -0,0 +1,81 @@ +From 7700915a65bfed5f6a9b80d63daf572bff33e154 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Thu, 7 May 2020 14:02:30 +0200 +Subject: [PATCH] sysprep: add Kerberos keytab file removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This new operation removes the Kerberos /etc/krb5.keytab file from the +guest. + +Thanks to Christian Heimes and François Cami for the hints. + +Related to RHBZ#1789592. + +(cherry picked from commit faa5d8507f552e05435312f16d9e50f613a13615) +--- + sysprep/Makefile.am | 1 + + .../sysprep_operation_kerberos_hostkeytab.ml | 38 +++++++++++++++++++ + 2 files changed, 39 insertions(+) + create mode 100644 sysprep/sysprep_operation_kerberos_hostkeytab.ml + +diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am +index 79266314b..a99957306 100644 +--- a/sysprep/Makefile.am ++++ b/sysprep/Makefile.am +@@ -45,6 +45,7 @@ operations = \ + fs_uuids \ + ipa_client \ + kerberos_data \ ++ kerberos_hostkeytab \ + lvm_uuids \ + logfiles \ + machine_id \ +diff --git a/sysprep/sysprep_operation_kerberos_hostkeytab.ml b/sysprep/sysprep_operation_kerberos_hostkeytab.ml +new file mode 100644 +index 000000000..cb3023353 +--- /dev/null ++++ b/sysprep/sysprep_operation_kerberos_hostkeytab.ml +@@ -0,0 +1,38 @@ ++(* virt-sysprep ++ * Copyright (C) 2020 Red Hat Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License along ++ * with this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ *) ++ ++open Sysprep_operation ++open Common_gettext.Gettext ++ ++module G = Guestfs ++ ++let kerberos_hostkeytab_perform (g : Guestfs.guestfs) root side_effects = ++ let typ = g#inspect_get_type root in ++ if typ <> "windows" then ( ++ (try g#rm "/etc/krb5.keytab" with G.Error _ -> ()) ++ ) ++ ++let op = { ++ defaults with ++ name = "kerberos-hostkeytab"; ++ enabled_by_default = true; ++ heading = s_"Remove the Kerberos host keytab file in the guest"; ++ perform_on_filesystems = Some kerberos_hostkeytab_perform; ++} ++ ++let () = register_operation op +-- +2.25.4 + diff --git a/SOURCES/0065-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch b/SOURCES/0065-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch deleted file mode 100644 index 24f801a..0000000 --- a/SOURCES/0065-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch +++ /dev/null @@ -1,93 +0,0 @@ -From a08c766a556bc6f258dc498b0a1a3b17f251ed66 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Sun, 30 Aug 2015 03:21:57 -0400 -Subject: [PATCH] RHEL 8: Fix tests for libguestfs-winsupport. - -It doesn't let us use guestfish for arbitrary Windows edits. ---- - test-data/phony-guests/make-windows-img.sh | 1 + - tests/charsets/test-charset-fidelity.c | 2 ++ - v2v/test-v2v-virtio-win-iso.sh | 8 +++++++- - v2v/test-v2v-windows-conversion.sh | 8 +++++++- - 4 files changed, 17 insertions(+), 2 deletions(-) - -diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh -index 8676b5ac0..1a88d9fc9 100755 ---- a/test-data/phony-guests/make-windows-img.sh -+++ b/test-data/phony-guests/make-windows-img.sh -@@ -37,6 +37,7 @@ fi - - # Create a disk image. - guestfish < "$script" - :> "$expected" - -+cat >> "$script" < "$response" -+guestfish --ro -a "$d/windows-sda" < "$script" > "$response" - diff -u "$expected" "$response" - - rm -r $d -diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh -index f1da222a9..ff94fe39b 100755 ---- a/v2v/test-v2v-windows-conversion.sh -+++ b/v2v/test-v2v-windows-conversion.sh -@@ -73,6 +73,12 @@ mktest () - :> "$script" - :> "$expected" - -+cat >> "$script" < "$response" -+guestfish --ro -a "$d/windows-sda" < "$script" > "$response" - diff -u "$expected" "$response" - - # We also update the Registry several times, for firstboot, and (ONLY --- -2.24.1 - diff --git a/SOURCES/0065-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch b/SOURCES/0065-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch new file mode 100644 index 0000000..131014d --- /dev/null +++ b/SOURCES/0065-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch @@ -0,0 +1,38 @@ +From 0647a3a475c647d363205bdbdaca8a79614460c3 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 21 Dec 2012 15:50:11 +0000 +Subject: [PATCH] RHEL 8: Remove libguestfs live (RHBZ#798980). + +This isn't supported in RHEL 8. +--- + lib/launch-unix.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/lib/launch-unix.c b/lib/launch-unix.c +index 4794a7b13..993b83601 100644 +--- a/lib/launch-unix.c ++++ b/lib/launch-unix.c +@@ -37,6 +37,12 @@ + static int + launch_unix (guestfs_h *g, void *datav, const char *sockpath) + { ++ error (g, ++ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" ++ "In particular, \"libguestfs live\" is not supported."); ++ return -1; ++ ++#if 0 + int r, daemon_sock = -1; + struct sockaddr_un addr; + uint32_t size; +@@ -106,6 +112,7 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath) + g->conn = NULL; + } + return -1; ++#endif + } + + static int +-- +2.25.4 + diff --git a/SOURCES/0066-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch b/SOURCES/0066-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch new file mode 100644 index 0000000..a2d0e91 --- /dev/null +++ b/SOURCES/0066-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch @@ -0,0 +1,372 @@ +From 3341114876c1a2df330b68d15026ba266d557d6e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 18 Jul 2013 18:31:53 +0100 +Subject: [PATCH] RHEL 8: Remove 9p APIs from RHEL (RHBZ#921710). + +--- + Makefile.am | 2 +- + daemon/9p.c | 224 -------------------------------------- + daemon/Makefile.am | 1 - + docs/C_SOURCE_FILES | 1 - + generator/actions_core.ml | 21 ---- + generator/proc_nr.ml | 2 - + gobject/Makefile.inc | 2 - + po/POTFILES | 2 - + 8 files changed, 1 insertion(+), 254 deletions(-) + delete mode 100644 daemon/9p.c + +diff --git a/Makefile.am b/Makefile.am +index 0067d7b7b..e9351eadc 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -78,7 +78,7 @@ SUBDIRS += tests/xfs + SUBDIRS += tests/charsets + SUBDIRS += tests/xml + SUBDIRS += tests/mount-local +-SUBDIRS += tests/9p ++#SUBDIRS += tests/9p + SUBDIRS += tests/rsync + SUBDIRS += tests/bigdirs + SUBDIRS += tests/disk-labels +diff --git a/daemon/9p.c b/daemon/9p.c +deleted file mode 100644 +index 55644249d..000000000 +--- a/daemon/9p.c ++++ /dev/null +@@ -1,224 +0,0 @@ +-/* libguestfs - the guestfsd daemon +- * Copyright (C) 2011 Red Hat Inc. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +- */ +- +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include "daemon.h" +-#include "actions.h" +- +-#define BUS_PATH "/sys/bus/virtio/drivers/9pnet_virtio" +- +-static char *read_whole_file (const char *filename); +- +-/* https://bugzilla.redhat.com/show_bug.cgi?id=714981#c1 */ +-char ** +-do_list_9p (void) +-{ +- CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (r); +- +- DIR *dir; +- +- dir = opendir (BUS_PATH); +- if (!dir) { +- perror ("opendir: " BUS_PATH); +- if (errno != ENOENT) { +- reply_with_perror ("opendir: " BUS_PATH); +- return NULL; +- } +- +- /* If this directory doesn't exist, it probably means that +- * the virtio driver isn't loaded. Don't return an error +- * in this case, but return an empty list. +- */ +- if (end_stringsbuf (&r) == -1) +- return NULL; +- +- return take_stringsbuf (&r); +- } +- +- while (1) { +- struct dirent *d; +- +- errno = 0; +- d = readdir (dir); +- if (d == NULL) break; +- +- if (STRPREFIX (d->d_name, "virtio")) { +- CLEANUP_FREE char *mount_tag_path = NULL; +- if (asprintf (&mount_tag_path, BUS_PATH "/%s/mount_tag", +- d->d_name) == -1) { +- reply_with_perror ("asprintf"); +- closedir (dir); +- return NULL; +- } +- +- /* A bit unclear, but it looks like the virtio transport allows +- * the mount tag length to be unlimited (or up to 65536 bytes). +- * See: linux/include/linux/virtio_9p.h +- */ +- CLEANUP_FREE char *mount_tag = read_whole_file (mount_tag_path); +- if (mount_tag == 0) +- continue; +- +- if (add_string (&r, mount_tag) == -1) { +- closedir (dir); +- return NULL; +- } +- } +- } +- +- /* Check readdir didn't fail */ +- if (errno != 0) { +- reply_with_perror ("readdir: /sys/block"); +- closedir (dir); +- return NULL; +- } +- +- /* Close the directory handle */ +- if (closedir (dir) == -1) { +- reply_with_perror ("closedir: /sys/block"); +- return NULL; +- } +- +- /* Sort the tags. */ +- if (r.size > 0) +- sort_strings (r.argv, r.size); +- +- /* NULL terminate the list */ +- if (end_stringsbuf (&r) == -1) +- return NULL; +- +- return take_stringsbuf (&r); +-} +- +-/* Read whole file into dynamically allocated array. If there is an +- * error, DON'T call reply_with_perror, just return NULL. Returns a +- * \0-terminated string. +- */ +-static char * +-read_whole_file (const char *filename) +-{ +- char *r = NULL; +- size_t alloc = 0, size = 0; +- int fd; +- +- fd = open (filename, O_RDONLY|O_CLOEXEC); +- if (fd == -1) { +- perror (filename); +- return NULL; +- } +- +- while (1) { +- alloc += 256; +- char *r2 = realloc (r, alloc); +- if (r2 == NULL) { +- perror ("realloc"); +- free (r); +- close (fd); +- return NULL; +- } +- r = r2; +- +- /* The '- 1' in the size calculation ensures there is space below +- * to add \0 to the end of the input. +- */ +- ssize_t n = read (fd, r + size, alloc - size - 1); +- if (n == -1) { +- fprintf (stderr, "read: %s: %m\n", filename); +- free (r); +- close (fd); +- return NULL; +- } +- if (n == 0) +- break; +- size += n; +- } +- +- if (close (fd) == -1) { +- fprintf (stderr, "close: %s: %m\n", filename); +- free (r); +- return NULL; +- } +- +- r[size] = '\0'; +- +- return r; +-} +- +-/* Takes optional arguments, consult optargs_bitmask. */ +-int +-do_mount_9p (const char *mount_tag, const char *mountpoint, const char *options) +-{ +- CLEANUP_FREE char *mp = NULL, *opts = NULL, *err = NULL; +- struct stat statbuf; +- int r; +- +- ABS_PATH (mountpoint, 0, return -1); +- +- mp = sysroot_path (mountpoint); +- if (!mp) { +- reply_with_perror ("malloc"); +- return -1; +- } +- +- /* Check the mountpoint exists and is a directory. */ +- if (stat (mp, &statbuf) == -1) { +- reply_with_perror ("%s", mountpoint); +- return -1; +- } +- if (!S_ISDIR (statbuf.st_mode)) { +- reply_with_perror ("%s: mount point is not a directory", mountpoint); +- return -1; +- } +- +- /* Add trans=virtio to the options. */ +- if ((optargs_bitmask & GUESTFS_MOUNT_9P_OPTIONS_BITMASK) && +- STRNEQ (options, "")) { +- if (asprintf (&opts, "trans=virtio,%s", options) == -1) { +- reply_with_perror ("asprintf"); +- return -1; +- } +- } +- else { +- opts = strdup ("trans=virtio"); +- if (opts == NULL) { +- reply_with_perror ("strdup"); +- return -1; +- } +- } +- +- r = command (NULL, &err, +- "mount", "-o", opts, "-t", "9p", mount_tag, mp, NULL); +- if (r == -1) { +- reply_with_error ("%s on %s: %s", mount_tag, mountpoint, err); +- return -1; +- } +- +- return 0; +-} +diff --git a/daemon/Makefile.am b/daemon/Makefile.am +index 5d1c222db..a9b40be25 100644 +--- a/daemon/Makefile.am ++++ b/daemon/Makefile.am +@@ -76,7 +76,6 @@ guestfsd_SOURCES = \ + ../common/protocol/guestfs_protocol.h \ + ../common/utils/cleanups.h \ + ../common/utils/guestfs-utils.h \ +- 9p.c \ + acl.c \ + actions.h \ + available.c \ +diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES +index 7f1c60b30..f45e7124d 100644 +--- a/docs/C_SOURCE_FILES ++++ b/docs/C_SOURCE_FILES +@@ -71,7 +71,6 @@ common/windows/windows.h + customize/crypt-c.c + customize/dummy.c + customize/perl_edit-c.c +-daemon/9p.c + daemon/acl.c + daemon/actions.h + daemon/augeas.c +diff --git a/generator/actions_core.ml b/generator/actions_core.ml +index deda483a9..f466600df 100644 +--- a/generator/actions_core.ml ++++ b/generator/actions_core.ml +@@ -6167,27 +6167,6 @@ This returns true iff the device exists and contains all zero bytes. + + Note that for large devices this can take a long time to run." }; + +- { defaults with +- name = "list_9p"; added = (1, 11, 12); +- style = RStringList (RPlainString, "mounttags"), [], []; +- shortdesc = "list 9p filesystems"; +- longdesc = "\ +-List all 9p filesystems attached to the guest. A list of +-mount tags is returned." }; +- +- { defaults with +- name = "mount_9p"; added = (1, 11, 12); +- style = RErr, [String (PlainString, "mounttag"); String (PlainString, "mountpoint")], [OString "options"]; +- camel_name = "Mount9P"; +- shortdesc = "mount 9p filesystem"; +- longdesc = "\ +-Mount the virtio-9p filesystem with the tag C on the +-directory C. +- +-If required, C will be automatically added to the options. +-Any other options required can be passed in the optional C +-parameter." }; +- + { defaults with + name = "list_dm_devices"; added = (1, 11, 15); + style = RStringList (RDevice, "devices"), [], []; +diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml +index 11a557076..1ef5ba0b7 100644 +--- a/generator/proc_nr.ml ++++ b/generator/proc_nr.ml +@@ -295,8 +295,6 @@ let proc_nr = [ + 282, "internal_autosync"; + 283, "is_zero"; + 284, "is_zero_device"; +-285, "list_9p"; +-286, "mount_9p"; + 287, "list_dm_devices"; + 288, "ntfsresize"; + 289, "btrfs_filesystem_resize"; +diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc +index 067f861a9..7afe83c59 100644 +--- a/gobject/Makefile.inc ++++ b/gobject/Makefile.inc +@@ -93,7 +93,6 @@ guestfs_gobject_headers= \ + include/guestfs-gobject/optargs-mksquashfs.h \ + include/guestfs-gobject/optargs-mkswap.h \ + include/guestfs-gobject/optargs-mktemp.h \ +- include/guestfs-gobject/optargs-mount_9p.h \ + include/guestfs-gobject/optargs-mount_local.h \ + include/guestfs-gobject/optargs-ntfsclone_out.h \ + include/guestfs-gobject/optargs-ntfsfix.h \ +@@ -186,7 +185,6 @@ guestfs_gobject_sources= \ + src/optargs-mksquashfs.c \ + src/optargs-mkswap.c \ + src/optargs-mktemp.c \ +- src/optargs-mount_9p.c \ + src/optargs-mount_local.c \ + src/optargs-ntfsclone_out.c \ + src/optargs-ntfsfix.c \ +diff --git a/po/POTFILES b/po/POTFILES +index 79f4b8c56..b99333d0d 100644 +--- a/po/POTFILES ++++ b/po/POTFILES +@@ -58,7 +58,6 @@ customize/crypt-c.c + customize/dummy.c + customize/perl_edit-c.c + customize/test-password.pl +-daemon/9p.c + daemon/acl.c + daemon/augeas.c + daemon/available.c +@@ -291,7 +290,6 @@ gobject/src/optargs-mkfs_btrfs.c + gobject/src/optargs-mksquashfs.c + gobject/src/optargs-mkswap.c + gobject/src/optargs-mktemp.c +-gobject/src/optargs-mount_9p.c + gobject/src/optargs-mount_local.c + gobject/src/optargs-ntfsclone_out.c + gobject/src/optargs-ntfsfix.c +-- +2.25.4 + diff --git a/SOURCES/0066-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch b/SOURCES/0066-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch deleted file mode 100644 index b660f1e..0000000 --- a/SOURCES/0066-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 101d4d7718eb5a53e44de72bc1337c6d3882f314 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 21 Sep 2015 13:12:43 -0400 -Subject: [PATCH] RHEL 8: tests: Disable daemon tests that require the 'unix' - backend. - ---- - tests/daemon/Makefile.am | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/tests/daemon/Makefile.am b/tests/daemon/Makefile.am -index 053cad3e1..0d723fee4 100644 ---- a/tests/daemon/Makefile.am -+++ b/tests/daemon/Makefile.am -@@ -23,9 +23,7 @@ include $(top_srcdir)/subdir-rules.mk - - check_DATA = captive-daemon.pm - --TESTS = \ -- test-daemon-start.pl \ -- test-btrfs.pl -+TESTS = - - TESTS_ENVIRONMENT = $(top_builddir)/run --test - --- -2.24.1 - diff --git a/SOURCES/0067-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch b/SOURCES/0067-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch new file mode 100644 index 0000000..6037ba5 --- /dev/null +++ b/SOURCES/0067-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch @@ -0,0 +1,609 @@ +From 717d8b6a2d0bb559684a436b4f1bc115ac36d3dd Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 29 Jul 2013 14:47:56 +0100 +Subject: [PATCH] RHEL 8: Disable unsupported remote drive protocols + (RHBZ#962113). + +This disables support for unsupported remote drive protocols: + + * ftp + * ftps + * http + * https + * tftp + * gluster + * iscsi + * sheepdog + * ssh + +Note 'nbd' is not disabled, and of course 'file' works. + +We hope to gradually add some of these back over the lifetime of RHEL 8. +--- + docs/guestfs-testing.pod | 20 ----- + fish/guestfish.pod | 66 ++-------------- + fish/test-add-uri.sh | 32 -------- + generator/actions_core.ml | 50 +------------ + lib/drives.c | 8 ++ + lib/guestfs.pod | 100 ------------------------- + tests/disks/test-qemu-drive-libvirt.sh | 28 ------- + tests/disks/test-qemu-drive.sh | 60 --------------- + 8 files changed, 16 insertions(+), 348 deletions(-) + +diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod +index f558964bf..8f264ed17 100644 +--- a/docs/guestfs-testing.pod ++++ b/docs/guestfs-testing.pod +@@ -109,26 +109,6 @@ image. To exit, type C. + If you get an error, try enabling debugging (add C<-v> to the command + line). Also make sure that L succeeds. + +-=head2 Try to open a remote guest image with guestfish. +- +-You may also have to disable libvirt by setting this: +- +- export LIBGUESTFS_BACKEND=direct +- +-If you have a disk image available over HTTP/FTP, try to open it. +- +- guestfish --ro -i --format=raw -a http://www.example.com/disk.img +- +-For SSH you will need to make sure that ssh-agent is set up so you +-don't need a password to log in to the remote machine. Then a command +-similar to this should work: +- +- guestfish --ro -i --format=raw \ +- -a ssh://remote.example.com/path/to/disk.img +- +-If you get an error, try enabling debugging (add C<-v> to the command +-line). Also make sure that L succeeds. +- + =head2 Run virt-alignment-scan on all your guests. + + Run L on guests or disk images: +diff --git a/fish/guestfish.pod b/fish/guestfish.pod +index f1fdf094d..bacb60e0b 100644 +--- a/fish/guestfish.pod ++++ b/fish/guestfish.pod +@@ -131,9 +131,9 @@ To list what is available do: + + =head2 Remote drives + +-Access a remote disk using ssh: ++Access a remote disk using NBD: + +- guestfish -a ssh://example.com/path/to/disk.img ++ guestfish -a nbd://example.com + + =head2 Remote control + +@@ -1145,12 +1145,12 @@ L>. + On the command line, you can use the I<-a> option to add network + block devices using a URI-style format, for example: + +- guestfish -a ssh://root@example.com/disk.img ++ guestfish -a nbd://example.com + + URIs I be used with the L command. The equivalent + command using the API directly is: + +- > add /disk.img protocol:ssh server:tcp:example.com username:root ++ > add /disk.img protocol:nbd server:tcp:example.com + + The possible I<-a URI> formats are described below. + +@@ -1160,40 +1160,6 @@ The possible I<-a URI> formats are described below. + + Add the local disk image (or device) called F. + +-=head2 B<-a ftp://[user@]example.com[:port]/disk.img> +- +-=head2 B<-a ftps://[user@]example.com[:port]/disk.img> +- +-=head2 B<-a http://[user@]example.com[:port]/disk.img> +- +-=head2 B<-a https://[user@]example.com[:port]/disk.img> +- +-=head2 B<-a tftp://[user@]example.com[:port]/disk.img> +- +-Add a disk located on a remote FTP, HTTP or TFTP server. +- +-The equivalent API command would be: +- +- > add /disk.img protocol:(ftp|...) server:tcp:example.com +- +-=head2 B<-a gluster://example.com[:port]/volname/image> +- +-Add a disk image located on GlusterFS storage. +- +-The server is the one running C, and may be C. +- +-The equivalent API command would be: +- +- > add volname/image protocol:gluster server:tcp:example.com +- +-=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]> +- +-Add a disk located on an iSCSI server. +- +-The equivalent API command would be: +- +- > add target-iqn-name/lun protocol:iscsi server:tcp:example.com +- + =head2 B<-a nbd://example.com[:port]> + + =head2 B<-a nbd://example.com[:port]/exportname> +@@ -1228,35 +1194,13 @@ The equivalent API command would be: + + > add pool/disk protocol:rbd server:tcp:example.com:port + +-=head2 B<-a sheepdog://[example.com[:port]]/volume/image> +- +-Add a disk image located on a Sheepdog volume. +- +-The server name is optional. Although libguestfs and Sheepdog +-supports multiple servers, only at most one server can be specified +-when using this URI syntax. +- +-The equivalent API command would be: +- +- > add volume protocol:sheepdog [server:tcp:example.com] +- +-=head2 B<-a ssh://[user@]example.com[:port]/disk.img> +- +-Add a disk image located on a remote server, accessed using the Secure +-Shell (ssh) SFTP protocol. SFTP is supported out of the box by all +-major SSH servers. +- +-The equivalent API command would be: +- +- > add /disk protocol:ssh server:tcp:example.com [username:user] +- + Note that the URIs follow the syntax of + L: in particular, there + are restrictions on the allowed characters for the various components + of the URI. Characters such as C<:>, C<@>, and C B be + percent-encoded: + +- $ guestfish -a ssh://user:pass%40word@example.com/disk.img ++ $ guestfish -a rbd://user:pass%40word@example.com[:port]/pool/disk + + In this case, the password is C. + +diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh +index 756df997b..8f84fd31b 100755 +--- a/fish/test-add-uri.sh ++++ b/fish/test-add-uri.sh +@@ -40,14 +40,6 @@ function fail () + $VG guestfish -x -a file://$abs_builddir/test-add-uri.img test-add-uri.out 2>&1 + grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail + +-# curl +-$VG guestfish -x -a ftp://user@example.com/disk.img test-add-uri.out 2>&1 +-grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail +- +-# gluster +-$VG guestfish -x -a gluster://example.com/disk test-add-uri.out 2>&1 +-grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail +- + # NBD + $VG guestfish -x -a nbd://example.com test-add-uri.out 2>&1 + grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail +@@ -67,29 +59,5 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te + $VG guestfish -x -a rbd:///pool/disk test-add-uri.out 2>&1 + grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail + +-# sheepdog +-$VG guestfish -x -a sheepdog:///volume/image test-add-uri.out 2>&1 +-grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail +- +-$VG guestfish -x -a sheepdog://example.com:3000/volume/image test-add-uri.out 2>&1 +-grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail +- +-# ssh +-$VG guestfish -x -a ssh://example.com/disk.img test-add-uri.out 2>&1 +-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail +- +-$VG guestfish -x -a ssh://user@example.com/disk.img test-add-uri.out 2>&1 +-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail +- +-$VG guestfish -x -a ssh://user@example.com:2000/disk.img test-add-uri.out 2>&1 +-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail +- +-# iSCSI +-$VG guestfish -x -a iscsi://example.com/iqn.2015-12.com.libguestfs:test1/0 test-add-uri.out 2>&1 +-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test1/0" "protocol:iscsi" "server:tcp:example.com"' test-add-uri.out || fail +- +-$VG guestfish -x -a iscsi://user:password@example.com/iqn.2015-12.com.libguestfs:test2/0 test-add-uri.out 2>&1 +-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test2/0" "protocol:iscsi" "server:tcp:example.com" "username:user" "secret:password"' test-add-uri.out || fail +- + rm test-add-uri.out + rm test-add-uri.img +diff --git a/generator/actions_core.ml b/generator/actions_core.ml +index f466600df..3893d0e8d 100644 +--- a/generator/actions_core.ml ++++ b/generator/actions_core.ml +@@ -297,29 +297,6 @@ F is interpreted as a local file or device. + This is the default if the optional protocol parameter + is omitted. + +-=item C +- +-Connect to a remote FTP, HTTP or TFTP server. +-The C parameter must also be supplied - see below. +- +-See also: L +- +-=item C +- +-Connect to the GlusterFS server. +-The C parameter must also be supplied - see below. +- +-See also: L +- +-=item C +- +-Connect to the iSCSI server. +-The C parameter must also be supplied - see below. +-The C parameter may be supplied. See below. +-The C parameter may be supplied. See below. +- +-See also: L. +- + =item C + + Connect to the Network Block Device server. +@@ -336,22 +313,6 @@ The C parameter may be supplied. See below. + + See also: L. + +-=item C +- +-Connect to the Sheepdog server. +-The C parameter may also be supplied - see below. +- +-See also: L. +- +-=item C +- +-Connect to the Secure Shell (ssh) server. +- +-The C parameter must be supplied. +-The C parameter may be supplied. See below. +- +-See also: L. +- + =back + + =item C +@@ -362,13 +323,8 @@ is a list of server(s). + Protocol Number of servers required + -------- -------------------------- + file List must be empty or param not used at all +- ftp|ftps|http|https|tftp Exactly one +- gluster Exactly one +- iscsi Exactly one + nbd Exactly one + rbd Zero or more +- sheepdog Zero or more +- ssh Exactly one + + Each list element is a string specifying a server. The string must be + in one of the following formats: +@@ -384,10 +340,10 @@ for the protocol is used (see F). + + =item C + +-For the C, C, C, C, C, C, C +-and C protocols, this specifies the remote username. ++For the C ++protocol, this specifies the remote username. + +-If not given, then the local username is used for C, and no authentication ++If not given, then no authentication + is attempted for ceph. But note this sometimes may give unexpected results, for + example if using the libvirt backend and if the libvirt backend is configured to + start the qemu appliance as a special user such as C. If in doubt, +diff --git a/lib/drives.c b/lib/drives.c +index 82ef30093..3d712c6e4 100644 +--- a/lib/drives.c ++++ b/lib/drives.c +@@ -165,6 +165,7 @@ create_drive_non_file (guestfs_h *g, + return drv; + } + ++#if 0 /* DISABLED IN RHEL 8 */ + static struct drive * + create_drive_curl (guestfs_h *g, + const struct drive_create_data *data) +@@ -223,6 +224,7 @@ create_drive_gluster (guestfs_h *g, + + return create_drive_non_file (g, data); + } ++#endif /* DISABLED IN RHEL 8 */ + + static int + nbd_port (void) +@@ -291,6 +293,7 @@ create_drive_rbd (guestfs_h *g, + return create_drive_non_file (g, data); + } + ++#if 0 /* DISABLED IN RHEL 8 */ + static struct drive * + create_drive_sheepdog (guestfs_h *g, + const struct drive_create_data *data) +@@ -391,6 +394,7 @@ create_drive_iscsi (guestfs_h *g, + + return create_drive_non_file (g, data); + } ++#endif /* DISABLED IN RHEL 8 */ + + /** + * Create the special F drive. +@@ -826,6 +830,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, + drv = create_drive_file (g, &data); + } + } ++#if 0 /* DISABLED IN RHEL 8 */ + else if (STREQ (protocol, "ftp")) { + data.protocol = drive_protocol_ftp; + drv = create_drive_curl (g, &data); +@@ -850,6 +855,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, + data.protocol = drive_protocol_iscsi; + drv = create_drive_iscsi (g, &data); + } ++#endif /* DISABLED IN RHEL 8 */ + else if (STREQ (protocol, "nbd")) { + data.protocol = drive_protocol_nbd; + drv = create_drive_nbd (g, &data); +@@ -858,6 +864,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, + data.protocol = drive_protocol_rbd; + drv = create_drive_rbd (g, &data); + } ++#if 0 /* DISABLED IN RHEL 8 */ + else if (STREQ (protocol, "sheepdog")) { + data.protocol = drive_protocol_sheepdog; + drv = create_drive_sheepdog (g, &data); +@@ -870,6 +877,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, + data.protocol = drive_protocol_tftp; + drv = create_drive_curl (g, &data); + } ++#endif /* DISABLED IN RHEL 8 */ + else { + error (g, _("unknown protocol ‘%s’"), protocol); + drv = NULL; /*FALLTHROUGH*/ +diff --git a/lib/guestfs.pod b/lib/guestfs.pod +index af944ddb7..58559a6b4 100644 +--- a/lib/guestfs.pod ++++ b/lib/guestfs.pod +@@ -714,70 +714,6 @@ servers. The server string is documented in + L. The C and C parameters are + also optional, and if not given, then no authentication will be used. + +-=head3 FTP, HTTP AND TFTP +- +-Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS +-or TFTP protocols. +- +-To do this, set the optional C and C parameters of +-L like this: +- +- char **servers = { "www.example.org", NULL }; +- guestfs_add_drive_opts (g, "/disk.img", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "http", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, +- -1); +- +-The C can be one of C<"ftp">, C<"ftps">, C<"http">, +-C<"https"> or C<"tftp">. +- +-C (the C parameter) is a list which must have a +-single element. The single element is a string defining the web, +-FTP or TFTP server. The format of this string is documented in +-L. +- +-=head3 GLUSTER +- +-Libguestfs can access Gluster disks. +- +-To do this, set the optional C and C parameters of +-L like this: +- +- char **servers = { "gluster.example.org:24007", NULL }; +- guestfs_add_drive_opts (g, "volname/image", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "gluster", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, +- -1); +- +-C (the C parameter) is a list which must have a +-single element. The single element is a string defining the Gluster +-server. The format of this string is documented in +-L. +- +-Note that gluster usually requires the client process (ie. libguestfs) +-to run as B and will give unfathomable errors if it is not +-(eg. "No data available"). +- +-=head3 ISCSI +- +-Libguestfs can access iSCSI disks remotely. +- +-To do this, set the optional C and C parameters like +-this: +- +- char **server = { "iscsi.example.org:3000", NULL }; +- guestfs_add_drive_opts (g, "target-iqn-name/lun", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "iscsi", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, +- -1); +- +-The C parameter is a list which must have a single element. +-The single element is a string defining the iSCSI server. The format +-of this string is documented in L. +- + =head3 NETWORK BLOCK DEVICE + + Libguestfs can access Network Block Device (NBD) disks remotely. +@@ -840,42 +776,6 @@ L + + =back + +-=head3 SHEEPDOG +- +-Libguestfs can access Sheepdog disks. +- +-To do this, set the optional C and C parameters of +-L like this: +- +- char **servers = { /* optional servers ... */ NULL }; +- guestfs_add_drive_opts (g, "volume", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "sheepdog", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, +- -1); +- +-The optional list of C may be zero or more server addresses +-(C<"hostname:port">). The format of the server strings is documented +-in L. +- +-=head3 SSH +- +-Libguestfs can access disks over a Secure Shell (SSH) connection. +- +-To do this, set the C and C and (optionally) +-C parameters of L like this: +- +- char **server = { "remote.example.com", NULL }; +- guestfs_add_drive_opts (g, "/path/to/disk.img", +- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", +- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "ssh", +- GUESTFS_ADD_DRIVE_OPTS_SERVER, server, +- GUESTFS_ADD_DRIVE_OPTS_USERNAME, "remoteuser", +- -1); +- +-The format of the server string is documented in +-L. +- + =head2 INSPECTION + + Libguestfs has APIs for inspecting an unknown disk image to find out +diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh +index e49c69b43..9b1abc4ec 100755 +--- a/tests/disks/test-qemu-drive-libvirt.sh ++++ b/tests/disks/test-qemu-drive-libvirt.sh +@@ -64,34 +64,6 @@ check_output + grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2 + rm "$DEBUG_QEMU_FILE" + +-# Gluster. +- +-$guestfish -d gluster run ||: +-check_output +-grep -sq -- '-drive file=gluster://1.2.3.4:1234/volname/image,' "$DEBUG_QEMU_FILE" || fail gluster +-rm "$DEBUG_QEMU_FILE" +- +-# iSCSI. +- +-$guestfish -d iscsi run ||: +-check_output +-grep -sq -- '-drive file=iscsi://1.2.3.4:1234/iqn.2003-01.org.linux-iscsi.fedora' "$DEBUG_QEMU_FILE" || fail iscsi +-rm "$DEBUG_QEMU_FILE" +- +-# NBD. +- +-$guestfish -d nbd run ||: +-check_output +-grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail nbd +-rm "$DEBUG_QEMU_FILE" +- +-# Sheepdog. +- +-$guestfish -d sheepdog run ||: +-check_output +-grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail sheepdog +-rm "$DEBUG_QEMU_FILE" +- + # Local, stored in a pool. + + $guestfish -d pool1 run ||: +diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh +index 19dd60a2f..583e031bd 100755 +--- a/tests/disks/test-qemu-drive.sh ++++ b/tests/disks/test-qemu-drive.sh +@@ -62,45 +62,6 @@ check_output + grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail + rm "$DEBUG_QEMU_FILE" + +-# HTTP. +- +-guestfish < -Date: Thu, 14 Jan 2016 11:53:42 -0500 -Subject: [PATCH] RHEL 8: v2v: Disable the virt-v2v --in-place option. - -This disables the virt-v2v --in-place option which we do not -wish to support in RHEL. -(See commit d0069559a939e47e5f29973ed9a69a13f0b58301). ---- - v2v/Makefile.am | 2 - - v2v/cmdline.ml | 8 +-- - v2v/test-v2v-docs.sh | 1 + - v2v/test-v2v-in-place.sh | 108 --------------------------------------- - v2v/virt-v2v.pod | 48 +---------------- - 5 files changed, 7 insertions(+), 160 deletions(-) - delete mode 100755 v2v/test-v2v-in-place.sh - -diff --git a/v2v/Makefile.am b/v2v/Makefile.am -index 6568c9a6b..affa6f7e9 100644 ---- a/v2v/Makefile.am -+++ b/v2v/Makefile.am -@@ -469,7 +469,6 @@ if HAVE_LIBVIRT - TESTS += \ - test-v2v-cdrom.sh \ - test-v2v-floppy.sh \ -- test-v2v-in-place.sh \ - test-v2v-mac.sh \ - test-v2v-networks-and-bridges.sh \ - test-v2v-no-copy.sh \ -@@ -621,7 +620,6 @@ EXTRA_DIST += \ - test-v2v-i-vmx-3.vmx \ - test-v2v-i-vmx-4.vmx \ - test-v2v-i-vmx-5.vmx \ -- test-v2v-in-place.sh \ - test-v2v-it-vddk-io-query.sh \ - test-v2v-machine-readable.sh \ - test-v2v-mac-expected.xml \ -diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml -index e3578ddcb..19c5a269b 100644 ---- a/v2v/cmdline.ml -+++ b/v2v/cmdline.ml -@@ -230,8 +230,7 @@ let parse_cmdline () = - s_"Use password from file to connect to input hypervisor"; - [ M"it" ], Getopt.String ("transport", set_string_option_once "-it" input_transport), - s_"Input transport"; -- [ L"in-place" ], Getopt.Set in_place, -- s_"Only tune the guest in the input VM"; -+ [ L"in-place" ], Getopt.Set in_place, Getopt.hidden_option_description; - [ L"mac" ], Getopt.String ("mac:network|bridge|ip:out", add_mac), - s_"Map NIC to network or bridge or assign static IP"; - [ S 'n'; L"network" ], Getopt.String ("in:out", add_network), -@@ -369,7 +368,6 @@ read the man page virt-v2v(1). - pr "vddk\n"; - pr "colours-option\n"; - pr "vdsm-compat-option\n"; -- pr "in-place\n"; - pr "io/oo\n"; - pr "mac-option\n"; - pr "mac-ip-option\n"; -@@ -544,6 +542,10 @@ read the man page virt-v2v(1). - error (f_"only ‘-it ssh’ can be used here") in - Input_vmx.input_vmx input_transport arg in - -+ (* Prevent use of --in-place option in RHEL. *) -+ if in_place then -+ error (f_"--in-place cannot be used in RHEL"); -+ - (* Common error message. *) - let error_option_cannot_be_used_in_output_mode mode opt = - error (f_"-o %s: %s option cannot be used in this output mode") mode opt -diff --git a/v2v/test-v2v-docs.sh b/v2v/test-v2v-docs.sh -index dfb12bb14..2e45705a3 100755 ---- a/v2v/test-v2v-docs.sh -+++ b/v2v/test-v2v-docs.sh -@@ -26,6 +26,7 @@ $top_srcdir/podcheck.pl virt-v2v.pod virt-v2v \ - --debug-overlay,\ - --ic,\ - --if,\ -+--in-place,\ - --io,\ - --ip,\ - --it,\ -diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh -deleted file mode 100755 -index 6f7d78f39..000000000 ---- a/v2v/test-v2v-in-place.sh -+++ /dev/null -@@ -1,108 +0,0 @@ --#!/bin/bash - --# libguestfs virt-v2v test script --# Copyright (C) 2014 Red Hat Inc. --# Copyright (C) 2015 Parallels IP Holdings GmbH. --# --# This program is free software; you can redistribute it and/or modify --# it under the terms of the GNU General Public License as published by --# the Free Software Foundation; either version 2 of the License, or --# (at your option) any later version. --# --# This program is distributed in the hope that it will be useful, --# but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU General Public License for more details. --# --# You should have received a copy of the GNU General Public License --# along with this program; if not, write to the Free Software --# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- --# Test --in-place. -- --unset CDPATH --export LANG=C --set -e -- --$TEST_FUNCTIONS --skip_if_skipped --skip_if_backend uml --skip_unless_phony_guest windows.img -- --img_base="$abs_top_builddir/test-data/phony-guests/windows.img" -- --export VIRT_TOOLS_DATA_DIR="$top_srcdir/test-data/fake-virt-tools" --export VIRTIO_WIN="$top_srcdir/test-data/fake-virtio-win" -- --d=$PWD/test-v2v-in-place.d --rm -rf $d --mkdir $d -- --img="$d/test.qcow2" --rm -f $img --qemu-img create -f qcow2 -b $img_base -o compat=1.1,backing_fmt=raw $img --md5="$(do_md5 $img_base)" -- --libvirt_xml="$d/test.xml" --rm -f $libvirt_xml --n=windows-overlay --cat > $libvirt_xml < -- -- $n -- 1048576 -- -- hvm -- -- -- -- -- -- -- -- -- -- -- --EOF -- --$VG virt-v2v --debug-gc -i libvirt -ic "test://$libvirt_xml" $n --in-place -- --# Test that the drivers have been copied over into the guest --script="$d/test.fish" --expected="$d/expected" --response="$d/response" -- --mktest () --{ -- local cmd="$1" exp="$2" -- -- echo "echo '$cmd'" >> "$script" -- echo "$cmd" >> "$expected" -- -- echo "$cmd" >> "$script" -- echo "$exp" >> "$expected" --} -- --:> "$script" --:> "$expected" -- --firstboot_dir="/Program Files/Guestfs/Firstboot" --mktest "is-dir \"$firstboot_dir\"" true --mktest "is-file \"$firstboot_dir/firstboot.bat\"" true --mktest "is-dir \"$firstboot_dir/scripts\"" true --virtio_dir="/Windows/Drivers/VirtIO" --mktest "is-dir \"$virtio_dir\"" true --for drv in netkvm qxl vioscsi viostor; do -- for sfx in cat inf sys; do -- mktest "is-file \"$virtio_dir/$drv.$sfx\"" true -- done --done -- --guestfish --ro -a "$img" -i < "$script" > "$response" --diff -u "$expected" "$response" -- --# Test the base image remained untouched --test "$md5" = "$(do_md5 $img_base)" -- --# Clean up. --rm -r $d -diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod -index bd606592b..092d88635 100644 ---- a/v2v/virt-v2v.pod -+++ b/v2v/virt-v2v.pod -@@ -8,10 +8,6 @@ virt-v2v - Convert a guest to use KVM - [-o mode] [other -o* options] - [guest|filename] - -- virt-v2v --in-place -- [-i mode] [other -i* options] -- [guest|filename] -- - =head1 DESCRIPTION - - Virt-v2v converts a single guest from a foreign hypervisor to run on -@@ -39,9 +35,6 @@ these sides of virt-v2v are documented separately in this manual. - - Virt-v2v normally copies from the input to the output, called "copying - mode". In this case the source guest is always left unchanged. --In-place conversion (I<--in-place>) only uses the I<-i*> options and --modifies the source guest in-place. (See L --below.) - - =head2 Other virt-v2v topics - -@@ -255,20 +248,6 @@ For I<-i disk> only, this specifies the format of the input disk - image. For other input methods you should specify the input - format in the metadata. - --=item B<--in-place> -- --Do not create an output virtual machine in the target hypervisor. --Instead, adjust the guest OS in the source VM to run in the input --hypervisor. -- --This mode is meant for integration with other toolsets, which take the --responsibility of converting the VM configuration, providing for --rollback in case of errors, transforming the storage, etc. -- --See L below. -- --Conflicts with all I<-o *> options. -- - =item B<-io> OPTION=VALUE - - Set input option(s) related to the current input mode or transport. -@@ -1300,7 +1279,7 @@ Minimum free space: 10 MB - =head3 Minimum free space check in the host - - You must have sufficient free space in the host directory used to --store temporary overlays (except in I<--in-place> mode). To find out -+store temporary overlays. To find out - which directory this is, use: - - $ df -h "`guestfish get-cachedir`" -@@ -1403,31 +1382,6 @@ that instead. - - - --=head2 In-place conversion -- --It is also possible to use virt-v2v in scenarios where a foreign VM --has already been imported into a KVM-based hypervisor, but still needs --adjustments in the guest to make it run in the new virtual hardware. -- --In that case it is assumed that a third-party tool has created the --target VM in the supported KVM-based hypervisor based on the source VM --configuration and contents, but using virtual devices more appropriate --for KVM (e.g. virtio storage and network, etc.). -- --Then, to make the guest OS boot and run in the changed environment, --one can use: -- -- virt-v2v -ic qemu:///system converted_vm --in-place -- --Virt-v2v will analyze the configuration of C in the --C libvirt instance, and apply various fixups to the --guest OS configuration to make it match the VM configuration. This --may include installing virtio drivers, configuring the bootloader, the --mountpoints, the network interfaces, and so on. -- --Should an error occur during the operation, virt-v2v exits with an --error code leaving the VM in an undefined state. -- - =head2 Machine readable output - - The I<--machine-readable> option can be used to make the output more --- -2.24.1 - diff --git a/SOURCES/0068-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch b/SOURCES/0068-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch new file mode 100644 index 0000000..28fbee6 --- /dev/null +++ b/SOURCES/0068-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch @@ -0,0 +1,72 @@ +From 3d30c10f351b61c9c9aae54fd8a250af5cd8a61a Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 19 Sep 2014 13:38:20 +0100 +Subject: [PATCH] RHEL 8: Remove User-Mode Linux (RHBZ#1144197). + +This isn't supported in RHEL 8. +--- + lib/launch-uml.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/lib/launch-uml.c b/lib/launch-uml.c +index da20c17d9..a5e0e8179 100644 +--- a/lib/launch-uml.c ++++ b/lib/launch-uml.c +@@ -44,7 +44,9 @@ struct backend_uml_data { + char umid[UML_UMID_LEN+1]; /* umid=<...> unique ID. */ + }; + ++#if 0 + static void print_vmlinux_command_line (guestfs_h *g, char **argv); ++#endif + + /* Run uml_mkcow to create a COW overlay. */ + static char * +@@ -81,6 +83,7 @@ create_cow_overlay_uml (guestfs_h *g, void *datav, struct drive *drv) + return make_cow_overlay (g, drv->src.u.path); + } + ++#if 0 + /* Test for features which are not supported by the UML backend. + * Possibly some of these should just be warnings, not errors. + */ +@@ -128,10 +131,17 @@ uml_supported (guestfs_h *g) + + return true; + } ++#endif + + static int + launch_uml (guestfs_h *g, void *datav, const char *arg) + { ++ error (g, ++ "launch: In RHEL, only the 'libvirt' or 'direct' method is supported.\n" ++ "In particular, User-Mode Linux (UML) is not supported."); ++ return -1; ++ ++#if 0 + struct backend_uml_data *data = datav; + CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (cmdline); + int console_sock = -1, daemon_sock = -1; +@@ -491,8 +501,10 @@ launch_uml (guestfs_h *g, void *datav, const char *arg) + } + g->state = CONFIG; + return -1; ++#endif + } + ++#if 0 + /* This is called from the forked subprocess just before vmlinux runs, + * so it can just print the message straight to stderr, where it will + * be picked up and funnelled through the usual appliance event API. +@@ -522,6 +534,7 @@ print_vmlinux_command_line (guestfs_h *g, char **argv) + + fputc ('\n', stderr); + } ++#endif + + static int + shutdown_uml (guestfs_h *g, void *datav, int check_for_errors) +-- +2.25.4 + diff --git a/SOURCES/0068-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch b/SOURCES/0068-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch deleted file mode 100644 index 7d2b7cc..0000000 --- a/SOURCES/0068-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6ae622c541bdc1128a0a8a6d0cfe7cae29186556 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 2 Mar 2017 14:21:37 +0100 -Subject: [PATCH] RHEL 8: v2v: -i disk: force VNC as display (RHBZ#1372671) - -The SDL output mode is not supported in RHEL 8's qemu-kvm. ---- - v2v/input_disk.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml -index 8321a2a8c..6bd9f43f8 100644 ---- a/v2v/input_disk.ml -+++ b/v2v/input_disk.ml -@@ -89,7 +89,7 @@ class input_disk input_format disk = object - s_features = [ "acpi"; "apic"; "pae" ]; - s_firmware = UnknownFirmware; (* causes virt-v2v to autodetect *) - s_display = -- Some { s_display_type = Window; s_keymap = None; s_password = None; -+ Some { s_display_type = VNC; s_keymap = None; s_password = None; - s_listen = LNoListen; s_port = None }; - s_video = None; - s_sound = None; --- -2.24.1 - diff --git a/SOURCES/0069-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch b/SOURCES/0069-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch new file mode 100644 index 0000000..567b1cc --- /dev/null +++ b/SOURCES/0069-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch @@ -0,0 +1,33 @@ +From fbc5eea00f9f9cd27a1c53913e58f8a4937fd067 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sun, 28 Sep 2014 19:14:43 +0100 +Subject: [PATCH] RHEL 8: v2v: Select correct qemu binary for -o qemu mode + (RHBZ#1147313). + +RHEL 8 does not have qemu-system-x86_64 (etc), and in addition the +qemu binary is located in /usr/libexec. Encode the path to this +binary directly in the script. + +Note that we don't support people running qemu directly like this. +It's just for quick testing of converted VMs, and to help us with +support cases. +--- + v2v/output_qemu.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v2v/output_qemu.ml b/v2v/output_qemu.ml +index 1f6798aaf..8665d7b5c 100644 +--- a/v2v/output_qemu.ml ++++ b/v2v/output_qemu.ml +@@ -81,7 +81,7 @@ object + * module deals with shell and qemu comma quoting. + *) + let cmd = Qemuopts.create () in +- Qemuopts.set_binary_by_arch cmd (Some guestcaps.gcaps_arch); ++ Qemuopts.set_binary cmd "/usr/libexec/qemu-kvm"; + + let flag = Qemuopts.flag cmd + and arg = Qemuopts.arg cmd +-- +2.25.4 + diff --git a/SOURCES/0069-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch b/SOURCES/0069-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch deleted file mode 100644 index a1b494e..0000000 --- a/SOURCES/0069-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b60599b78bdf31c289767b01c235580534f52f77 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Wed, 8 Mar 2017 11:03:40 +0100 -Subject: [PATCH] RHEL 8: v2v: do not mention SUSE Xen hosts (RHBZ#1430203) - -They are not supported in RHEL 8. ---- - v2v/virt-v2v-input-xen.pod | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/v2v/virt-v2v-input-xen.pod b/v2v/virt-v2v-input-xen.pod -index 9fd5065f1..c3c20a6b6 100644 ---- a/v2v/virt-v2v-input-xen.pod -+++ b/v2v/virt-v2v-input-xen.pod -@@ -10,7 +10,7 @@ virt-v2v-input-xen - Using virt-v2v to convert guests from Xen - =head1 DESCRIPTION - - This page documents how to use L to convert guests from --RHEL 5 Xen, or SLES and OpenSUSE Xen hosts. -+RHEL 5 Xen hosts. - - =head1 INPUT FROM XEN - --- -2.24.1 - diff --git a/SOURCES/0070-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch b/SOURCES/0070-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch new file mode 100644 index 0000000..038b7f2 --- /dev/null +++ b/SOURCES/0070-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch @@ -0,0 +1,105 @@ +From ec11bac4af65a54400739e476bf90fe815073619 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 30 Sep 2014 10:50:27 +0100 +Subject: [PATCH] RHEL 8: v2v: Disable the --qemu-boot option (RHBZ#1147313). + +This cannot work because there is no Gtk or SDL output mode +in RHEL 8's qemu-kvm. + +In addition you will have to edit the -display option in the +qemu script. +--- + v2v/cmdline.ml | 3 ++- + v2v/virt-v2v-output-local.pod | 6 ++---- + v2v/virt-v2v.pod | 13 ------------- + 3 files changed, 4 insertions(+), 18 deletions(-) + +diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml +index 686631271..e3578ddcb 100644 +--- a/v2v/cmdline.ml ++++ b/v2v/cmdline.ml +@@ -262,7 +262,6 @@ let parse_cmdline () = + s_"Estimate size of source and stop"; + [ L"print-source" ], Getopt.Set print_source, + s_"Print source and stop"; +- [ L"qemu-boot" ], Getopt.Set qemu_boot, s_"Boot in qemu (-o qemu only)"; + [ L"root" ], Getopt.String ("ask|... ", set_root_choice), + s_"How to choose root filesystem"; + [ L"vddk-config" ], Getopt.String ("filename", set_input_option_compat "vddk-config"), +@@ -640,6 +639,8 @@ read the man page virt-v2v(1). + | Some d when not (is_directory d) -> + error (f_"-os %s: output directory does not exist or is not a directory") d + | Some d -> d in ++ if qemu_boot then ++ error (f_"-o qemu: the --qemu-boot option cannot be used in RHEL"); + Output_qemu.output_qemu os qemu_boot, + output_format, output_alloc + +diff --git a/v2v/virt-v2v-output-local.pod b/v2v/virt-v2v-output-local.pod +index 7c397c0a4..09a11a7b0 100644 +--- a/v2v/virt-v2v-output-local.pod ++++ b/v2v/virt-v2v-output-local.pod +@@ -9,7 +9,7 @@ or libvirt + + virt-v2v [-i* options] -o local -os DIRECTORY + +- virt-v2v [-i* options] -o qemu -os DIRECTORY [--qemu-boot] ++ virt-v2v [-i* options] -o qemu -os DIRECTORY + + virt-v2v [-i* options] -o json -os DIRECTORY + [-oo json-disks-pattern=PATTERN] +@@ -50,12 +50,10 @@ where C is the guest name. + + =item B<-o qemu -os> C + +-=item B<-o qemu -os> C B<--qemu-boot> +- + This converts the guest to files in C. Unlike I<-o local> + above, a shell script is created which contains the raw qemu command + you would need to boot the guest. However the shell script is not +-run, I you also add the I<--qemu-boot> option. ++run. + + =item B<-o json -os> C + +diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod +index 25041d0ec..bd606592b 100644 +--- a/v2v/virt-v2v.pod ++++ b/v2v/virt-v2v.pod +@@ -142,11 +142,6 @@ Since F contains the path(s) to the guest disk + image(s) you do not need to specify the name of the disk image on the + command line. + +-To convert a local disk image and immediately boot it in local +-qemu, do: +- +- virt-v2v -i disk disk.img -o qemu -os /var/tmp --qemu-boot +- + =head1 OPTIONS + + =over 4 +@@ -510,9 +505,6 @@ This is similar to I<-o local>, except that a shell script is written + which you can use to boot the guest in qemu. The converted disks and + shell script are written to the directory specified by I<-os>. + +-When using this output mode, you can also specify the I<--qemu-boot> +-option which boots the guest under qemu immediately. +- + =item B<-o> B + + This is the same as I<-o rhv>. +@@ -788,11 +780,6 @@ Print information about the source guest and stop. This option is + useful when you are setting up network and bridge maps. + See L. + +-=item B<--qemu-boot> +- +-When using I<-o qemu> only, this boots the guest immediately after +-virt-v2v finishes. +- + =item B<-q> + + =item B<--quiet> +-- +2.25.4 + diff --git a/SOURCES/0070-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch b/SOURCES/0070-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch deleted file mode 100644 index a801aac..0000000 --- a/SOURCES/0070-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch +++ /dev/null @@ -1,91 +0,0 @@ -From a233d0f924d7c052bbd663a8e1d47fe363de120c Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Mon, 14 May 2018 10:16:58 +0100 -Subject: [PATCH] RHEL 8: v2v: rhv-upload: Remove restriction on -oa sparse. - -See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681 -and the v2v-devel private thread "Do we already support migration using FC?" ---- - v2v/output_rhv_upload.ml | 11 +---------- - v2v/rhv-upload-plugin.py | 4 +--- - v2v/virt-v2v-output-rhv.pod | 8 +------- - 3 files changed, 3 insertions(+), 20 deletions(-) - -diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml -index e1d06867b..3f078157a 100644 ---- a/v2v/output_rhv_upload.ml -+++ b/v2v/output_rhv_upload.ml -@@ -177,19 +177,11 @@ See also the virt-v2v-output-rhv(1) manual.") - error (f_"nbdkit was compiled without SELinux support. You will have to recompile nbdkit with libselinux-devel installed, or else set SELinux to Permissive mode while doing the conversion.") - in - -- (* Output format/sparse must be raw/sparse. We may be able to -- * lift this limitation in future, but it requires changes on the -- * RHV side. See TODO file for details. XXX -- *) -+ (* Output format must be raw. *) - 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 - in - -- let error_unless_output_alloc_sparse () = -- if output_alloc <> Sparse then -- error_current_limitation "-oa sparse" -- in -- - (* JSON parameters which are invariant between disks. *) - let json_params = [ - "verbose", JSON.Bool (verbose ()); -@@ -249,7 +241,6 @@ object - error_unless_ovirtsdk4_module_available (); - error_unless_nbdkit_working (); - error_unless_nbdkit_python_plugin_working (); -- error_unless_output_alloc_sparse (); - (* Python code prechecks. *) - let precheck_fn = tmpdir // "v2vprecheck.json" in - let fd = Unix.openfile precheck_fn [O_WRONLY; O_CREAT] 0o600 in -diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py -index 14d4e37fb..c7f7a5e8b 100644 ---- a/v2v/rhv-upload-plugin.py -+++ b/v2v/rhv-upload-plugin.py -@@ -142,10 +142,8 @@ def open(readonly): - format = disk_format, - 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, -+ sparse = params['output_sparse'], - storage_domains = [ - types.StorageDomain( - name = params['output_storage'], -diff --git a/v2v/virt-v2v-output-rhv.pod b/v2v/virt-v2v-output-rhv.pod -index 4520c9184..f6579a48e 100644 ---- a/v2v/virt-v2v-output-rhv.pod -+++ b/v2v/virt-v2v-output-rhv.pod -@@ -5,7 +5,7 @@ virt-v2v-output-rhv - Using virt-v2v to convert guests to oVirt or RHV - =head1 SYNOPSIS - - virt-v2v [-i* options] -o rhv-upload [-oc ENGINE_URL] -os STORAGE -- [-op PASSWORD] [-of raw] -+ [-op PASSWORD] - [-oo rhv-cafile=FILE] - [-oo rhv-cluster=CLUSTER] - [-oo rhv-direct] -@@ -79,12 +79,6 @@ username is not specified then virt-v2v defaults to using - C which is the typical superuser account for oVirt - instances. - --=item I<-of raw> -- --Currently you must use I<-of raw> and you cannot use I<-oa preallocated>. -- --These restrictions will be loosened in a future version. -- - =item I<-op> F - - A file containing a password to be used when connecting to the oVirt --- -2.24.1 - diff --git a/SOURCES/0071-RHEL-8-Disable-alternate-Augeas-lenses.patch b/SOURCES/0071-RHEL-8-Disable-alternate-Augeas-lenses.patch new file mode 100644 index 0000000..caafc5b --- /dev/null +++ b/SOURCES/0071-RHEL-8-Disable-alternate-Augeas-lenses.patch @@ -0,0 +1,60 @@ +From 0abf9c24495d577d20fe0d972212dec4eb2b2e73 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Fri, 24 Oct 2014 16:33:50 +0100 +Subject: [PATCH] RHEL 8: Disable alternate Augeas lenses. + +These are included in the RHEL augeas package, and therefore not +required. + +See: +https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html +--- + appliance/Makefile.am | 1 - + daemon/augeas.c | 5 ++++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/appliance/Makefile.am b/appliance/Makefile.am +index fc424b1d0..5efc5c036 100644 +--- a/appliance/Makefile.am ++++ b/appliance/Makefile.am +@@ -91,7 +91,6 @@ supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug + rm -rf tmp-d + mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs + ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd +- ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug + ( cd tmp-d && tar zcf - * ) > $@-t + rm -r tmp-d + mv $@-t $@ +diff --git a/daemon/augeas.c b/daemon/augeas.c +index 453251337..5bbfffa2d 100644 +--- a/daemon/augeas.c ++++ b/daemon/augeas.c +@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags) + } + + /* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */ +- aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE); ++ aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE); + + if (!aug) { + reply_with_error ("augeas initialization failed"); +@@ -148,6 +148,8 @@ do_aug_init (const char *root, int flags) + return -1; + } + ++ /* We already have the needed lenses in RHEL 8 */ ++#if 0 + if (!augeas_is_version (1, 2, 1)) { + int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow", + 0 /* = included */); +@@ -166,6 +168,7 @@ do_aug_init (const char *root, int flags) + } + } + } ++#endif + + return 0; + } +-- +2.25.4 + diff --git a/SOURCES/0071-RHEL-8-use-platform-python.patch b/SOURCES/0071-RHEL-8-use-platform-python.patch deleted file mode 100644 index f2685aa..0000000 --- a/SOURCES/0071-RHEL-8-use-platform-python.patch +++ /dev/null @@ -1,27 +0,0 @@ -From c5212d2acda7eb21923e376f7c7b0d8ce8a108d1 Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Sun, 16 Dec 2018 16:42:46 +0100 -Subject: [PATCH] RHEL 8: use platform-python - -Use the stable platform-python provided in BaseOS, instead of relying on -some arbitrary version installed by the user. ---- - v2v/python_script.ml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/v2v/python_script.ml b/v2v/python_script.ml -index 3159373a1..f2c00c40f 100644 ---- a/v2v/python_script.ml -+++ b/v2v/python_script.ml -@@ -24,7 +24,7 @@ open Unix_utils - - open Common_gettext.Gettext - --let python = "python3" (* Defined by PEP 394 *) -+let python = "/usr/libexec/platform-python" - - type script = { - tmpdir : string; (* Temporary directory. *) --- -2.24.1 - diff --git a/SOURCES/0072-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch b/SOURCES/0072-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch new file mode 100644 index 0000000..d1094d3 --- /dev/null +++ b/SOURCES/0072-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch @@ -0,0 +1,34 @@ +From c5db36832644bb6330f90670e799d59cef3d6771 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Fri, 24 Apr 2015 09:45:41 -0400 +Subject: [PATCH] RHEL 8: Fix list of supported sound cards to match RHEL qemu + (RHBZ#1176493). + +--- + v2v/utils.ml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/v2v/utils.ml b/v2v/utils.ml +index 74b501f81..21e9c9c15 100644 +--- a/v2v/utils.ml ++++ b/v2v/utils.ml +@@ -51,13 +51,14 @@ let kvm_arch = function + (* Does qemu support the given sound card? *) + let qemu_supports_sound_card = function + | Types.AC97 +- | Types.ES1370 + | Types.ICH6 + | Types.ICH9 + | Types.PCSpeaker ++ -> true ++ | Types.ES1370 + | Types.SB16 + | Types.USBAudio +- -> true ++ -> false + + (* Find the UEFI firmware. *) + let find_uefi_firmware guest_arch = +-- +2.25.4 + diff --git a/SOURCES/0072-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch b/SOURCES/0072-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch deleted file mode 100644 index b4dc9a1..0000000 --- a/SOURCES/0072-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch +++ /dev/null @@ -1,125 +0,0 @@ -From b70c61045e659720ee8f7dbd8eff643a877e8e2f Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Tue, 26 Mar 2019 09:42:25 +0100 -Subject: [PATCH] RHEL 8: point to KB for supported v2v hypervisors/guests - ---- - v2v/virt-v2v-support.pod | 102 ++------------------------------------- - 1 file changed, 4 insertions(+), 98 deletions(-) - -diff --git a/v2v/virt-v2v-support.pod b/v2v/virt-v2v-support.pod -index a22506068..4ec1a07c1 100644 ---- a/v2v/virt-v2v-support.pod -+++ b/v2v/virt-v2v-support.pod -@@ -8,104 +8,10 @@ systems and guests in virt-v2v - This page documents which foreign hypervisors, virtualization - management systems and guest types that L can support. - --Note this page applies to upstream virt-v2v from --L and in downstream distributions of virt-v2v --sometimes features are intentionally removed, or are present but not --supported. -- --=head2 Hypervisors (Input) -- --=over 4 -- --=item VMware ESXi -- --Must be managed by VMware vCenter E 5.0 unless VDDK is available. -- --=item OVA exported from VMware -- --OVAs from other hypervisors will not work. -- --=item VMX from VMware -- --VMX files generated by other hypervisors will not work. -- --=item RHEL 5 Xen -- --=item SUSE Xen -- --=item Citrix Xen -- --Citrix Xen has not been recently tested. -- --=item Hyper-V -- --Not recently tested. Requires that you export the disk or use --L on Hyper-V. -- --=item Direct from disk images -- --Only disk images exported from supported hypervisors, and using --container formats supported by qemu. -- --=item Physical machines -- --Using the L tool. -- --=back -- --=head2 Hypervisors (Output) -- --QEMU and KVM only. -- --=head2 Virtualization management systems (Output) -- --=over 4 -- --=item OpenStack -- --=item Red Hat Virtualization (RHV) 4.1 and up -- --=item Local libvirt -- --And hence L, L, and similar tools. -- --=item Local disk -- --=back -- --=head2 Guests -- --=over 4 -- --=item Red Hat Enterprise Linux 3, 4, 5, 6, 7 -- --=item CentOS 3, 4, 5, 6, 7 -- --=item Scientific Linux 3, 4, 5, 6, 7 -- --=item Oracle Linux -- --=item Fedora -- --=item SLES 10 and up -- --=item OpenSUSE 10 and up -- --=item Debian 6 and up -- --=item Ubuntu 10.04, 12.04, 14.04, 16.04, and up -- --=item Windows XP to Windows 10 / Windows Server 2016 -- --We use Windows internal version numbers, see --L -- --Currently NT 5.2 to NT 6.3 are supported. -- --See L below for additional notes on converting Windows --guests. -- --=back -+For more information on supported hypervisors, and guest types in -+RHEL, please consult the following Knowledgebase article on these -+Red Hat Customer Portal: -+L. - - =head2 Guest firmware - --- -2.24.1 - diff --git a/SOURCES/0073-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch b/SOURCES/0073-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch new file mode 100644 index 0000000..6105bed --- /dev/null +++ b/SOURCES/0073-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch @@ -0,0 +1,40 @@ +From dcd37841d19c43f5874b11a1f81e578df49d58e6 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 7 Jul 2015 09:28:03 -0400 +Subject: [PATCH] RHEL 8: Reject use of libguestfs-winsupport features except + for virt-* tools (RHBZ#1240276). + +--- + generator/c.ml | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/generator/c.ml b/generator/c.ml +index 86f7d89a3..b5bb99f53 100644 +--- a/generator/c.ml ++++ b/generator/c.ml +@@ -1832,6 +1832,22 @@ and generate_client_actions actions () = + check_args_validity c_name style; + trace_call name c_name style; + ++ (* RHEL 8 *) ++ if name = "mount" || name = "mount_ro" || name = "mount_options" || ++ name = "mount_vfs" then ( ++ pr " if (g->program && !STRPREFIX (g->program, \"virt-\")) {\n"; ++ pr " CLEANUP_FREE char *vfs_type = guestfs_vfs_type (g, mountable);\n"; ++ pr " if (vfs_type && STREQ (vfs_type, \"ntfs\")) {\n"; ++ pr " error (g, \"mount: unsupported filesystem type\");\n"; ++ pr " if (trace_flag)\n"; ++ pr " guestfs_int_trace (g, \"%%s = %%s (error)\",\n"; ++ pr " \"%s\", \"-1\");\n" name; ++ pr " return %s;\n" (string_of_errcode errcode); ++ pr " }\n"; ++ pr " }\n"; ++ pr "\n"; ++ ); ++ + (* Calculate the total size of all FileIn arguments to pass + * as a progress bar hint. + *) +-- +2.25.4 + diff --git a/SOURCES/0074-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch b/SOURCES/0074-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch new file mode 100644 index 0000000..0b21bba --- /dev/null +++ b/SOURCES/0074-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch @@ -0,0 +1,93 @@ +From e17bc8207168c45b2e887decc0a19b5689798b0b Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sun, 30 Aug 2015 03:21:57 -0400 +Subject: [PATCH] RHEL 8: Fix tests for libguestfs-winsupport. + +It doesn't let us use guestfish for arbitrary Windows edits. +--- + test-data/phony-guests/make-windows-img.sh | 1 + + tests/charsets/test-charset-fidelity.c | 2 ++ + v2v/test-v2v-virtio-win-iso.sh | 8 +++++++- + v2v/test-v2v-windows-conversion.sh | 8 +++++++- + 4 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh +index 8676b5ac0..1a88d9fc9 100755 +--- a/test-data/phony-guests/make-windows-img.sh ++++ b/test-data/phony-guests/make-windows-img.sh +@@ -37,6 +37,7 @@ fi + + # Create a disk image. + guestfish < "$script" + :> "$expected" + ++cat >> "$script" < "$response" ++guestfish --ro -a "$d/windows-sda" < "$script" > "$response" + diff -u "$expected" "$response" + + rm -r $d +diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh +index f1da222a9..ff94fe39b 100755 +--- a/v2v/test-v2v-windows-conversion.sh ++++ b/v2v/test-v2v-windows-conversion.sh +@@ -73,6 +73,12 @@ mktest () + :> "$script" + :> "$expected" + ++cat >> "$script" < "$response" ++guestfish --ro -a "$d/windows-sda" < "$script" > "$response" + diff -u "$expected" "$response" + + # We also update the Registry several times, for firstboot, and (ONLY +-- +2.25.4 + diff --git a/SOURCES/0075-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch b/SOURCES/0075-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch new file mode 100644 index 0000000..71a4655 --- /dev/null +++ b/SOURCES/0075-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch @@ -0,0 +1,28 @@ +From fbda37c7b2819300b6b09d2b0b84cec547fdd00e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 21 Sep 2015 13:12:43 -0400 +Subject: [PATCH] RHEL 8: tests: Disable daemon tests that require the 'unix' + backend. + +--- + tests/daemon/Makefile.am | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/tests/daemon/Makefile.am b/tests/daemon/Makefile.am +index 053cad3e1..0d723fee4 100644 +--- a/tests/daemon/Makefile.am ++++ b/tests/daemon/Makefile.am +@@ -23,9 +23,7 @@ include $(top_srcdir)/subdir-rules.mk + + check_DATA = captive-daemon.pm + +-TESTS = \ +- test-daemon-start.pl \ +- test-btrfs.pl ++TESTS = + + TESTS_ENVIRONMENT = $(top_builddir)/run --test + +-- +2.25.4 + diff --git a/SOURCES/0076-RHEL-8-v2v-Disable-the-virt-v2v-in-place-option.patch b/SOURCES/0076-RHEL-8-v2v-Disable-the-virt-v2v-in-place-option.patch new file mode 100644 index 0000000..c261226 --- /dev/null +++ b/SOURCES/0076-RHEL-8-v2v-Disable-the-virt-v2v-in-place-option.patch @@ -0,0 +1,286 @@ +From d6e49b3cd141cdf573e1e4f59d248007f3658435 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 14 Jan 2016 11:53:42 -0500 +Subject: [PATCH] RHEL 8: v2v: Disable the virt-v2v --in-place option. + +This disables the virt-v2v --in-place option which we do not +wish to support in RHEL. +(See commit d0069559a939e47e5f29973ed9a69a13f0b58301). +--- + v2v/Makefile.am | 2 - + v2v/cmdline.ml | 8 +-- + v2v/test-v2v-docs.sh | 1 + + v2v/test-v2v-in-place.sh | 108 --------------------------------------- + v2v/virt-v2v.pod | 48 +---------------- + 5 files changed, 7 insertions(+), 160 deletions(-) + delete mode 100755 v2v/test-v2v-in-place.sh + +diff --git a/v2v/Makefile.am b/v2v/Makefile.am +index 6568c9a6b..affa6f7e9 100644 +--- a/v2v/Makefile.am ++++ b/v2v/Makefile.am +@@ -469,7 +469,6 @@ if HAVE_LIBVIRT + TESTS += \ + test-v2v-cdrom.sh \ + test-v2v-floppy.sh \ +- test-v2v-in-place.sh \ + test-v2v-mac.sh \ + test-v2v-networks-and-bridges.sh \ + test-v2v-no-copy.sh \ +@@ -621,7 +620,6 @@ EXTRA_DIST += \ + test-v2v-i-vmx-3.vmx \ + test-v2v-i-vmx-4.vmx \ + test-v2v-i-vmx-5.vmx \ +- test-v2v-in-place.sh \ + test-v2v-it-vddk-io-query.sh \ + test-v2v-machine-readable.sh \ + test-v2v-mac-expected.xml \ +diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml +index e3578ddcb..19c5a269b 100644 +--- a/v2v/cmdline.ml ++++ b/v2v/cmdline.ml +@@ -230,8 +230,7 @@ let parse_cmdline () = + s_"Use password from file to connect to input hypervisor"; + [ M"it" ], Getopt.String ("transport", set_string_option_once "-it" input_transport), + s_"Input transport"; +- [ L"in-place" ], Getopt.Set in_place, +- s_"Only tune the guest in the input VM"; ++ [ L"in-place" ], Getopt.Set in_place, Getopt.hidden_option_description; + [ L"mac" ], Getopt.String ("mac:network|bridge|ip:out", add_mac), + s_"Map NIC to network or bridge or assign static IP"; + [ S 'n'; L"network" ], Getopt.String ("in:out", add_network), +@@ -369,7 +368,6 @@ read the man page virt-v2v(1). + pr "vddk\n"; + pr "colours-option\n"; + pr "vdsm-compat-option\n"; +- pr "in-place\n"; + pr "io/oo\n"; + pr "mac-option\n"; + pr "mac-ip-option\n"; +@@ -544,6 +542,10 @@ read the man page virt-v2v(1). + error (f_"only ‘-it ssh’ can be used here") in + Input_vmx.input_vmx input_transport arg in + ++ (* Prevent use of --in-place option in RHEL. *) ++ if in_place then ++ error (f_"--in-place cannot be used in RHEL"); ++ + (* Common error message. *) + let error_option_cannot_be_used_in_output_mode mode opt = + error (f_"-o %s: %s option cannot be used in this output mode") mode opt +diff --git a/v2v/test-v2v-docs.sh b/v2v/test-v2v-docs.sh +index dfb12bb14..2e45705a3 100755 +--- a/v2v/test-v2v-docs.sh ++++ b/v2v/test-v2v-docs.sh +@@ -26,6 +26,7 @@ $top_srcdir/podcheck.pl virt-v2v.pod virt-v2v \ + --debug-overlay,\ + --ic,\ + --if,\ ++--in-place,\ + --io,\ + --ip,\ + --it,\ +diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh +deleted file mode 100755 +index 6f7d78f39..000000000 +--- a/v2v/test-v2v-in-place.sh ++++ /dev/null +@@ -1,108 +0,0 @@ +-#!/bin/bash - +-# libguestfs virt-v2v test script +-# Copyright (C) 2014 Red Hat Inc. +-# Copyright (C) 2015 Parallels IP Holdings GmbH. +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +- +-# Test --in-place. +- +-unset CDPATH +-export LANG=C +-set -e +- +-$TEST_FUNCTIONS +-skip_if_skipped +-skip_if_backend uml +-skip_unless_phony_guest windows.img +- +-img_base="$abs_top_builddir/test-data/phony-guests/windows.img" +- +-export VIRT_TOOLS_DATA_DIR="$top_srcdir/test-data/fake-virt-tools" +-export VIRTIO_WIN="$top_srcdir/test-data/fake-virtio-win" +- +-d=$PWD/test-v2v-in-place.d +-rm -rf $d +-mkdir $d +- +-img="$d/test.qcow2" +-rm -f $img +-qemu-img create -f qcow2 -b $img_base -o compat=1.1,backing_fmt=raw $img +-md5="$(do_md5 $img_base)" +- +-libvirt_xml="$d/test.xml" +-rm -f $libvirt_xml +-n=windows-overlay +-cat > $libvirt_xml < +- +- $n +- 1048576 +- +- hvm +- +- +- +- +- +- +- +- +- +- +- +-EOF +- +-$VG virt-v2v --debug-gc -i libvirt -ic "test://$libvirt_xml" $n --in-place +- +-# Test that the drivers have been copied over into the guest +-script="$d/test.fish" +-expected="$d/expected" +-response="$d/response" +- +-mktest () +-{ +- local cmd="$1" exp="$2" +- +- echo "echo '$cmd'" >> "$script" +- echo "$cmd" >> "$expected" +- +- echo "$cmd" >> "$script" +- echo "$exp" >> "$expected" +-} +- +-:> "$script" +-:> "$expected" +- +-firstboot_dir="/Program Files/Guestfs/Firstboot" +-mktest "is-dir \"$firstboot_dir\"" true +-mktest "is-file \"$firstboot_dir/firstboot.bat\"" true +-mktest "is-dir \"$firstboot_dir/scripts\"" true +-virtio_dir="/Windows/Drivers/VirtIO" +-mktest "is-dir \"$virtio_dir\"" true +-for drv in netkvm qxl vioscsi viostor; do +- for sfx in cat inf sys; do +- mktest "is-file \"$virtio_dir/$drv.$sfx\"" true +- done +-done +- +-guestfish --ro -a "$img" -i < "$script" > "$response" +-diff -u "$expected" "$response" +- +-# Test the base image remained untouched +-test "$md5" = "$(do_md5 $img_base)" +- +-# Clean up. +-rm -r $d +diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod +index bd606592b..092d88635 100644 +--- a/v2v/virt-v2v.pod ++++ b/v2v/virt-v2v.pod +@@ -8,10 +8,6 @@ virt-v2v - Convert a guest to use KVM + [-o mode] [other -o* options] + [guest|filename] + +- virt-v2v --in-place +- [-i mode] [other -i* options] +- [guest|filename] +- + =head1 DESCRIPTION + + Virt-v2v converts a single guest from a foreign hypervisor to run on +@@ -39,9 +35,6 @@ these sides of virt-v2v are documented separately in this manual. + + Virt-v2v normally copies from the input to the output, called "copying + mode". In this case the source guest is always left unchanged. +-In-place conversion (I<--in-place>) only uses the I<-i*> options and +-modifies the source guest in-place. (See L +-below.) + + =head2 Other virt-v2v topics + +@@ -255,20 +248,6 @@ For I<-i disk> only, this specifies the format of the input disk + image. For other input methods you should specify the input + format in the metadata. + +-=item B<--in-place> +- +-Do not create an output virtual machine in the target hypervisor. +-Instead, adjust the guest OS in the source VM to run in the input +-hypervisor. +- +-This mode is meant for integration with other toolsets, which take the +-responsibility of converting the VM configuration, providing for +-rollback in case of errors, transforming the storage, etc. +- +-See L below. +- +-Conflicts with all I<-o *> options. +- + =item B<-io> OPTION=VALUE + + Set input option(s) related to the current input mode or transport. +@@ -1300,7 +1279,7 @@ Minimum free space: 10 MB + =head3 Minimum free space check in the host + + You must have sufficient free space in the host directory used to +-store temporary overlays (except in I<--in-place> mode). To find out ++store temporary overlays. To find out + which directory this is, use: + + $ df -h "`guestfish get-cachedir`" +@@ -1403,31 +1382,6 @@ that instead. + + + +-=head2 In-place conversion +- +-It is also possible to use virt-v2v in scenarios where a foreign VM +-has already been imported into a KVM-based hypervisor, but still needs +-adjustments in the guest to make it run in the new virtual hardware. +- +-In that case it is assumed that a third-party tool has created the +-target VM in the supported KVM-based hypervisor based on the source VM +-configuration and contents, but using virtual devices more appropriate +-for KVM (e.g. virtio storage and network, etc.). +- +-Then, to make the guest OS boot and run in the changed environment, +-one can use: +- +- virt-v2v -ic qemu:///system converted_vm --in-place +- +-Virt-v2v will analyze the configuration of C in the +-C libvirt instance, and apply various fixups to the +-guest OS configuration to make it match the VM configuration. This +-may include installing virtio drivers, configuring the bootloader, the +-mountpoints, the network interfaces, and so on. +- +-Should an error occur during the operation, virt-v2v exits with an +-error code leaving the VM in an undefined state. +- + =head2 Machine readable output + + The I<--machine-readable> option can be used to make the output more +-- +2.25.4 + diff --git a/SOURCES/0077-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch b/SOURCES/0077-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch new file mode 100644 index 0000000..fbab859 --- /dev/null +++ b/SOURCES/0077-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch @@ -0,0 +1,26 @@ +From ce7a5cc371d6f6e0f96c2cd897245a2e83839c20 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 2 Mar 2017 14:21:37 +0100 +Subject: [PATCH] RHEL 8: v2v: -i disk: force VNC as display (RHBZ#1372671) + +The SDL output mode is not supported in RHEL 8's qemu-kvm. +--- + v2v/input_disk.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v2v/input_disk.ml b/v2v/input_disk.ml +index 8321a2a8c..6bd9f43f8 100644 +--- a/v2v/input_disk.ml ++++ b/v2v/input_disk.ml +@@ -89,7 +89,7 @@ class input_disk input_format disk = object + s_features = [ "acpi"; "apic"; "pae" ]; + s_firmware = UnknownFirmware; (* causes virt-v2v to autodetect *) + s_display = +- Some { s_display_type = Window; s_keymap = None; s_password = None; ++ Some { s_display_type = VNC; s_keymap = None; s_password = None; + s_listen = LNoListen; s_port = None }; + s_video = None; + s_sound = None; +-- +2.25.4 + diff --git a/SOURCES/0078-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch b/SOURCES/0078-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch new file mode 100644 index 0000000..5c61493 --- /dev/null +++ b/SOURCES/0078-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch @@ -0,0 +1,26 @@ +From 0cf211cc08f0f0b886021dc10b52a03aa2d22b1f Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Wed, 8 Mar 2017 11:03:40 +0100 +Subject: [PATCH] RHEL 8: v2v: do not mention SUSE Xen hosts (RHBZ#1430203) + +They are not supported in RHEL 8. +--- + v2v/virt-v2v-input-xen.pod | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v2v/virt-v2v-input-xen.pod b/v2v/virt-v2v-input-xen.pod +index 9fd5065f1..c3c20a6b6 100644 +--- a/v2v/virt-v2v-input-xen.pod ++++ b/v2v/virt-v2v-input-xen.pod +@@ -10,7 +10,7 @@ virt-v2v-input-xen - Using virt-v2v to convert guests from Xen + =head1 DESCRIPTION + + This page documents how to use L to convert guests from +-RHEL 5 Xen, or SLES and OpenSUSE Xen hosts. ++RHEL 5 Xen hosts. + + =head1 INPUT FROM XEN + +-- +2.25.4 + diff --git a/SOURCES/0079-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch b/SOURCES/0079-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch new file mode 100644 index 0000000..4c38c1d --- /dev/null +++ b/SOURCES/0079-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch @@ -0,0 +1,91 @@ +From 2009eb2439c8112789728856f08a9f92c6883ad8 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 14 May 2018 10:16:58 +0100 +Subject: [PATCH] RHEL 8: v2v: rhv-upload: Remove restriction on -oa sparse. + +See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681 +and the v2v-devel private thread "Do we already support migration using FC?" +--- + v2v/output_rhv_upload.ml | 11 +---------- + v2v/rhv-upload-plugin.py | 4 +--- + v2v/virt-v2v-output-rhv.pod | 8 +------- + 3 files changed, 3 insertions(+), 20 deletions(-) + +diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml +index e1d06867b..3f078157a 100644 +--- a/v2v/output_rhv_upload.ml ++++ b/v2v/output_rhv_upload.ml +@@ -177,19 +177,11 @@ See also the virt-v2v-output-rhv(1) manual.") + error (f_"nbdkit was compiled without SELinux support. You will have to recompile nbdkit with libselinux-devel installed, or else set SELinux to Permissive mode while doing the conversion.") + in + +- (* Output format/sparse must be raw/sparse. We may be able to +- * lift this limitation in future, but it requires changes on the +- * RHV side. See TODO file for details. XXX +- *) ++ (* Output format must be raw. *) + 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 + in + +- let error_unless_output_alloc_sparse () = +- if output_alloc <> Sparse then +- error_current_limitation "-oa sparse" +- in +- + (* JSON parameters which are invariant between disks. *) + let json_params = [ + "verbose", JSON.Bool (verbose ()); +@@ -249,7 +241,6 @@ object + error_unless_ovirtsdk4_module_available (); + error_unless_nbdkit_working (); + error_unless_nbdkit_python_plugin_working (); +- error_unless_output_alloc_sparse (); + (* Python code prechecks. *) + let precheck_fn = tmpdir // "v2vprecheck.json" in + let fd = Unix.openfile precheck_fn [O_WRONLY; O_CREAT] 0o600 in +diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py +index 14d4e37fb..c7f7a5e8b 100644 +--- a/v2v/rhv-upload-plugin.py ++++ b/v2v/rhv-upload-plugin.py +@@ -142,10 +142,8 @@ def open(readonly): + format = disk_format, + 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, ++ sparse = params['output_sparse'], + storage_domains = [ + types.StorageDomain( + name = params['output_storage'], +diff --git a/v2v/virt-v2v-output-rhv.pod b/v2v/virt-v2v-output-rhv.pod +index 4520c9184..f6579a48e 100644 +--- a/v2v/virt-v2v-output-rhv.pod ++++ b/v2v/virt-v2v-output-rhv.pod +@@ -5,7 +5,7 @@ virt-v2v-output-rhv - Using virt-v2v to convert guests to oVirt or RHV + =head1 SYNOPSIS + + virt-v2v [-i* options] -o rhv-upload [-oc ENGINE_URL] -os STORAGE +- [-op PASSWORD] [-of raw] ++ [-op PASSWORD] + [-oo rhv-cafile=FILE] + [-oo rhv-cluster=CLUSTER] + [-oo rhv-direct] +@@ -79,12 +79,6 @@ username is not specified then virt-v2v defaults to using + C which is the typical superuser account for oVirt + instances. + +-=item I<-of raw> +- +-Currently you must use I<-of raw> and you cannot use I<-oa preallocated>. +- +-These restrictions will be loosened in a future version. +- + =item I<-op> F + + A file containing a password to be used when connecting to the oVirt +-- +2.25.4 + diff --git a/SOURCES/0080-RHEL-8-use-platform-python.patch b/SOURCES/0080-RHEL-8-use-platform-python.patch new file mode 100644 index 0000000..d2d7118 --- /dev/null +++ b/SOURCES/0080-RHEL-8-use-platform-python.patch @@ -0,0 +1,27 @@ +From 58a4b8f9a1a8590728dd169f8c481171ab859b7d Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Sun, 16 Dec 2018 16:42:46 +0100 +Subject: [PATCH] RHEL 8: use platform-python + +Use the stable platform-python provided in BaseOS, instead of relying on +some arbitrary version installed by the user. +--- + v2v/python_script.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v2v/python_script.ml b/v2v/python_script.ml +index 3159373a1..f2c00c40f 100644 +--- a/v2v/python_script.ml ++++ b/v2v/python_script.ml +@@ -24,7 +24,7 @@ open Unix_utils + + open Common_gettext.Gettext + +-let python = "python3" (* Defined by PEP 394 *) ++let python = "/usr/libexec/platform-python" + + type script = { + tmpdir : string; (* Temporary directory. *) +-- +2.25.4 + diff --git a/SOURCES/0081-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch b/SOURCES/0081-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch new file mode 100644 index 0000000..ecca5c4 --- /dev/null +++ b/SOURCES/0081-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch @@ -0,0 +1,125 @@ +From a53675a2b1142654fa3cacc775e44692419d10e0 Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Tue, 26 Mar 2019 09:42:25 +0100 +Subject: [PATCH] RHEL 8: point to KB for supported v2v hypervisors/guests + +--- + v2v/virt-v2v-support.pod | 102 ++------------------------------------- + 1 file changed, 4 insertions(+), 98 deletions(-) + +diff --git a/v2v/virt-v2v-support.pod b/v2v/virt-v2v-support.pod +index a22506068..4ec1a07c1 100644 +--- a/v2v/virt-v2v-support.pod ++++ b/v2v/virt-v2v-support.pod +@@ -8,104 +8,10 @@ systems and guests in virt-v2v + This page documents which foreign hypervisors, virtualization + management systems and guest types that L can support. + +-Note this page applies to upstream virt-v2v from +-L and in downstream distributions of virt-v2v +-sometimes features are intentionally removed, or are present but not +-supported. +- +-=head2 Hypervisors (Input) +- +-=over 4 +- +-=item VMware ESXi +- +-Must be managed by VMware vCenter E 5.0 unless VDDK is available. +- +-=item OVA exported from VMware +- +-OVAs from other hypervisors will not work. +- +-=item VMX from VMware +- +-VMX files generated by other hypervisors will not work. +- +-=item RHEL 5 Xen +- +-=item SUSE Xen +- +-=item Citrix Xen +- +-Citrix Xen has not been recently tested. +- +-=item Hyper-V +- +-Not recently tested. Requires that you export the disk or use +-L on Hyper-V. +- +-=item Direct from disk images +- +-Only disk images exported from supported hypervisors, and using +-container formats supported by qemu. +- +-=item Physical machines +- +-Using the L tool. +- +-=back +- +-=head2 Hypervisors (Output) +- +-QEMU and KVM only. +- +-=head2 Virtualization management systems (Output) +- +-=over 4 +- +-=item OpenStack +- +-=item Red Hat Virtualization (RHV) 4.1 and up +- +-=item Local libvirt +- +-And hence L, L, and similar tools. +- +-=item Local disk +- +-=back +- +-=head2 Guests +- +-=over 4 +- +-=item Red Hat Enterprise Linux 3, 4, 5, 6, 7 +- +-=item CentOS 3, 4, 5, 6, 7 +- +-=item Scientific Linux 3, 4, 5, 6, 7 +- +-=item Oracle Linux +- +-=item Fedora +- +-=item SLES 10 and up +- +-=item OpenSUSE 10 and up +- +-=item Debian 6 and up +- +-=item Ubuntu 10.04, 12.04, 14.04, 16.04, and up +- +-=item Windows XP to Windows 10 / Windows Server 2016 +- +-We use Windows internal version numbers, see +-L +- +-Currently NT 5.2 to NT 6.3 are supported. +- +-See L below for additional notes on converting Windows +-guests. +- +-=back ++For more information on supported hypervisors, and guest types in ++RHEL, please consult the following Knowledgebase article on these ++Red Hat Customer Portal: ++L. + + =head2 Guest firmware + +-- +2.25.4 + diff --git a/SOURCES/copy-patches.sh b/SOURCES/copy-patches.sh index 83737da..a073f9d 100755 --- a/SOURCES/copy-patches.sh +++ b/SOURCES/copy-patches.sh @@ -6,7 +6,7 @@ set -e # directory. Use it like this: # ./copy-patches.sh -rhel_version=8.0 +rhel_version=8.3.0 # Check we're in the right directory. if [ ! -f libguestfs.spec ]; then diff --git a/SPECS/libguestfs.spec b/SPECS/libguestfs.spec index 8312104..f70763f 100644 --- a/SPECS/libguestfs.spec +++ b/SPECS/libguestfs.spec @@ -36,7 +36,7 @@ Summary: Access and modify virtual machine disk images Name: libguestfs Epoch: 1 Version: 1.40.2 -Release: 22%{?dist} +Release: 24%{?dist} License: LGPLv2+ # Source and patches. @@ -49,7 +49,7 @@ Source1: http://libguestfs.org/download/1.40-stable/%{name}-%{version}.tar ExclusiveArch: x86_64 %{power64} aarch64 s390x # RHEL 8 git repository is: -# https://github.com/libguestfs/libguestfs/tree/rhel-8.0 +# https://github.com/libguestfs/libguestfs/tree/rhel-8.3.0 # Use 'copy-patches.sh' to copy the patches from the git repo # to the current directory. @@ -109,23 +109,32 @@ Patch0052: 0052-v2v-windows-install-QEMU-Guest-Agent-MSI.patch Patch0053: 0053-windows-small-tweaks-of-qemu-ga-firstboot-script.patch Patch0054: 0054-windows-fix-detection-of-qemu-ga-installer-on-RHV.patch Patch0055: 0055-windows-delay-installation-of-qemu-ga-MSI.patch -Patch0056: 0056-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch -Patch0057: 0057-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch -Patch0058: 0058-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch -Patch0059: 0059-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch -Patch0060: 0060-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch -Patch0061: 0061-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch -Patch0062: 0062-RHEL-8-Disable-alternate-Augeas-lenses.patch -Patch0063: 0063-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch -Patch0064: 0064-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch -Patch0065: 0065-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch -Patch0066: 0066-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch -Patch0067: 0067-RHEL-8-v2v-Disable-the-virt-v2v-in-place-option.patch -Patch0068: 0068-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch -Patch0069: 0069-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch -Patch0070: 0070-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch -Patch0071: 0071-RHEL-8-use-platform-python.patch -Patch0072: 0072-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch +Patch0056: 0056-daemon-xattr-Refactor-code-which-splits-attr-names-f.patch +Patch0057: 0057-daemon-Add-filter_list-utility-function.patch +Patch0058: 0058-daemon-xattr-Filter-out-user.WofCompressedData-from-.patch +Patch0059: 0059-mltools-add-run_in_guest_command-helper.patch +Patch0060: 0060-customize-port-do_run-to-run_in_guest_command.patch +Patch0061: 0061-sysprep-add-a-update_system_ca_store-side-effect.patch +Patch0062: 0062-sysprep-ca-certificates-request-system-CA-store-upda.patch +Patch0063: 0063-sysprep-add-IPA-offline-unenrollment-RHBZ-1789592.patch +Patch0064: 0064-sysprep-add-Kerberos-keytab-file-removal.patch +Patch0065: 0065-RHEL-8-Remove-libguestfs-live-RHBZ-798980.patch +Patch0066: 0066-RHEL-8-Remove-9p-APIs-from-RHEL-RHBZ-921710.patch +Patch0067: 0067-RHEL-8-Disable-unsupported-remote-drive-protocols-RH.patch +Patch0068: 0068-RHEL-8-Remove-User-Mode-Linux-RHBZ-1144197.patch +Patch0069: 0069-RHEL-8-v2v-Select-correct-qemu-binary-for-o-qemu-mod.patch +Patch0070: 0070-RHEL-8-v2v-Disable-the-qemu-boot-option-RHBZ-1147313.patch +Patch0071: 0071-RHEL-8-Disable-alternate-Augeas-lenses.patch +Patch0072: 0072-RHEL-8-Fix-list-of-supported-sound-cards-to-match-RH.patch +Patch0073: 0073-RHEL-8-Reject-use-of-libguestfs-winsupport-features-.patch +Patch0074: 0074-RHEL-8-Fix-tests-for-libguestfs-winsupport.patch +Patch0075: 0075-RHEL-8-tests-Disable-daemon-tests-that-require-the-u.patch +Patch0076: 0076-RHEL-8-v2v-Disable-the-virt-v2v-in-place-option.patch +Patch0077: 0077-RHEL-8-v2v-i-disk-force-VNC-as-display-RHBZ-1372671.patch +Patch0078: 0078-RHEL-8-v2v-do-not-mention-SUSE-Xen-hosts-RHBZ-143020.patch +Patch0079: 0079-RHEL-8-v2v-rhv-upload-Remove-restriction-on-oa-spars.patch +Patch0080: 0080-RHEL-8-use-platform-python.patch +Patch0081: 0081-RHEL-8-point-to-KB-for-supported-v2v-hypervisors-gue.patch # Use git for patch management. BuildRequires: git @@ -153,7 +162,7 @@ Source7: libguestfs.keyring # RHEV-APT is taken from the RHEV Tools CD # See https://bugzilla.redhat.com/show_bug.cgi?id=1186850 Source96: rhsrvany.exe -Source97: RHEV-Application-Provisioning-Tool.exe_4.43-3 +Source97: RHEV-Application-Provisioning-Tool.exe_4.43-5 Source98: brew-overrides.sh Source99: copy-patches.sh @@ -1256,6 +1265,16 @@ install -m 0644 utils/boot-benchmark/boot-benchmark.1 $RPM_BUILD_ROOT%{_mandir}/ %changelog +* Wed Jun 24 2020 Pino Toscano - 1:1.40.2-24 +- v2v: ship a newer version of rhev-apt.exe + resolves: rhbz#1849997 + +* Tue May 26 2020 Pino Toscano - 1:1.40.2-23 +- Ignore the user.WofCompressedData xattr + resolves: rhbz#1811539 +- sysprep: new ipa-client and kerberos-hostkeytab operations + resolves: rhbz#1789592 + * Mon Apr 27 2020 Danilo C. L. de Paula - 1.40.2 - Resolves: bz#1810193 (Upgrade components in virt:rhel module:stream for RHEL-8.3 release)