From f6989885d978239ff224dfad47d861a0de6ee8bc Mon Sep 17 00:00:00 2001 From: sarika Date: Thu, 22 Jan 2026 11:06:37 +0530 Subject: [PATCH 1/2] made fstrim optional --- .github/workflows/build-rpm.yaml | 96 ++++++++++++++++++++++++++++++++ convert/convert.ml | 8 ++- convert/convert.mli | 1 + in-place/in_place.ml | 5 ++ inspector/inspector.ml | 1 + v2v/v2v.ml | 1 + 6 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-rpm.yaml diff --git a/.github/workflows/build-rpm.yaml b/.github/workflows/build-rpm.yaml new file mode 100644 index 000000000..2c0099e41 --- /dev/null +++ b/.github/workflows/build-rpm.yaml @@ -0,0 +1,96 @@ +name: Build virt-v2v RPM 2.7.17 + +on: + push: + workflow_dispatch: + +jobs: + build-rpm: + runs-on: ubuntu-latest + container: + image: fedora:42 + + steps: + - name: Install git first + run: dnf install -y git + + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + dnf install -y rpm-build rpmdevtools git sqlite perl-hivex \ + autoconf automake libtool + dnf builddep -y virt-v2v + + - name: Setup rpmbuild tree under /root + run: | + rpmdev-setuptree + mkdir -p /root/rpmbuild/{SPECS,SOURCES,BUILD,BUILDROOT,RPMS,SRPMS} + + - name: Build patched tarball (autoreconf + make dist) + working-directory: ${{ github.workspace }} + run: | + autoreconf -fiv + ./configure + make dist + + - name: Verify tarball name + working-directory: ${{ github.workspace }} + run: | + ls -lh virt-v2v-2.7.13.tar.gz + + - name: Download & extract upstream SRPM + run: | + cd /root + dnf download --source virt-v2v \ + --enablerepo=fedora-source \ + --enablerepo=updates-source \ + --skip-unavailable + + mkdir -p /tmp/srpm-extract + cd /tmp/srpm-extract + rpm2cpio /root/virt-v2v-*.src.rpm | cpio -idmv + + # Move spec and sources to build tree + mv virt-v2v.spec /root/rpmbuild/SPECS/ + cp *.keyring /root/rpmbuild/SOURCES/ 2>/dev/null || true + cp *.sig /root/rpmbuild/SOURCES/ 2>/dev/null || true + + - name: Copy patched tarball to SOURCES + run: | + cp /__w/virt-v2v/virt-v2v/virt-v2v-2.7.13.tar.gz /root/rpmbuild/SOURCES/ + + - name: Patch spec file + run: | + SPEC_FILE="/root/rpmbuild/SPECS/virt-v2v.spec" + + # 1. Disable GPG checks + sed -i 's/^\([[:space:]]*\)%{gpgverify}/#\1%{gpgverify}/' $SPEC_FILE + sed -i 's/%global verify_tarball_signature 1/%global verify_tarball_signature 0/' $SPEC_FILE || true + + # 2. Force Version to 2.7.13 + sed -i 's/^Version:.*/Version: 2.7.13/' $SPEC_FILE + sed -i 's/^Release:.*/Release: 1.fc42/' $SPEC_FILE + + # 3. Remove files that are missing in our build (oVirt support) + sed -i '/virt-v2v-open/d' $SPEC_FILE + sed -i '/virt-v2v-output-ovirt/d' $SPEC_FILE + + - name: Build RPM (With Ignore Unpackaged Files) + run: | + cd /root/rpmbuild/SPECS + # Added _unpackaged_files_terminate_build 0 to ignore the extra RHV man page + rpmbuild -bb \ + --define "_topdir /root/rpmbuild" \ + --define "_unpackaged_files_terminate_build 0" \ + --nocheck \ + virt-v2v.spec + + - name: Upload built RPMs + uses: actions/upload-artifact@v4 + with: + name: virt-v2v-2.7.13-rpm + path: /root/rpmbuild/RPMS/x86_64/*.rpm \ No newline at end of file diff --git a/convert/convert.ml b/convert/convert.ml index ff82ad549..0b952a824 100644 --- a/convert/convert.ml +++ b/convert/convert.ml @@ -38,6 +38,7 @@ type options = { root_choice : root_choice; static_ips : static_ip list; customize_ops : Customize_cmdline.ops; + no_fstrim : bool; } (* Mountpoint stats, used for free space estimation. *) @@ -111,8 +112,11 @@ let rec convert input_disks options source = * because unused blocks are marked in the overlay and thus do * not have to be copied. *) - message (f_"Mapping filesystem data to avoid copying unused and blank areas"); - do_fstrim g inspect; + if not options.no_fstrim then ( + message (f_"Mapping filesystem data to avoid copying unused and blank areas"); + do_fstrim g inspect + ) else + message (f_"Skipping fstrim (--no-fstrim specified)"); (* Check (fsck) the filesystems after conversion. *) g#umount_all (); diff --git a/convert/convert.mli b/convert/convert.mli index b34f04e0c..591f5f60e 100644 --- a/convert/convert.mli +++ b/convert/convert.mli @@ -24,6 +24,7 @@ type options = { root_choice : Types.root_choice; (** [--root] option *) static_ips : Types.static_ip list; (** [--mac :ip:] option *) customize_ops : Customize_cmdline.ops; (** virt-customize options *) + no_fstrim : bool; (** [--no-fstrim] option *) } val convert : NBD_URI.t list -> options -> Types.source -> diff --git a/in-place/in_place.ml b/in-place/in_place.ml index 604a662dc..b67b575c1 100644 --- a/in-place/in_place.ml +++ b/in-place/in_place.ml @@ -146,6 +146,7 @@ let rec main () = let set_root_choice = Types.set_root_choice root_choice in (* Other options that we handle here. *) + let no_fstrim = ref false in let print_source = ref false in let input_modes = @@ -180,6 +181,8 @@ let rec main () = s_"Map network ‘in’ to ‘out’"; [ S 'O' ], Getopt.String ("output.xml", set_output_xml_option), s_"Set the output filename"; + [ L"no-fstrim" ], Getopt.Set no_fstrim, + s_"Don't trim filesystems before conversion"; [ L"print-source" ], Getopt.Set print_source, s_"Print source and stop"; [ L"root" ], Getopt.String ("ask|... ", set_root_choice), @@ -239,6 +242,7 @@ read the man page virt-v2v-in-place(1). let customize_ops = get_customize_ops () in let input_conn = !input_conn in let input_mode = !input_mode in + let no_fstrim = !no_fstrim in let output_xml = !output_xml in let print_source = !print_source in let root_choice = !root_choice in @@ -305,6 +309,7 @@ read the man page virt-v2v-in-place(1). root_choice; static_ips; customize_ops; + no_fstrim; } in (* Before starting the input module, check there is sufficient diff --git a/inspector/inspector.ml b/inspector/inspector.ml index 50b8f711d..0eb582c52 100644 --- a/inspector/inspector.ml +++ b/inspector/inspector.ml @@ -280,6 +280,7 @@ read the man page virt-v2v-inspector(1). root_choice; static_ips; customize_ops; + no_fstrim = false; } in (* Before starting the input module, check there is sufficient diff --git a/v2v/v2v.ml b/v2v/v2v.ml index d32993d46..fd6b99a6d 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -423,6 +423,7 @@ read the man page virt-v2v(1). root_choice; static_ips; customize_ops; + no_fstrim = false; } in (* Before starting the input module, check there is sufficient From edca8d4e79e5d7fd617663e6e919dc279e2bc8f9 Mon Sep 17 00:00:00 2001 From: Omkar Deshpande Date: Sun, 1 Feb 2026 12:21:32 +0000 Subject: [PATCH 2/2] change version to v2.8.1 --- .github/workflows/build-rpm.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-rpm.yaml b/.github/workflows/build-rpm.yaml index 2c0099e41..99bdb1d80 100644 --- a/.github/workflows/build-rpm.yaml +++ b/.github/workflows/build-rpm.yaml @@ -1,4 +1,4 @@ -name: Build virt-v2v RPM 2.7.17 +name: Build virt-v2v RPM 2.8.1 on: push: @@ -40,7 +40,7 @@ jobs: - name: Verify tarball name working-directory: ${{ github.workspace }} run: | - ls -lh virt-v2v-2.7.13.tar.gz + ls -lh virt-v2v-2.8.1.tar.gz - name: Download & extract upstream SRPM run: | @@ -61,7 +61,7 @@ jobs: - name: Copy patched tarball to SOURCES run: | - cp /__w/virt-v2v/virt-v2v/virt-v2v-2.7.13.tar.gz /root/rpmbuild/SOURCES/ + cp /__w/virt-v2v/virt-v2v/virt-v2v-2.8.1.tar.gz /root/rpmbuild/SOURCES/ - name: Patch spec file run: | @@ -71,8 +71,8 @@ jobs: sed -i 's/^\([[:space:]]*\)%{gpgverify}/#\1%{gpgverify}/' $SPEC_FILE sed -i 's/%global verify_tarball_signature 1/%global verify_tarball_signature 0/' $SPEC_FILE || true - # 2. Force Version to 2.7.13 - sed -i 's/^Version:.*/Version: 2.7.13/' $SPEC_FILE + # 2. Force Version to 2.8.1 + sed -i 's/^Version:.*/Version: 2.8.1/' $SPEC_FILE sed -i 's/^Release:.*/Release: 1.fc42/' $SPEC_FILE # 3. Remove files that are missing in our build (oVirt support) @@ -92,5 +92,5 @@ jobs: - name: Upload built RPMs uses: actions/upload-artifact@v4 with: - name: virt-v2v-2.7.13-rpm + name: virt-v2v-2.8.1-rpm path: /root/rpmbuild/RPMS/x86_64/*.rpm \ No newline at end of file