[PATCH v2 0/4] sysprep: Remove various backup files.
by Richard W.M. Jones
In v2:
- The backup-files operation now operates on a conservative whitelist
of filesystems, so it won't touch anything in /usr. Consequently
it also runs much more quickly, about 4 seconds on the barebones
virt-builder fedora-25 image.
- Call Gc.compact () in visit_tests.
- Added documentation to fnmatch.mli.
7 years, 11 months
libguestfs error: bridge 'virbr0' not found
by Shahar Havivi
Hey,
I am getting this error after using virt-v2v-copy-to-local and trying to
run:
$ virt-v2v -i libvirtxml rhel7.xml -o local -os /var/tmp -of raw
I try to set:
export LIBGUESTFS_BACKEND_SETTINGS=virbr0=ovirtmgmt
with no success and the file /etc/qemu/bridge.conf contains:
allow virbr0
it only worked after creating the bridge, is there other way to import
without creating the bridge?
Thank you,
Shahar Havivi
7 years, 11 months
[PATCH] tests: drop expected-failing btrfs_subvolume_show test
by Pino Toscano
One of the tests for btrfs_subvolume_show tries to invoke it on the
toplevel subvolume, expecting its failure (since btrfs-progs used to not
be able to list that). However, since v4.8.3 btrfs-progs can do that
(even if the data returned for that subvolume is limited/incomplete),
and thus this test fails because the API does not fail anymore.
Since we can consider that functionality working (for some kind of it),
then drop this test.
---
generator/actions.ml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/generator/actions.ml b/generator/actions.ml
index 77fca20..fb896f5 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12545,10 +12545,6 @@ Get the default subvolume or snapshot of a filesystem mounted at C<mountpoint>."
proc_nr = Some 426;
optional = Some "btrfs"; camel_name = "BTRFSSubvolumeShow";
tests = [
- InitPartition, Always, TestLastFail (
- [["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
- ["mount"; "/dev/sda1"; "/"];
- ["btrfs_subvolume_show"; "/"]]), [];
InitPartition, Always, TestRun (
[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
["mount"; "/dev/sda1"; "/"];
--
2.7.4
7 years, 11 months
[PATCH supermin] tests: fix test-binaries-exist.sh with bash 4.4
by Pino Toscano
bash 4.4 installs the (binary) examples of builtins by default: among
them, there is one called 'sync', which segfaults when called
standalone. Since this test actually looks for the 'sync' utility from
coreutils, filter out the bash-specific paths from the search results.
---
tests/test-binaries-exist.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test-binaries-exist.sh b/tests/test-binaries-exist.sh
index c40ce93..71a0c8c 100755
--- a/tests/test-binaries-exist.sh
+++ b/tests/test-binaries-exist.sh
@@ -56,7 +56,7 @@ if [ "$(find $d2 -name sync -perm -0555 | wc -l)" -lt 1 ]; then
fi
# These binaries should be runnable (since they are the same as the host).
-`find $d2 -name sync | head`
+`find $d2 -name sync ! -path '*/bash/*' | head`
# Need to chmod $d2 since rm -r can't remove unwritable directories.
chmod -R +w $d2 ||:
--
2.7.4
7 years, 11 months
[PATCH 0/4] sysprep: Remove various backup files.
by Richard W.M. Jones
https://bugzilla.redhat.com/show_bug.cgi?id=1401320
This series contains two new operations.
The second -- and least controversial -- is "passwd-backups" which
removes files such as /etc/passwd-, /etc/shadow- and so on.
The first one ("backup-files") searches the whole guest filesystem for
any regular file which looks like an editor backup file, such as "*~"
and deletes it. Unfortunately there are two problems with this
operation at the moment. It's slow, taking 30 seconds to examine a
virt-builder fedora-25 barebones filesystem. It can also remove
RPM-owned files (see https://bugzilla.redhat.com/show_bug.cgi?id=1404634).
It should possibly skip /usr or only check a whitelist of directories
such as /etc.
Rich.
7 years, 11 months
[PATCH] v2v: tests: avoid '..' in member names for tar
by Pino Toscano
Very recent versions of tar (most probably as a consequence of
CVE-2016-6321) may refuse archive members with '..', like the relative
paths to upper level directories.
Since these are just tests, simply copy the files in the temporary
directories where tar (or zip as well) is run, so all the files are in
the same directory.
---
v2v/test-v2v-i-ova-formats.sh | 9 +++++----
v2v/test-v2v-i-ova-gz.sh | 3 ++-
v2v/test-v2v-i-ova-two-disks.sh | 3 ++-
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/v2v/test-v2v-i-ova-formats.sh b/v2v/test-v2v-i-ova-formats.sh
index d113994..ab15f32 100755
--- a/v2v/test-v2v-i-ova-formats.sh
+++ b/v2v/test-v2v-i-ova-formats.sh
@@ -59,21 +59,22 @@ pushd $d
truncate -s 10k disk1.vmdk
sha=`do_sha1 disk1.vmdk`
echo -e "SHA1(disk1.vmdk)= $sha\r" > disk1.mf
+cp ../test-v2v-i-ova-formats.ovf .
for format in $formats; do
case "$format" in
tar)
- tar -cf test-$format.ova ../test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
+ tar -cf test-$format.ova test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
;;
zip)
- zip -r test ../test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
+ zip -r test test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
mv test.zip test-$format.ova
;;
tar-gz)
- tar -czf test-$format.ova ../test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
+ tar -czf test-$format.ova test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
;;
tar-xz)
- tar -cJf test-$format.ova ../test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
+ tar -cJf test-$format.ova test-v2v-i-ova-formats.ovf disk1.vmdk disk1.mf
;;
*)
echo "Unhandled format '$format'"
diff --git a/v2v/test-v2v-i-ova-gz.sh b/v2v/test-v2v-i-ova-gz.sh
index a38e1b4..fe2da03 100755
--- a/v2v/test-v2v-i-ova-gz.sh
+++ b/v2v/test-v2v-i-ova-gz.sh
@@ -46,8 +46,9 @@ truncate -s 10k disk1.vmdk
gzip disk1.vmdk
sha=`do_sha1 disk1.vmdk.gz`
echo -e "SHA1(disk1.vmdk.gz)= $sha\r" > disk1.mf
+cp ../test-v2v-i-ova-gz.ovf .
-tar -cf test.ova ../test-v2v-i-ova-gz.ovf disk1.vmdk.gz disk1.mf
+tar -cf test.ova test-v2v-i-ova-gz.ovf disk1.vmdk.gz disk1.mf
popd
# Run virt-v2v but only as far as the --print-source stage, and
diff --git a/v2v/test-v2v-i-ova-two-disks.sh b/v2v/test-v2v-i-ova-two-disks.sh
index aefd90e..2bd8a26 100755
--- a/v2v/test-v2v-i-ova-two-disks.sh
+++ b/v2v/test-v2v-i-ova-two-disks.sh
@@ -51,8 +51,9 @@ echo -e "SHA1(disk1.vmdk)= $sha\r" > disk1.mf
truncate -s 100k disk2.vmdk
sha=`do_sha1 disk2.vmdk`
echo -e "SHA1(disk2.vmdk)= $sha\r" > disk2.mf
+cp ../test-v2v-i-ova-two-disks.ovf .
-tar -cf test.ova ../test-v2v-i-ova-two-disks.ovf disk1.vmdk disk1.mf disk2.vmdk disk2.mf
+tar -cf test.ova test-v2v-i-ova-two-disks.ovf disk1.vmdk disk1.mf disk2.vmdk disk2.mf
popd
# Run virt-v2v but only as far as the --print-source stage, and
--
2.7.4
7 years, 11 months
[PATCH] java: fix memory leak in RStruct actions
by Pino Toscano
The return value struct was freed using a simple free() instead of the
own cleanup function of each struct: this meant dynamically allocated
values (such as strings) were leaked.
Use the proper cleanup functions instead.
---
generator/java.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/generator/java.ml b/generator/java.ml
index a68054c..3c1e611 100644
--- a/generator/java.ml
+++ b/generator/java.ml
@@ -1000,7 +1000,7 @@ and generate_java_struct_return typ jtyp cols =
pr " fl = (*env)->GetFieldID (env, cl, \"%s\", \"C\");\n" name;
pr " (*env)->SetCharField (env, jr, fl, r->%s);\n" name;
) cols;
- pr " free (r);\n";
+ pr " guestfs_free_%s (r);\n" typ;
pr " return jr;\n"
and generate_java_struct_list_return typ jtyp cols =
--
2.7.4
7 years, 11 months