Compare commits

...

230 Commits

Author SHA1 Message Date
Richard W.M. Jones
21764ec7c2 Version 1.29.38. 2015-04-27 20:29:37 +01:00
Richard W.M. Jones
b70aec11c6 random_seed: Don't try to create random seed if no parent directory.
Partial fix for https://bugzilla.redhat.com/show_bug.cgi?id=1215803
2015-04-27 20:28:26 +01:00
Richard W.M. Jones
2841400721 firstboot: Don't create very long filenames for --firstboot-command (RHBZ#1212152). 2015-04-27 16:19:33 +01:00
Richard W.M. Jones
aa8d66e755 firstboot: Factor out regular expression constant.
Don't need to evaluate this every time we call the function.
2015-04-27 16:19:33 +01:00
Pino Toscano
8c26ef91f9 v2v: convert old-style libvirt listen configuration (RHBZ#1174073)
Use the listen configuration from the "listen" attribute of <graphics>,
in case <listen> is missing.

Followup of commit 9360675dc2.
2015-04-27 10:16:40 +02:00
Richard W.M. Jones
2dd01c5d2d v2v: Remove warning when compiling --without-libvirt. 2015-04-25 22:27:50 +01:00
Richard W.M. Jones
e3443a7549 v2v: -o libvirt: Minor refactoring of arch sanity check. 2015-04-25 22:11:07 +01:00
Richard W.M. Jones
4546d3f21d v2v: Replace polymorphic variant source_hypervisor with ordinary variant.
See commit 3a080c3fbf.
2015-04-25 21:46:26 +01:00
Richard W.M. Jones
946d49cbbc v2v: Remove further uses of polymorphic variants.
See commit 3a080c3fbf.
2015-04-25 21:40:49 +01:00
Richard W.M. Jones
ce630dfc33 valgrind: Add suppression for libvirt memory leak.
Related to RHBZ#1215042.
2015-04-24 09:04:38 +01:00
Richard W.M. Jones
e9910b4887 Version 1.29.37. 2015-04-23 19:57:56 +01:00
Richard W.M. Jones
578c7c0868 builder: Add rhel-ppc64.sh & rhel-ppc64le.sh to EXTRA_DIST.
This fixes commit c5f0d39c64.
2015-04-23 19:57:06 +01:00
Richard W.M. Jones
b02980d5af fuse: tests: Add some debugging to test-fuse-umount-race.sh.
This test fails on recent kernels, sometimes.

Apparently calling 'fusermount -u mp' can exit with an EBUSY error,
but still unmount the filesystem.  Or possibly guestmount crashes
coincidentally.  It's impossible to debug because debugging tools like
strace prevent fuse from working at all.
2015-04-23 19:03:36 +01:00
Richard W.M. Jones
6dee5a4152 fuse: guestunmount: Make the -v (verbose) option do something useful.
guestunmount had a -v / --verbose option, but it didn't change the
behaviour of the program in any way.

Make it print the invocations of the underlying fusermount program.
2015-04-23 19:02:41 +01:00
Richard W.M. Jones
0e4c351bb4 mllib: Link config.ml to the test program.
This fixes commit a1646fa65c.
2015-04-23 17:56:28 +01:00
Richard W.M. Jones
4f021006e9 v2v: When debugging, dump OVF to stderr.
Useful for debugging problems like RHBZ#1213701.
2015-04-23 10:53:04 +01:00
Richard W.M. Jones
c5f0d39c64 builder: Add scripts for generating RHEL 7 ppc64 & ppc64le images. 2015-04-22 22:16:52 +01:00
Richard W.M. Jones
2b0c6e8565 v2v: Pass sound card information from the source to the target (RHBZ#1176493).
Collect sound card information from the source, and where possible,
create a compatible sound card on the target.

Notes:

* VMware's libvirt driver, and also OVF files, do not appear to
  contain any sound card information, so it cannot be collected from
  VMware sources.

* Xen does emulate sound cards and makes that information available
  through libvirt XML.

* There are no paravirt drivers for sound that I'm aware of.
  Therefore we can just copy the same sound model to the target (so
  the sound device does not appear to change).  If the target, KVM,
  does not support the device, it is dropped.  But ...

* ... Unfortunately we cannot easily tell which sound cards are
  supported by KVM on the target.  This is especially a problem for
  RHEL, where many sound drivers have been removed.  There is a
  convenience function, `Utils.qemu_supports_sound_card', which can be
  modified by packagers to hard code the list of supported sound
  cards.

* If a sound card is dubious / not supported by the target / has any
  other problem, then we drop it, since it is more important that the
  guest boots on the target than that sound works.
2015-04-20 22:14:16 +01:00
Richard W.M. Jones
3834a1064f v2v: tests: Don't need to generate test-v2v-networks-and-bridges.xml.
virt-v2v understands relative paths in libvirt XML (even though they
are not legal and libvirt itself wouldn't generate it).  We don't need
to generate this file.
2015-04-20 21:07:47 +01:00
Pino Toscano
a1646fa65c build: create and use a full version string
Create a version string that includes the "extra" string as well, and
make use of it in print_version_and_exit (which can avoid creating a new
Guestfs handle).

Folloup of commit 478a552ab4.
2015-04-20 15:38:32 +02:00
Pino Toscano
4268865a78 build: require Config before Common_utils
Build the Config mllib module before Common_utils, as the latter will
soon make use of the former.
2015-04-20 15:38:31 +02:00
Richard W.M. Jones
0576fdd0b6 v2v: Only emit fstrim warning when debugging (RHBZ#1168144).
fstrim is an optimization.  If it fails, it's not fatal (although
virt-v2v will run a lot more slowly).

We also expect that it will fail for non-aligned NTFS partitions found
on old versions of Windows, and in that case there's nothing that can
be done about it.

Therefore only emit the warning when we are debugging.
2015-04-20 13:12:08 +01:00
Richard W.M. Jones
3c51302d69 v2v: OVF: Add more Windows operating system variants (RHBZ#1213324).
When generating OVF (eg. for -o rhev, -o vdsm) we have to put the
operating system type into a particular field of the output, in a
format that oVirt/RHEV will understand.  Add further Windows OS
variants to this list.  The variants are derived by examining
ovirt-engine sources.

Thanks: Tingting Zheng for testing Windows conversions to RHEV and
finding this bug.
2015-04-20 12:07:18 +01:00
Richard W.M. Jones
86a91d6c65 p2v: Make --version output consistent with other tools (RHBZ#1213247). 2015-04-20 08:55:03 +01:00
Richard W.M. Jones
3b3f06d224 virt-win-reg: Make output of --version flag consistent (RHBZ#1213247). 2015-04-20 08:51:13 +01:00
Richard W.M. Jones
478a552ab4 Common function to implement --version flag in all OCaml tools (RHBZ#1213247).
Add a common function print_version_and_exit ~prog () and use this
function to display the version in all OCaml tools, to ensure
consistent output.
2015-04-20 08:48:08 +01:00
Richard W.M. Jones
921a3b8be2 fish: Whitespace changes. 2015-04-20 08:47:45 +01:00
Richard W.M. Jones
1d78b312bf builder: Add CentOS 7.1 image. 2015-04-18 11:26:03 +01:00
Richard W.M. Jones
58bbb93a25 tests/data: Add ppc64 & ppc64le test binaries. 2015-04-17 20:46:13 +01:00
Richard W.M. Jones
b2fbd88d9f builder: As TCG is single threaded, use 1 vCPU for Fedora ppc64 guests. 2015-04-17 16:11:18 +01:00
Richard W.M. Jones
0debc0b3a7 builder: Set expand=/dev/sda3 for Fedora 21 ppc64 images. 2015-04-17 11:28:43 +01:00
Richard W.M. Jones
0e73a97ef4 builder: Fedora 21 ppc64 images are now raw not qcow2.
Fixes commit f2109068e5.
2015-04-17 11:17:01 +01:00
Richard W.M. Jones
f2109068e5 builder: Upload new ppc64/ppc64le images which try to resolve console and partitioning problems. 2015-04-17 09:56:10 +01:00
Richard W.M. Jones
8670c784db Version 1.29.36. 2015-04-16 14:04:54 +01:00
Richard W.M. Jones
49867a22ba filearch: Fix memory leak.
Found by 'make check-valgrind'.

This fixes commit 20acc1f124.
2015-04-16 14:04:53 +01:00
Richard W.M. Jones
0f4ad9cd84 builder: Use console=hvc0 for serial console in ppc64 guests, and change partitioning type to LVM. 2015-04-16 10:31:33 +01:00
Richard W.M. Jones
b4be660ed6 Version 1.29.35. 2015-04-15 22:30:52 +01:00
Richard W.M. Jones
cc44a5b511 builder: Add fedora-ppc64le.sh script to EXTRA_DIST. 2015-04-15 22:30:25 +01:00
Pino Toscano
8f55030965 v2v: test-v2v-i-ova-formats.sh: test ova as tar.gz and tar.xz
Extend test-v2v-i-ova-formats.sh to test for tarballs compressed as gzip
or xz; followup of commit 3c582cfb8d.
2015-04-15 15:28:14 +02:00
Pino Toscano
454220ab43 v2v: generalize test-v2v-i-ova-zip.sh
Rename test-v2v-i-ova-zip.sh (and associated data) to
test-v2v-i-ova-formats, and generalize it a bit so it can test different
compression types for the ova "envelope".
2015-04-15 15:28:14 +02:00
Richard W.M. Jones
eab054a574 builder: website: Set format=qcow2 for Fedora 21 ppc64 images.
Since I created these with virt-builder without specifying the format,
they have format=qcow2 (not raw).  Instead of tediously recreating or
reuploading these images, just change the metadata.
2015-04-15 13:32:45 +01:00
Richard W.M. Jones
f358d3d1ed builder: In new virt-install, you must specify the format when creating disk images.
New virt-install defaults to qcow2 format unless specified.
Previously it defaulted to raw.  Specify the format explicitly.
2015-04-15 13:32:05 +01:00
Pino Toscano
11450a2d36 v2v: tests: add port='-1' to test-v2v-i-ova.xml reference
Followup of commit 1db249a0cc, as it
outputs a new port attribute.
2015-04-15 14:28:05 +02:00
Pino Toscano
8049474636 v2v: use .ovf and .mf files anywhere within ova files
Do not rely on .ovf and .mf files being in the top-level of the ova
archive, but search them anywhere within the content of the ova.

This also changes the result of the search of the .ovf file: previously,
one (random) file was picked in case there were more than one, while now
this situation triggers an error.

Related to RHBZ#1186800.
2015-04-15 14:24:13 +02:00
Pino Toscano
3c582cfb8d v2v: support tar.gz and tar.xz ova files
When dealing with a ova detected as gzip of xz, uncompress few bytes of
it to check whether it is a compressed tarball, and if so untar it.

Related to RHBZ#1186800.
2015-04-15 14:24:13 +02:00
Richard W.M. Jones
05f5d069ba builder: Upload second revision of ppc64/ppc64le templates.
The serial console should be fixes in these versions.
2015-04-15 12:45:40 +01:00
Pino Toscano
08b1ba35cf v2v: start importing "volume" disk types (RHBZ#1146832)
Import disks stored as "file"-type volumes.

Side effect: a guest converted to libvirt using virt-v2v can be
converted again using virt-v2v.
2015-04-15 09:36:33 +02:00
Pino Toscano
f7529522ab v2v: pass libvirt connection URI to parse_libvirt_xml
This makes it possible to connect to the right libvirt.
2015-04-15 09:36:33 +02:00
Pino Toscano
5da2ed95c1 v2v: domainxml: add vol_dumpxml
Add a new vol_dumpxml to get the XML dump of a pool's volume.
2015-04-15 09:36:33 +02:00
Pino Toscano
9001f61a40 v2v: domainxml: factor out connect and pool loading
Factor out the connection and pool loading out of v2v_pool_dumpxml, so
it can be used in later implementations requiring a pool.

Should be just code motion.
2015-04-15 09:36:32 +02:00
Richard W.M. Jones
eee28390ff builder: Add Fedora 21 ppc64 & ppc64le images.
This also corrects the size= field on all Fedora images.  It should
be 6GB but was 4GB.
2015-04-14 18:20:09 +01:00
Richard W.M. Jones
c65bba313d builder: Add fedora-ppc64le script and build ppc64le template. 2015-04-14 18:20:09 +01:00
Richard W.M. Jones
c5b5442315 builder: Update fedora-ppc64 script and build ppc64 big endian template. 2015-04-14 18:20:09 +01:00
Pino Toscano
1db249a0cc v2v: convert libvirt display port configuration
Read the port configuration from the XML of libvirt domains, restoring
it when writing new libvirt XMLs instead of always setting the
"autoport" option.
2015-04-14 13:22:10 +02:00
Pino Toscano
7291b226d1 filearch: support gzip/xz-compressed files
Extract them to find out the architecture of the data they hold.
Useful to detect the architecture of e.g. compressed Linux modules.

Provide in the test.iso two samples (compressing existing test data) of
binaries compressed with gzip and xz.
2015-04-14 11:13:23 +02:00
Pino Toscano
9360675dc2 v2v: convert libvirt display listen configuration (RHBZ#1174073)
Read the listen configuration from the XML of libvirt domains, restoring
it when writing new libvirt XMLs.
2015-04-14 11:12:23 +02:00
Pino Toscano
20acc1f124 filearch: move libmagic code in an own function
Also use a cleanup attribue to ease the close of the magic_t handle.

This is mostly code motion, hopefully with no actual behaviour changes.
2015-04-13 13:40:21 +02:00
Richard W.M. Jones
e062093881 v2v: Add a man page section on importing from OVA files. 2015-04-13 12:01:22 +01:00
Richard W.M. Jones
abf23ece49 v2v: Document that vCenter >= 5.0 is required (RHBZ#1174200).
vCenter 5.0 was released in 2011.  We have not tested against any
earlier versions, but it was reported that it does not work with
vCenter 4.

Thanks: Sokratis
2015-04-13 11:47:22 +01:00
Richard W.M. Jones
80fcbe6eee v2v: Document that Windows up to 8.1 / 2012R2 now supported.
Commit 2817824bd3 added support for
converting more recent versions of Windows, but neglected to document
it.
2015-04-11 16:39:53 +01:00
Richard W.M. Jones
d23134c5b8 php: Clean up more intermediate files. 2015-04-10 13:55:07 +01:00
Richard W.M. Jones
2e6b14e046 Version 1.29.34. 2015-04-10 13:48:02 +01:00
Richard W.M. Jones
3f98018b43 v2v: test-harness: Describe how to get the test harness.
I don't think it's worth building the test harness as a separate
Fedora package.  It just means the harness gets out of date
quickly and is hard to install.  Instead the test cases can now
be configured to use the libguestfs source directory to get the
test harness.
2015-04-10 13:10:13 +01:00
Richard W.M. Jones
2817824bd3 v2v: Support conversion of Windows >= 8 (RHBZ#1190669).
Tested on:

- Windows 8.1 Pro 64 bit
- Windows Server 2012 R2 64 bit
2015-04-10 12:04:02 +01:00
Richard W.M. Jones
7260b0fc08 v2v: test-harness: Don't send key to wake up guest from blank unless the display is black.
Grub2 in RHEL 6 responds to any key including shift keys by entering
the grub menu (and thus waiting for the 'user' to press Enter).  This
means our previous strategy of always hitting the shift key before
taking a screenshot didn't work well.

Instead, take a screenshot, if it's all (or mostly) black, hit a shift
key and take another screenshot.
2015-04-10 12:04:02 +01:00
Richard W.M. Jones
12be9f831e v2v: test-harness: Match on subimages instead of screenshots.
Previously we fuzzy-matched on screenshots of the entire display.

There were several problems:

 - dates/times in images required fuzzy matching, but it's not clear
   how much fuzz to use (Windows 8.1/2012R2 timestamp is huge,
   requiring an enormous amount of fuzz)

- cannot cope with Windows 7 irregular placement of windows on
  the desktop

It's better to match on subimages.

This requires some changes to the test data, using gimp to clip the
images and remove any changing elements (dates/times/etc) but in the
long run it's more flexible than fuzzy matching on the whole display.

Note that because of peculiarities in 'compare' we still need to have
a little bit of fuzz in the matching.  Seemingly bit-for-bit identical
images still have a similarity > 0.
2015-04-10 12:03:08 +01:00
Richard W.M. Jones
ddeec8b504 v2v: test-harness: Improve boot loop.
Take screenshots each time around the loop (every 10 seconds).  These
are very useful for debugging.

Check for the final screenshot on every iteration.  If the final
screenshot is encountered then the guest is terminated immediately.

Reverse a few loop tests to try to make the code more readable.
2015-04-09 19:03:11 +01:00
Richard W.M. Jones
1fabb99f11 v2v: test-harness: Rearrange 'in' in function definition.
Just a whitespace change.
2015-04-09 17:40:31 +01:00
Richard W.M. Jones
6c27ce649b v2v: test-harness: Use xzcat instead of unxz --keep.
unxz --keep fails on the symlinks used by git-annex with this
rather unnecessary error:

  unxz --keep 'rhel_511_x86_64_pv.img.xz'
  unxz: rhel_511_x86_64_pv.img.xz: Is a symbolic link, skipping

Use xzcat instead.
2015-04-09 15:08:53 +01:00
Richard W.M. Jones
a23f82a5ac v2v: test-harness: New repository URLs, and details of using git-annex. 2015-04-09 15:08:53 +01:00
Richard W.M. Jones
4fd70eab4f v2v: Add support for REG_MULTI_SZ (multiple strings) to registry editor. 2015-04-07 16:58:40 +01:00
Richard W.M. Jones
e264317b04 v2v: test-harness: Update the man page. 2015-04-01 13:57:11 +01:00
Richard W.M. Jones
3034f9a658 v2v: test-harness: Send different shift keys to wake up guests from screen blank.
See:
https://rwmj.wordpress.com/2015/03/30/tip-wake-up-a-guest-from-screen-blank/
2015-04-01 13:24:42 +01:00
Richard W.M. Jones
3cb2b9da25 Version 1.29.33. 2015-04-01 10:06:46 +01:00
Roman Kagan
b8cb5c0d69 v2v: allow configurable location for virtio drivers
Make the location of the Windows virtio drivers overridable with the
environment variable VIRTIO_WIN_DIR, in the same vein as is done for
virt-tools.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
2015-03-31 14:41:49 +01:00
Chen Hanxiao
26b9134450 actions.ml: fix a typo
s/inclding/including

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-31 13:03:02 +01:00
Chen Hanxiao
6e989fd709 resize: add p_mbr_p_type as member of type partition
Add p_mbr_p_type as member of type partition
to describe mbr partition type.

Currently we use:
List.filter (fun p -> parttype <> MBR || p.G.part_num <= 4_l)
to filter out logical partitions.

Commit 0c396a4bce
introduce API part_get_mbr_part_type,
we could use this to know the part_type.
Furthermore, we could also use p_mbr_p_type for resizing
logical partitions.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-30 18:59:52 +01:00
Richard W.M. Jones
309f7062e8 v2v: test-harness: Don't need to use Unix. prefix, since module is opened. 2015-03-30 13:27:17 +01:00
Richard W.M. Jones
6f53c6c026 v2v: test-harness: Send shift key to wake up screen from blank before taking screenshots. 2015-03-30 13:27:17 +01:00
Richard W.M. Jones
453db7e210 v2v: RHEL 4: You have to update lvm2, device-mapper to get virtio support.
Also include the updated selinux policy that goes with RHEL 4.8.

Also mention that policycoreutils should be updated - see previous
commit.
2015-03-30 13:27:17 +01:00
Richard W.M. Jones
d4ab702dad v2v: Add note about RHEL 4 conversions hanging during SELinux relabelling. 2015-03-30 13:27:17 +01:00
Richard W.M. Jones
f3c17ab0d8 builder: Fix arch= field in previous commit.
Fixes commit 8ddc564730.
2015-03-30 09:43:34 +01:00
Richard W.M. Jones
8ddc564730 builder: Update index for new armv7 Fedora guest. 2015-03-30 09:09:22 +01:00
Richard W.M. Jones
2cb691e46e builder: Add script for building Fedora armv7l (32 bit ARM) guests. 2015-03-30 09:05:07 +01:00
Richard W.M. Jones
5c65b9108d ruby: Only rebuild rdoc when absolutely necessary.
Rebuilding the ruby documentation takes 51 seconds on my laptop, and
that's a significant fraction of the entire build.  Make sure we only
rebuild the documentation when necessary.
2015-03-28 18:08:21 +00:00
Richard W.M. Jones
e86df90e52 guestfs-performance: Suggest using 'ts' instead of annotate.
'ts' allows incremental timings which is a lot more useful.
2015-03-28 17:53:35 +00:00
Richard W.M. Jones
f1007fc26d lib: Fix static linking by forcing launch-*.o objects to be always linked.
Because the launch-*.o objects only contain statically scoped
declarations, the linker doesn't need to link them in.  This causes a
problem when static linking as they will be left out of the final
binary, and so no backends will be available.

This is essentially the same problem as described here:

https://stackoverflow.com/questions/1202494/why-doesnt-attribute-constructor-work-in-a-static-library
2015-03-28 10:20:44 +00:00
Richard W.M. Jones
7906c34a0f build: Fix ./configure --without-libvirt option. 2015-03-27 22:45:08 +00:00
Richard W.M. Jones
c370ca75c8 lib: Remove bogus visibility declaration (GUESTFS_DLL_PUBLIC) from internal function. 2015-03-27 22:45:02 +00:00
Richard W.M. Jones
a1a42d0002 Version 1.29.32. 2015-03-27 11:02:18 +00:00
Richard W.M. Jones
403e32df23 fuse: Add a note about preserving inode numbers using -o use_ino.
Thanks: David Juran
2015-03-27 11:01:00 +00:00
Maros Zatko
e6dadd6aca customize: fix --upload to FAT partition (RHBZ#1196101)
Some filesystems, such as FAT doesn't support file
ownership, so show warning instead of error on EPERM.
2015-03-27 10:05:12 +00:00
Richard W.M. Jones
d308d0f703 builder: Fix rhel 5 repository location.
RHEL 5 was unusual in having separate sub-repositories (Server, VT,
Cluster etc) within the main RHEL-5-Server directory.  Thankfully no
other version of RHEL does this.  Previously we set up the repository
baseurl incorrectly so it didn't include .../Server in the path.

In commit 1a1cb1ec3c, I tried to fix the
RHEL 5 repo location to include .../Server.  However that broke the
virt-install --location parameter.

Use a separate baseurl path, which should fix both problems.

This fixes commit 1a1cb1ec3c and
commit 3bc9ba6c84.
2015-03-26 11:19:47 +00:00
Richard W.M. Jones
6f7c1663c1 Revert "builder: Fix RHEL 5 download location."
This reverts commit 1a1cb1ec3c.
2015-03-26 11:18:16 +00:00
Richard W.M. Jones
6c5451b34f v2v: test-harness: Rebuild v2v_test_harness.cmi if OCaml API changes.
The error you would have seen before was:

File "v2v_test_harness.ml", line 1:
Error: The files ../../ocaml/guestfs.cmi and v2v_test_harness.cmi
       make inconsistent assumptions over interface Guestfs
2015-03-26 09:44:23 +00:00
Richard W.M. Jones
6297534091 ocaml: Add Guestfs.Errno.errno_EPERM. 2015-03-26 09:16:44 +00:00
Chen Hanxiao
0c396a4bce New API: part_get_mbr_part_type for showing partition type
This patch will add support for getting partition type
of a partiton numbered device.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-24 13:44:16 +00:00
Chen Hanxiao
af9aa2eb05 parted: introduce enum for whether parted has option -m
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>

RWMJ: Use enum consistently, don't assign the result to int.
2015-03-24 13:35:29 +00:00
Chen Hanxiao
52d1b0c593 New API: btrfs-image
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-24 13:35:28 +00:00
Maros Zatko
ea6d4e5535 customize: add --move (RHBZ#1203817).
This adds --move SOURCE:DEST, equivalent of calling g#mv src dst.

RFE: RHBZ#1203817
2015-03-24 13:27:44 +00:00
Maros Zatko
943fec0399 customize: add --copy (RHBZ#1203817).
This adds --copy SOURCE:DEST, equivalent of calling g#cp_a src dst.

RFE: RHBZ#1203817
2015-03-24 13:27:40 +00:00
Richard W.M. Jones
c227cbcc14 Version 1.29.31. 2015-03-23 14:03:14 +00:00
Richard W.M. Jones
d48615577c builder: Add test-virt-index-validate-good-3 to EXTRA_DIST
Fixes commit fc6c16af0b.
2015-03-23 13:59:08 +00:00
Chen Hanxiao
039ba9cf19 btrfs-qgroup-show: add check for "--raw"
btrfs-prog commit:
58a39524619f38d193b8adc3d57888ec07b612aa
change the default output to binary prefix,
and introduced a new option '--raw'
to keep the traditional behaviour.

This patch will add a check function to determine
whether to add '--raw' option to 'btrfs show qgroup'.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-23 12:50:33 +00:00
Pino Toscano
fc6c16af0b builder: handle empty lines in indexes before first section (RHBZ#1201526)
Properly skip empty lines before the first section, otherwise they will
trigger a syntax error in parsing.

Add a simple test for it, so it doesn't regress.
2015-03-23 12:49:27 +00:00
Chen Hanxiao
09e239a726 tests: add test case of set-label and vfs-label for btrfs
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-23 12:49:00 +00:00
Chen Hanxiao
017f1c6729 guestfs.pod: don't encourage 'make syntax-check'
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-23 12:46:26 +00:00
Maros Zatko
7e8ed7cb21 customize: add --truncate-recursive option
Allows user to recursively truncate files in PATH. e.g.:
virt-builder --truncate-recursive /var/log

Relates to RHBZ#119673
2015-03-23 12:34:05 +00:00
Maros Zatko
ce144c4d7a virt-copy, virt-tar: show help for --help 2015-03-23 12:24:59 +00:00
Richard W.M. Jones
5a445c2e40 docs: You normally need to set SUPERMIN_KERNEL_VERSION as well. 2015-03-23 12:14:59 +00:00
Richard W.M. Jones
762c0bdab9 docs: Remove some rogue references to 'febootstrap'. 2015-03-23 12:12:23 +00:00
Richard W.M. Jones
5ac87b975f v2v: test-harness: Add support for OVA.
This makes VMware testing easier, since it means you don't need to
test against a live server.
2015-03-20 12:14:42 +00:00
Pino Toscano
04f1f1b741 generator: small optimization of pod2text cache memoization
Instead of save every time there's a new element in the cache, batch the
saving to disk every 100 changes, saving the unsaved remainder at the
exit.

While not a big optimization, this reduces a bit the disk usage during
generator run.
2015-03-12 18:08:25 +01:00
Richard W.M. Jones
078bd8ad06 v2v: test harness: Add list of FILES to the manual page. 2015-03-12 15:02:59 +00:00
Chen Hanxiao
c3fa537aeb guestfs.pod: fix a typo
s/applicance/appliance

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-12 08:30:38 +00:00
Richard W.M. Jones
32e5056f4a Revert "launch: libvirt: In debug messages use ls --lcontext instead of ls -Z."
The --lcontext option was removed from coreutils ls (in 2007, cough).

Fedora carried a patch re-adding these options [I believe
unintentionally], but that patch was dropped in Fedora 23, so the
--lcontext option is gone for good.

This reverts commit f9c5b4aa2a.
2015-03-11 17:28:19 +00:00
Richard W.M. Jones
ffa8584699 tests: mount-local: Print some more debugging along error paths.
Trying to track down a memory leak somewhere.
2015-03-11 15:08:40 +00:00
Richard W.M. Jones
0827b006e4 v2v: test-harness: Fix boot loop so it detects disk inactivity properly. 2015-03-11 15:05:13 +00:00
Richard W.M. Jones
a3beda8b77 v2v: test-harness: Measure similarity between images when comparing screenshots.
Since wallclock time differs between boots, we cannot just compare two
screenshots by checking if they are identical -- if the screenshot
contains any time information, then that will be different, and it
turns out that VMs print the current time at boot.

Therefore parse out and use the "similarity" metric printed by the
ImageMagick "compare" command when it compares the screenshots, and
allow a small epsilon for the case where a few oixels are different.
2015-03-11 15:02:58 +00:00
Richard W.M. Jones
f052270039 Version 1.29.30. 2015-03-10 21:47:15 +00:00
Richard W.M. Jones
ccb3894915 v2v: Add the test-harness used by external tests.
See the new man page virt-v2v-test-harness(1) added in this commit for
details of this library/harness, and also how to get the external
tests.
2015-03-10 19:39:23 +00:00
Chen Hanxiao
35916e700b gui: fix a syntax-check issue of bindtextdomain
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-10 19:39:23 +00:00
Richard W.M. Jones
8873c51475 po-docs: Update list of manual pages to be translated.
There should be an automatic way to keep this list updated, but while
there isn't, keep it updated by hand ...
2015-03-10 16:51:06 +00:00
Richard W.M. Jones
1fba1d1edc builder: Fix path to RHEL source RPMs in internal repo.
Thanks: Jan Scotka
2015-03-10 10:15:42 +00:00
Richard W.M. Jones
ce56c7d30e FAQ: Don't refer to RHEL 7 in future tense.
Thanks: orc_emacs on IRC.
2015-03-09 17:51:36 +00:00
Richard W.M. Jones
3053785db8 builder: Fix comparison between signed/unsigned in parallel xzcat.
block.header_size is uint32_t so cannot be compared directly with n (ssize_t).

pxzcat-c.c: In function 'worker_thread':
pxzcat-c.c:602:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (n >= 0 && n != block.header_size-1) {
                     ^
2015-03-09 13:13:16 +00:00
Richard W.M. Jones
c807546619 v2v: xml: Add some more bindings to libxml2.
These are not used by libguestfs, but are used by the external
virt-v2v tests.
2015-03-06 17:05:50 +00:00
Richard W.M. Jones
ce5a51a34c v2v: xml: Remove dependency on libguestfs internals.
This is just so I can share the code with the virt-v2v external tests.
2015-03-06 17:03:01 +00:00
Richard W.M. Jones
4ee6e4ddc8 Version 1.29.29. 2015-03-05 13:42:20 +00:00
Richard W.M. Jones
025f1d2bc7 bugs: Ignore bugs in RELEASE_PENDING state.
It's effectively the same as CLOSED.
2015-03-05 13:41:21 +00:00
Richard W.M. Jones
4592caedd4 builder: Add fedora-ppc64.sh script to EXTRA_DIST.
This updates commit 7867abc5c2.
2015-03-05 13:39:21 +00:00
Pino Toscano
1d93cb9e4b actions: improve man page links
Switch from C<> to L<> for links to man pages, where wasn't done before.
2015-03-05 12:31:57 +00:00
Maros Zatko
7867abc5c2 builder: add build script for PPC64 Fedora 2015-03-05 12:30:10 +00:00
Maros Zatko
a084758e83 customize: add --truncate option (RHBZ#119673) 2015-03-05 12:29:21 +00:00
Richard W.M. Jones
e51420c61f arm: Ignore -Wpointer-to-int-cast in c-pointer API.
This API converts the C guestfs_h pointer to a 64 bit integer,
which should always be possible on reasonable architectures.
Therefore silence a GCC warning (which only occurs on 32 bit ARM).
2015-03-05 12:18:23 +00:00
Richard W.M. Jones
af762e4342 arm: Use -M virt on 32 bit ARM, don't pass -dtb parameter.
Note this means all the dtb code in libguestfs & supermin is
obsolete/unused, and may be deleted at some point in future.
2015-03-05 10:28:59 +00:00
Chen Hanxiao
7fb85dcde3 actions.ml: fix a typo
s/tto/to

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-03 08:45:01 +00:00
Richard W.M. Jones
e6445e982a ocaml: Don't run check-valgrind on run-bindtests (bash script).
Fix the 'make check-valgrind' rule in the ocaml subdirectory so it
doesn't run '$VG run-bindtests', effectively running valgrind on bash.

Bash in Fedora Rawhide has added a new memory leak, resulting in a
failure, but we don't want to test bash anyway.
2015-03-02 17:46:06 +00:00
Richard W.M. Jones
1cdb5a103a Version 1.29.28. 2015-03-02 13:54:13 +00:00
Richard W.M. Jones
064628632b build: Fix 'maintainer-check-extra-dist' to only list relevant files. 2015-03-02 13:53:12 +00:00
Chen Hanxiao
250db12c24 New API: btrfstune_enable_skinny_metadata_extent_refs
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-02 10:27:27 +00:00
Chen Hanxiao
aa70209558 New API: btrfstune_enable_extended_inode_refs
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-02 10:27:27 +00:00
Chen Hanxiao
fa14c3d6bc New API: btrfstune_seeding
Use btrfstune_seeding to enable or disable seeding.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-03-02 10:27:27 +00:00
Richard W.M. Jones
78e1a1472c builder: Fix 'os-version' in man page examples. 2015-03-02 09:11:47 +00:00
Michael Scherer
e4944043fb Use a debian distribution for the apt example 2015-03-02 09:10:29 +00:00
Richard W.M. Jones
4e9bda4598 appliance: Create /etc/mtab in init script to work around util-linux nuttiness. 2015-02-28 11:10:31 +00:00
Richard W.M. Jones
41d4d606e5 Version 1.29.27. 2015-02-27 14:38:07 +00:00
Richard W.M. Jones
ecbbfc9ddd po-docs: Ship some untranslated PO files.
Add untranslated PO files to EXTRA_DIST.
2015-02-27 14:37:07 +00:00
Roman Kagan
6c7823b9a9 convert_windows: split firstboot into steps
Instead of doing all firstboot actions in a single script, take the
advantage of the firstboot infrastructure and store and run unrelated
actions as individual steps.

This facilitates troubleshooting and fault recovery; besides it makes
adding more actions easier.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
2015-02-27 13:25:45 +00:00
Roman Kagan
58eb977c0d firstboot: make script naming descriptive
The firstboot infrastructure used to give the firstboot scripts some
cryptic names which were impossible to relate to the actions they were
supposed to take.

This patch reworks the scheme such that the caller registering a
firstboot script has to provide a descriptive name for the action.  That
name, with non-alphanumeric characters replaced with dashes, prefixed by
the serial number, is then used as the name of the script, e.g.

  0004-install-gcc

or

  0002-msiexec--i-foo-msi.bat

OTOH the numbering becomes internal to the API, i.e. the scripts are
numbered and executed in the order they are registered.

This greatly facilitates debugging and troubleshooting in case when
there are multiple firstboot scripts.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
2015-02-27 13:25:45 +00:00
Roman Kagan
7aa9d63674 firstboot: enhance firstboot driver script for Windows
This patch is an attempt to enhance the firstboot driver script for
Windows, and make it somewhat closer in functionality to what is done
for Linux guests.

Specifically, for every firstboot script it now will log its exit
status, and, if the script reported success, move it to -done directory.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
2015-02-27 13:25:45 +00:00
Roman Kagan
3edd770b09 firstboot: consolidate line ending conversion
This patch moves line ending conversion for windows scripts into a
separate helper function.

This simplifies code a bit, and fixes the problem that actual firstboot
scripts used to remain with unix-style line endings.

Signed-off-by: Roman Kagan <rkagan@parallels.com>
2015-02-27 13:25:45 +00:00
Pino Toscano
be79bdfd3a builder: handle -v and -x flags like in other tools (RHBZ#1196100)
Make sure that -x enables tracing and -v enables verbose mode, just like
other tools do.

Kind of followup of commit b6b9b90dd7.
2015-02-26 10:01:14 +01:00
Pino Toscano
652af7a33a builder: use mkdir_p to create the cachedir (RHBZ#1195204) 2015-02-23 14:08:02 +01:00
Pino Toscano
d54132f94d mllib: add helper mkdir_p
Small function to create in OCaml-based code a directory and its
parents, much like `mkdir -p`.
2015-02-23 14:04:00 +01:00
Pino Toscano
ef992c2b07 build: fix distfiles for zanata
Followup of commit c328ac9e04.
2015-02-23 10:58:58 +01:00
Richard W.M. Jones
2acf98c784 Update translations from Zanata.
I added the new linguas for the po/ directory.  But not for the
po-docs/ directory, since the new po files hardly contain any
translations there.
2015-02-22 14:33:17 +00:00
Richard W.M. Jones
c328ac9e04 Move upstream translations from Tranifex to Zanata.
This is at the request of the Fedora localization team.
For further information see:

https://www.redhat.com/archives/libguestfs/2015-February/msg00168.html
2015-02-22 14:10:50 +00:00
Nikos Skalkotos
6200abf92e Fix a bug in e2fsck execution code
Use commandrvf() instead of commandvf() to execute e2fsck. A non-zero
exit status does not always indicate a failure.

Signed-off-by: Nikos Skalkotos <skalkoto@grnet.gr>
2015-02-18 14:43:15 +00:00
Pino Toscano
869b9fcf97 builder: when not checking sigs, ignore --fingerprint args (RHBZ#1193237)
When the user chooses to not verify the signatures on the indexes
(using --no-check-signature), there is no point in requiring as many
--fingerprint as --source (or even just one), as they will not be used
anyway.

In this case just ignore all the values of the specified --fingerprint
arguments.
2015-02-18 15:19:58 +01:00
Pino Toscano
17dabd57c7 builder: process --source sources before
Process the sources specified via the --source command line arguments
before sources read from repositories, so the former have a chance to
"override" the latter.

Related to RHBZ#1193238.
2015-02-18 15:19:44 +01:00
Richard W.M. Jones
fa36b70b20 Version 1.29.26. 2015-02-17 12:11:41 +00:00
Richard W.M. Jones
c7de22b0d3 aarch64: Add fedora-aarch64.sh builder script to EXTRA_DIST.
This fixes commit 5809a5a802.
2015-02-17 12:11:12 +00:00
Maros Zatko
568a33d7ef inspector: add /reactos as systemroot
Fixes RHBZ#709326
Related bug RHBZ#709327 seems to be already fixed in ReactOS 0.4.
2015-02-16 19:32:30 +00:00
Hu Tao
f265371868 New API: btfs_scrub_status
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-02-16 18:05:30 +00:00
Hu Tao
88dbae4cbf New API: btrfs_balance_status
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-02-16 18:05:30 +00:00
Richard W.M. Jones
6c6ce85f94 v2v: -o libvirt: Prevent possible XPath injection.
Ensure the arch string is sane before using it in the following XPath
expression.  Since the arch string can be derived from untrusted guest
data [see src/filearch.c], this prevents a possible XPath injection
vulnerability.
2015-02-14 18:46:05 +00:00
Richard W.M. Jones
c3566da409 python: Call PyErr_Clear() on non-error paths out of the Python bindings.
We also need to be more careful about PyString_FromString and similar
functions returning NULL on failure.  Currently we don't check this
every time.  This commit adds more checks, but is still not complete.
2015-02-14 18:46:05 +00:00
Richard W.M. Jones
0f029a5f58 Whitespace changes arising from the previous two commits. 2015-02-14 18:46:05 +00:00
Richard W.M. Jones
1efd8aa8f1 Change guestfs__* to guestfs_impl_*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.

The second step is to replace all guestfs__* (2 underscores) with
guestfs_impl_*.

These functions are used where a libguestfs API call is implemented on
the library side.  The generator creates a wrapper function which
calls guestfs_impl_* to do the work.  (Libguestfs APIs which are
passed directly by the daemon work differently and don't require a
guestfs_impl_* function).

This is an entirely mechanical change done using:
  git ls-files | xargs perl -pi.bak -e 's/guestfs___/guestfs_impl_/g'

Reference: http://stackoverflow.com/a/228797
2015-02-14 18:46:04 +00:00
Richard W.M. Jones
bfbcc01403 Change guestfs___* to guestfs_int_*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.

The first step is to replace all guestfs___* (3 underscores) with
guestfs_int_*.  We've used guestfs_int_* elsewhere already as a prefix
for internal identifiers.

This is an entirely mechanical change done using:
  git ls-files | xargs perl -pi.bak -e 's/guestfs___/guestfs_int_/g'

Reference: http://stackoverflow.com/a/228797
2015-02-14 18:46:04 +00:00
Richard W.M. Jones
46010912ef Update gnulib to latest. 2015-02-14 18:46:04 +00:00
Richard W.M. Jones
98aa470bc6 Update TODO.
Remove some things which have been implemented already.
2015-02-14 18:46:04 +00:00
Margaret Lewicka
5f67d23cf5 fuse: Alternatives for Linux-specific commands
* fusermount is Linux-only; on BSD and OS X umount should be used
* fuser has no -v flag on BSD/OSX, and -c is the
  POSIX-compatible equivalent of -m
* Does not solve the lack of pretty output of fuser -v, but does make it
  work on Mac OS X.
2015-02-14 09:39:49 +00:00
Richard W.M. Jones
88d16e6fb9 aarch64: builder: Fix metadata so virt-builder --size works.
The wrong partition was being expanded.

This fixes commit 5809a5a802.
2015-02-13 14:47:15 +00:00
Pino Toscano
f71168497d php: skip bindtests on 32bit platforms
bindtests checks also 64bit int values, which won't work when the
underlying platform has sizeof(long) < 8 (like on 32bit architectures).
2015-02-13 14:37:46 +01:00
Richard W.M. Jones
a34416091e daemon: btrfs: Remove full stop from end of error message.
This fixes commit 56732ed6a0.
2015-02-13 10:48:10 +00:00
Richard W.M. Jones
cae7909f5e ./run: Use 'prepend' function to build paths.
Add a bash function 'prepend' for intelligently prepending elements to
paths.  eg:

  prepend PYTHONPATH "/foo"

would set PYTHONPATH to "/foo" or "/foo:<previous-contents-of-PYTHONPATH>"

Tested by:

(1) Building and testing libguestfs twice: first without libguestfs
installed as a system library, and then with it installed.

(2) Examining the output of './run printenv' by hand and comparing
environment variables to the expected values.
2015-02-13 10:26:22 +00:00
Chen Hanxiao
928430f111 actions.ml: fix a typo
s/scannning/scanning

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2015-02-13 09:02:43 +00:00
Margaret Lewicka
b969be72cd lib: Check if crypt() comes from a separate library
Mac OS X includes crypt() in libc.
2015-02-13 08:55:44 +00:00
Margaret Lewicka
cc4baac815 run: Set DYLD_LIBRARY_PATH along with LD_LIBRARY_PATH
Mac OS X uses DYLD_LIBRARY_PATH rather than LD_LIBRARY_PATH.
2015-02-13 08:55:43 +00:00
Margaret Lewicka
5fc07e87bb macosx: Includes/defines for byteswap operations 2015-02-12 20:34:40 +00:00
Margaret Lewicka
e39ab27dea lib: Add third, zero parameter to xdrproc_t
As advised by Daniel P. Berrange, the third parameter can be passed on all
platforms rather than specifically Mac.

Quoting a libvirt commit rationale after Daniel:

 commit 9fa3a8ab6fd82ad2f5a14b490696085061418718
 Author: Doug Goldstein <cardoe@cardoe.com>
 Date:   Wed Oct 30 11:22:58 2013 -0500

   MacOS: Handle changes to xdrproc_t definition

   With Mac OS X 10.9, xdrproc_t is no longer defined as:

   typedef bool_t (*xdrproc_t)(XDR *, ...);

   but instead as:

   typedef bool_t (*xdrproc_t)(XDR *, void *, unsigned int);

   For reference, Linux systems typically define it as:

   typedef bool_t (*xdrproc_t)(XDR *, void *, ...);

   The rationale explained in the header is that using a vararg is
   incorrect and has a potential to change the ABI slightly do to compiler
   optimizations taken and the undefined behavior. They decided
   to specify the exact number of parameters and for compatibility with old
   code decided to make the signature require 3 arguments. The third
   argument is ignored for cases that its not used and its recommended to
   supply a 0.
2015-02-12 20:28:20 +00:00
Margaret Lewicka
bbc8c20a2d builder: Check HAVE_POSIX_FADVISE before using it 2015-02-12 20:27:41 +00:00
Richard W.M. Jones
5809a5a802 aarch64: builder: Add script for building Fedora aarch64 images. 2015-02-12 17:29:38 +00:00
Pino Toscano
a0892aa29e ocaml: hide internal methods from apidocs 2015-02-12 15:07:58 +01:00
Pino Toscano
3dff1582d4 actions: fix a couple of docs references 2015-02-12 14:42:57 +01:00
Pino Toscano
8c91a68b80 gobject: generate deprecation markers
Generate proper deprecation markers for API documentation and
introspection annotations.
2015-02-12 14:42:57 +01:00
Richard W.M. Jones
ab8a442952 Version 1.29.25. 2015-02-11 17:03:05 +00:00
Richard W.M. Jones
fb24d7405a tests/charsets: Fix bogus comparison of STRNEQ() == -1.
gcc 5 rightly flags this code as bogus.
2015-02-11 15:30:55 +00:00
Pino Toscano
e157226064 java: further <p> fixes
javadoc's HTML parser seems more limited, so just close <p> blocks
before opening <pre> or <ol>.

Followup of commit f4186a7a49.
2015-02-11 15:46:19 +01:00
Pino Toscano
3b8d56d491 php: add a simple bindtests test
Generate a simple bindtests test for the PHP binding, so it is possible
to easily test all the argument types.

Unlike the bindtests for other languages, optional arguments are not
tested, due to the limitations of optional arguments in PHP (or maybe
they way we implement them).
2015-02-11 15:02:57 +01:00
Pino Toscano
2b06c27fd7 php: fix memory leak in OStringList optargs
Make sure to free the char** created to convert the arguments.
2015-02-11 15:02:56 +01:00
Pino Toscano
8e4bf5cf9e php: fix invalid memory access with stringlist params
Make sure to copy the strings we add to the char** array, otherwise they
are stale pointers which we'll try to free later.

Also, properly destruct the temporary zval.
2015-02-11 15:02:56 +01:00
Pino Toscano
ee65fabd97 php: move common code in helper functions
Simple code motion.
2015-02-11 15:02:56 +01:00
Pino Toscano
4debb44a44 php: fix invalid memory access with OptString
OptString maps to a "s!" argument, which makes zend_parse_parameters not
touch the variables (char* and length) when NULL is passed as parameter.
Hence, set both to NULL/0, and check for non-NULL char* variable before
checking its length.
2015-02-11 15:02:56 +01:00
Pino Toscano
85b6b5e589 java: add @Deprecated annotation for deprecated methods 2015-02-11 15:02:56 +01:00
Pino Toscano
f4186a7a49 java: fix/improve slightly the javadoc
- use <p>..</p> for text paragraphs, instead of just using <p> to
  separate them
- slightly improve the metadata in eventToString and set_event_callback
- fix the textual @see in set_event_callback, so it is accepted also in
  JDK 8
- escape the doc text, so &, <, and > will not be considered as HTML
  tags but actual text
- use the @deprecated tag instead of adding the customary deprecation
  note to the doc text
2015-02-11 15:02:56 +01:00
Pino Toscano
8b268bd897 generator: add a simple HTML escaping function 2015-02-11 15:02:56 +01:00
Pino Toscano
4905d6eb95 Revert "java: Turn off doclint to prevent errors on JDK 8"
The errors will be fixed for good, together will other small javadoc
improvements.

This reverts commit 8940b03658.
2015-02-11 15:02:56 +01:00
Margaret Lewicka
28462caacc macosx/bsd: Use getprogname() where available 2015-02-11 13:50:33 +00:00
Margaret Lewicka
8940b03658 java: Turn off doclint to prevent errors on JDK 8
On JDK 8, doclint is enabled by default with strict validation of HTML
tags, which causes the build to fail. See
http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
2015-02-11 13:49:47 +00:00
Pino Toscano
668c4784a9 perl: tests: reenable set_path tests
guestfs_set_path now does a copy of the passed string, so bindings don't
need to take care of the lifetime of strings parameters for it.
2015-02-09 11:00:47 +01:00
Richard W.M. Jones
5cafedaa45 lib: Change 'program_name' macro to avoid conflict with gnulib.
The gnulib 'error' module uses 'program_name'.  On some platforms --
but not Linux / glibc -- it references it as:

  extern char *program_name;

This means when you compile libguestfs on non-glibc (eg. Mac OS X)
gnulib requires 'program_name' as an external string reference, which
we don't provide.

This change doesn't define this string reference for gnulib, but it
does change the name of the macro we use to avoid conflicts if we
eventually need to export 'program_name' as a string.

Thanks: Margaret Lewicka
2015-02-07 16:30:28 +00:00
Margaret Lewicka
7ddf6bcbfd macosx: Include <sys/un.h> and define SOCK_* for Mac OS X. 2015-02-06 10:01:28 +00:00
Margaret Lewicka
eaae0b614c macosx: ruby: Use correct dllib extension instead of assuming '.so'. 2015-02-06 09:53:45 +00:00
Richard W.M. Jones
f630677c14 resize: Preserve GPT GUID so we don't break EFI bootloaders (RHBZ#1189284).
When copying disks that use EFI, we created a new partition table,
randomizing the GPT GUID of the first partition.  Since EFI may store
the GUID in its NVRAM variables, this could make the guest unbootable.
2015-02-05 08:19:19 +00:00
Richard W.M. Jones
40c133b2c8 New APIs: part-set-gpt-guid and part-get-gpt-guid
In GPT, each partition has a GUID assigned randomly.  Allow this GUID
to be written and read.

Note this is different from the GUID type code which is used to
identify the type of the partition.
2015-02-05 08:19:19 +00:00
Richard W.M. Jones
b3e3750b13 daemon: Fix whitespace. 2015-02-05 08:01:48 +00:00
Richard W.M. Jones
ff1cf989fd builder: Fix large performance regression in pxzcat (RHBZ#1188866).
Commit 9135129b0f changed
two stack buffers to pointers:

-  uint8_t buf[BUFFER_SIZE];
-  unsigned char outbuf[BUFFER_SIZE];
+  CLEANUP_FREE uint8_t *buf = NULL;
+  CLEANUP_FREE uint8_t *outbuf = NULL;

but we were still using sizeof buf to calculate the size of the
buffer.  sizeof buf == 8 so the original code which used large buffers
for reading/writing the file changed to using 8 byte buffers.
2015-02-04 13:17:40 +00:00
Cédric Bosdonnat
5f663c2082 customize: Invoke zypper correctly. 2015-02-03 14:38:02 +00:00
Richard W.M. Jones
8fd4231051 btrfs: Proper error when output of 'btrfs qgroup show' command cannot be parsed.
sscanf doesn't set errno in these cases so it's wrong to call perror
here.

This fixes commit 2b7f7810ed.
2015-02-03 08:53:43 +00:00
Richard W.M. Jones
725d95422b Version 1.29.24. 2015-02-02 20:01:45 +00:00
Pino Toscano
573fe962b9 customize: add copy-in operation (RHBZ#1135585).
Add the copy-in operation to virt-customize/builder/sysprep, so it is
possible to easily copy directories at once in the guest.
2015-02-02 18:55:10 +00:00
Pino Toscano
5efce8c56d fish: use copy-in and copy-out
Simply the copy-in & copy-out commands of guestfish using the new
implementations of copy-in & copy-out in the library.
2015-02-02 18:44:52 +00:00
Pino Toscano
fb9bc908f8 New APIs: copy-in and copy-out
Currently implemented as guestfish commands, provide them instead as
single source -> destination functions for the library, so they can be
used also in other places.

These functions are not added to guestfish, since guestfish has its own
implementation (which will soon switch to call copy-in and copy-out for
multiple paths).
2015-02-02 18:44:52 +00:00
Pino Toscano
8aadde50b3 generator: add VPublicNoFish visibility type
Usable to have public functions, i.e. like VPublic, but do not showing
them in guestfish.
2015-02-02 18:44:52 +00:00
Pino Toscano
db055262d4 cmd: add the possibility to get a fd to the process stdin
Add the possibility to forward to the stdin of the process, and get the
fd for it; only in async mode for now.
2015-02-02 18:44:52 +00:00
Pino Toscano
449fab3ed1 cmd: add a child-setup callback
Easy way to do pre-exec setup in the child process.
2015-02-02 18:44:52 +00:00
Pino Toscano
c5d3d198dc cmd: add a way to run (and wait) asynchronously commands 2015-02-02 18:44:52 +00:00
Pino Toscano
4bb3c44a28 sparsify: ignore read-only devices
In copy mode, make sure to not zero-free-space devices mounted as
read-only, as we cannot write to them.

Related to RHBZ#1079625.
2015-02-02 15:02:31 +01:00
Pino Toscano
864c2ee371 sparsify: ignore read-only btrfs snapshots (RHBZ#1079625)
In copy mode, make sure to not zero-free-space read-only btrfs
snapshots, as we cannot write to them.
2015-02-02 14:50:52 +01:00
Richard W.M. Jones
8d83f57799 sparsify: Ignore read-only LVs (RHBZ#1185561). 2015-02-02 13:32:24 +00:00
Richard W.M. Jones
7d784fb9c9 mllib: Add function for comparing LVM2 UUIDs, ignoring '-' characters. 2015-02-02 13:32:24 +00:00
Richard W.M. Jones
ab950f8290 mllib: Add a better List.assoc function.
You can specify what comparison function is used; and instead of
having it raise 'Not_found', it returns a ~default value.
2015-02-02 13:32:24 +00:00
Pino Toscano
83eea0b197 tests: don't add test-dlopen twice
test-dlopen needs to be added only when libdl is available, and it is
like that already (within if HAVE_LIBDL); hence don't unconditionally
add it as well.
2015-01-29 12:00:32 +01:00
Pino Toscano
e57ed7cd34 build: use libintl where needed
Followup of commit a5426cce5f.
2015-01-29 12:00:01 +01:00
Pino Toscano
2313f28895 daemon: parted: use --part-type with recent sfdisk
Check whether --part-type is supported (in the rewritten sfdisk in
util-linux >= 2.26), and use it instead of --print-id & --change-id.

The actual result should be the same, just not using a (recently)
deprecated command line API.
2015-01-28 15:34:49 +01:00
Richard W.M. Jones
6a195d0f95 v2v: -i ova: Make error message "unsupported file format" clearer.
Thanks: Moran Goldboim
2015-01-28 13:30:55 +00:00
Pino Toscano
282a131677 customize: handle Arg.Set parameters in commands file
When reading commands from a file, handle also Arg.Set parameters, so
they can be enabled as well.
2015-01-28 09:59:27 +01:00
300 changed files with 855963 additions and 46290 deletions

11
.gitignore vendored
View File

@@ -265,6 +265,7 @@ Makefile.in
/html/virt-tar-in.1.html
/html/virt-tar-out.1.html
/html/virt-v2v.1.html
/html/virt-v2v-test-harness.1.html
/html/virt-win-reg.1.html
/inspector/actual-*.xml
/inspector/stamp-virt-inspector.pod
@@ -387,6 +388,7 @@ Makefile.in
/php/extension/php-for-tests.sh
/php/extension/php_guestfs_php.h
/php/extension/run-tests.php
/php/extension/tests/guestfs_php_bindtests.phpt
/php/extension/tmp-php.ini
/pick-guests.pl
/po-docs/*/*.1
@@ -436,6 +438,7 @@ Makefile.in
/ruby/ext/guestfs/_guestfs.so
/ruby/ext/guestfs/mkmf.log
/ruby/Rakefile
/ruby/stamp-rdoc
/run
/sparsify/.depend
/sparsify/link.sh
@@ -512,12 +515,14 @@ Makefile.in
/tests/data/100krandom
/tests/data/10klines
/tests/data/abssymlink
/tests/data/bin-x86_64-dynamic.gz
/tests/data/blank-disk-*
/tests/data/blank-disk-*
/tests/data/hello.b64
/tests/data/initrd
/tests/data/initrd-x86_64.img
/tests/data/initrd-x86_64.img.gz
/tests/data/lib-i586.so.xz
/tests/data/test-grep.txt.gz
/tests/data/test.iso
/tests/disks/test-qemu-drive-libvirt.xml
@@ -566,6 +571,10 @@ Makefile.in
/v2v/rhel-6.5.img
/v2v/rhel-7.0.img
/v2v/stamp-virt-v2v.pod
/v2v/test-v2v-networks-and-bridges.xml
/v2v/test-harness/.depend
/v2v/test-harness/META
/v2v/test-harness/dllv2v_test_harness.so
/v2v/test-harness/stamp-virt-v2v-test-harness.pod
/v2v/test-harness/virt-v2v-test-harness.1
/v2v/virt-v2v
/v2v/virt-v2v.1

Submodule .gnulib updated: 322e0b052c...3ca9a533c2

View File

@@ -1,12 +0,0 @@
[main]
host = https://www.transifex.com
[libguestfs.libguestfspot]
file_filter = po/<lang>.po
source_file = po/libguestfs.pot
source_lang = en
[libguestfs.libguestfsdocspot]
file_filter = po-docs/<lang>.po
source_file = po-docs/libguestfs-docs.pot
source_lang = en

View File

@@ -3,8 +3,10 @@ Angus Salkeld
Ani Peter
Bastien ROUCARIÈS
Charles Duffy
Chen Hanxiao
Cole Robinson
Colin Walters
Cédric Bosdonnat
Dan Lipsitt
Daniel Berrange
Daniel Cabrera
@@ -30,6 +32,7 @@ Karel Klíč
Kashyap Chamarthy
Lee Yarwood
Marcin Gibula
Margaret Lewicka
Maros Zatko
Martin Kletzander
Masami HIRATA
@@ -51,6 +54,7 @@ Piotr Drąg
Qin Guan
Rajesh Ranjan
Richard W.M. Jones
Roman Kagan
Sandeep Shedmake
Shahar Havivi
Shankar Prasad

601
BUGS
View File

@@ -1,5 +1,5 @@
NOTE: This file is automatically generated from "update-bugs.sh".
Last updated: 2015-01-26
Last updated: 2015-04-27
This contains a local list of the bugs that are open against
libguestfs. Bugs are tracked in the Red Hat Bugzilla database
@@ -32,21 +32,12 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
578103 NEW https://bugzilla.redhat.com/show_bug.cgi?id=578103
[RFE] Tool to Compare Windows Registry Entries
604041 NEW https://bugzilla.redhat.com/show_bug.cgi?id=604041
guestmount absolute symlinks don't work
637251 NEW https://bugzilla.redhat.com/show_bug.cgi?id=637251
virt-inspector fails to recognize data-only NTFS disk image
693064 NEW https://bugzilla.redhat.com/show_bug.cgi?id=693064
Symbolic links on ntfs-3g are not followed correctly by some commands
709326 NEW https://bugzilla.redhat.com/show_bug.cgi?id=709326
virt-inspector cannot detect ReactOS
737261 NEW https://bugzilla.redhat.com/show_bug.cgi?id=737261
libguestfs grub-install API needs grub1
745576 NEW https://bugzilla.redhat.com/show_bug.cgi?id=745576
libguestfs (or qemu?) hangs if sparse file runs out of disk space
@@ -62,26 +53,17 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
790837 NEW https://bugzilla.redhat.com/show_bug.cgi?id=790837
Use of atexit to clean up handles is wrong in multithreaded programs
803643 NEW https://bugzilla.redhat.com/show_bug.cgi?id=803643
inspect-is-multipart return false when inspection results should be true
803650 NEW https://bugzilla.redhat.com/show_bug.cgi?id=803650
inspect-is-live return false when inspection results should be true
803657 NEW https://bugzilla.redhat.com/show_bug.cgi?id=803657
[RFE] inspect-is-netinst : support more distributions
813290 NEW https://bugzilla.redhat.com/show_bug.cgi?id=813290
mdadm (md-detail) test occasionally fails with 'md device /dev/md125 does not appear to be active.'
822538 NEW https://bugzilla.redhat.com/show_bug.cgi?id=822538
libguestfs tools hang on qcow2 encrypted disks
823758 NEW https://bugzilla.redhat.com/show_bug.cgi?id=823758
p2v client should have largest number restrictions for CPU and Memory settings
824021 NEW https://bugzilla.redhat.com/show_bug.cgi?id=824021
inspection cannot recognize guest which uses btrfs subvolumes for root
824782 NEW https://bugzilla.redhat.com/show_bug.cgi?id=824782
virt-resize cannot resize PowerPC guests
824867 NEW https://bugzilla.redhat.com/show_bug.cgi?id=824867
Windows guest with dynamic disk can not boot on rhev after conversion by virt-p2v
832602 NEW https://bugzilla.redhat.com/show_bug.cgi?id=832602
"error in chunked encoding" when trying to extract (tar-out) a truncated ISO image
@@ -92,15 +74,18 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
835622 NEW https://bugzilla.redhat.com/show_bug.cgi?id=835622
RFE: virt-sparsify should be able to sparsify onto a thin-provisioned LV
845234 NEW https://bugzilla.redhat.com/show_bug.cgi?id=845234
RFE: virt-ls on Windows guest doesn't support drive letters
848464 NEW https://bugzilla.redhat.com/show_bug.cgi?id=848464
gobject javascript bindings cannot use 64 bit integers
848926 NEW https://bugzilla.redhat.com/show_bug.cgi?id=848926
virt-v2v should verify that the RHEV-M domain is an export storage domain
855058 NEW https://bugzilla.redhat.com/show_bug.cgi?id=855058
RFE: virt-p2v: display more information about storage devices
855059 NEW https://bugzilla.redhat.com/show_bug.cgi?id=855059
RFE: virt-p2v: display more information about network devices such as topology, bonding, etc.
857763 NEW https://bugzilla.redhat.com/show_bug.cgi?id=857763
libguestfs 'file-architecture' returns 'ARM' for arm binaries
@@ -110,6 +95,9 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
887826 NEW https://bugzilla.redhat.com/show_bug.cgi?id=887826
RFE: virt-sparsify cannot handle multi-disk virtual machines (eg. if they use LVM, MD, LDM, etc)
889082 NEW https://bugzilla.redhat.com/show_bug.cgi?id=889082
[RFE]virt-p2v should check whether guest with same name exist on target first then transfer the disk
891909 NEW https://bugzilla.redhat.com/show_bug.cgi?id=891909
Can't make install with non-standard prefix as non-root
@@ -158,9 +146,6 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
973138 NEW https://bugzilla.redhat.com/show_bug.cgi?id=973138
RFE: sh & debug sh should be able to capture all output and error return code
979392 NEW https://bugzilla.redhat.com/show_bug.cgi?id=979392
[abrt] virt-manager crash from libguestfs launch_libvirt
982516 NEW https://bugzilla.redhat.com/show_bug.cgi?id=982516
sh "rpm -Va" fails because apparently /dev/shm is not created/bind-mounted correctly
@@ -173,9 +158,6 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
987829 NEW https://bugzilla.redhat.com/show_bug.cgi?id=987829
virt-resize error: "lvm_set_filter: vgchange: Couldn't find device with uuid .. Refusing activation of partial LV"
988100 NEW https://bugzilla.redhat.com/show_bug.cgi?id=988100
RFE: journal reader in guestfish
991641 NEW https://bugzilla.redhat.com/show_bug.cgi?id=991641
virt-sysprep fs-uuids plugin doesn't update UUIDs in fstab, elsewhere
@@ -209,27 +191,9 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1051694 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1051694
libguestfs FTBFS on Ubuntu saucy
1056045 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1056045
virt-v2v OVA import fails when no (optional) manifest file is included
1056047 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1056047
virt-df generates no output for Solaris 11 x86_64 guest.
1056126 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1056126
virt-v2v OVA/OVF import fails with 'MegaBytes' as memory allocation units
1056534 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1056534
virt-v2v OVF/OVA import fails when disks aren't attached to either IDE or SCSI controllers
1056640 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1056640
virt-v2v OVA/OVF import fails when no (optional) ovf:capacityAllocationUnits is specified
1056983 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1056983
virt-v2v OVA/OVF import fails when no (optional) ovf:populatedSize is specified
1057006 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1057006
virt-v2v OVA/OVF import fails when no (optional) Name under VirtualSystem is specified
1057873 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1057873
libguestfs df/ subdirectory tests fail occasionally
@@ -248,9 +212,6 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1075594 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1075594
RFE: python-libguestfs should be available on pypi
1079625 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1079625
virt-sparsify fails if a btrfs filesystem contains readonly snapshots
1079734 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1079734
Tiny Core Linux is not recognized by libguestfs inspection
@@ -296,15 +257,9 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1108171 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1108171
RFE: virt-builder should be able to build PXE images for baremetal installation
1109144 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1109144
virt-builder --get-kernel doesn't fetch the dtb from images
1111794 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1111794
virt-sparsify leaves lots of data in TMPDIR
1113153 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1113153
RFE: Inspection should support systemd mount units
1114012 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1114012
"yum install guestfish" on fresh Fedora 20 results in broken libguestfs
@@ -314,54 +269,30 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1129110 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1129110
Libguestfs NTFS not setting ACLs
1130506 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1130506
RFE: virt-sparsify in copying mode should support qemu detect-zeroes
1132652 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1132652
virt-sysprep firstboot doesn't work with RHEL 7 guest
1134726 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1134726
[RFE] virt-builder should support args with the --run command
1135064 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1135064
virt-sparsify fails at /sys/block/sdb/dev discovery
1135585 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1135585
[RFE] virt-builder should support copying in a directory/list of files
1136371 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1136371
add apt-rpm support to supermin
1139785 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1139785
virt-sysprep should change UUID fields in /etc/sysconfig/network-scripts/ifcfg-* files
1141451 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1141451
Failures in tests: /dev/sda1: No such file or directory
1142184 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1142184
virt-sparsify --help print description of a option which is hard to get common understanding
1144137 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1144137
virt-inspector fails on Minix 3 guest
1144138 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1144138
virt-inspector fails on FreeBSD 9.3 guest
1145583 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1145583
xen kernel should be removed from boot menu after conversion by virt-v2v
1146007 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1146007
Input/output error during conversion of esx guest.
1146339 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1146339
Improve the error showing when no enough space left on host while conversion
1146477 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1146477
virt-v2v sometimes hangs with printing: Add. Sense: No additional sense information
1146832 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1146832
virt-v2v fail to convert guest with disk type volume
1150298 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1150298
ARM 32 bit on Ubuntu: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
@@ -413,15 +344,9 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1155229 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1155229
RFE: Allow uploading virt-v2v converted images directly to Cinder
1159030 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1159030
libvirt backend does not set RBD password
1161019 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1161019
Remove rhev related files(rhsrvany.exe and rhev-apt.exe) after conversion of windows guests to kvm
1164708 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1164708
set-label can only set <=127 bytes for btrfs and <=126 bytes for ntfs filesystem which not meet the help message. Also for ntfs it should give a warning message when the length >128 bytes
1164729 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1164729
set-label can only set <=63 bytes for btrfs and ntfs filesystem which not meet the help message. Also for btrfs and ntfs it should give a warning message when the length exceed the limited length
@@ -446,9 +371,6 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1167922 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1167922
p2v: No virtual console
1168144 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1168144
warning: fstrim: fstrim: /sysroot/: FITRIM ioctl failed: Operation not supported (ignored) when convert win2003 guest from xen server
1168626 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1168626
Tracker: Build RHEL 7.1 - based virt-p2v ISO
@@ -467,27 +389,15 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1172659 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1172659
virt-resize --expand fails on ubuntu-14.04.img image (regression)
1172660 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1172660
virt-resize --expand fails on ubuntu-14.04.img image
1173462 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1173462
virt-resize on RHEL 5.7 fails to resize the raw format disk image
1173695 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1173695
Error occurred when install a rhel guest with disk pool
1174073 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1174073
The listen address for vnc is changed after conversion by virt-v2v
1174200 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1174200
New virt-v2v failure: CURL: Error opening file: NSS: client certificate not found (nickname not specified): Invalid argument
1174551 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1174551
"lstatnslist" and "lstatlist" don't give an error if the API is used wrongly
1176493 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1176493
virt-v2v ignores sound device when convert xen guest to local kvm
1176526 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1176526
virt-resize cannot shrink ext filesystem by a small amount
@@ -495,7 +405,7 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
File /etc/sysconfig/kernel isn't updated when convert XenPV guest with regular kernel installed
1177460 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1177460
virt-customize does not work with fedora 21 atomic
virt-customize does not work with fedora atomic
1177910 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1177910
Libguestfs fails to locate the qemu-kvm on POWER8(BE) host.
@@ -509,9 +419,6 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1180769 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1180769
Security context on image file gets reset
1183234 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1183234
part_get_mbr_id test fails: sfdisk --change-id: sfdisk: change-id is deprecated in favour of ---part-type
1183493 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1183493
RFE: virt-rescue: add a flag to autorun the suggested mount commands and chroot, suggested with --suggest
@@ -521,8 +428,86 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
1184762 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1184762
fuse test deadlocks on Rawhide
1185561 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1185561
virt-sparsify should ignore read-only LVs
1186800 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1186800
virt-v2v should support gzip format ova as input
1186935 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1186935
libguestfs cannot inspect recent Fedora / RHEL >= 7 when /usr is a separate partition
1188553 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1188553
'btrfs qgroup show' output changed, breaks libguestfs
1190666 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1190666
virt-builder should get RHEL images from RHN
1193238 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1193238
Specifying a --source option doesn't overwrite the built-in templates
1195278 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1195278
libguestfs-test-tool fails in nested environment
1195881 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1195881
virt-builder can't docker pull
1197786 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1197786
virt-builder fails --get-kernel on F21 PPC64 iso
1199605 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1199605
FTBFS: requires file >= 5.11-22 but file = 5.11-21 is in release
1203595 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1203595
No error messages output if append '--format qcow2' after '-a guest.img', guest.img is a raw format image file
1203816 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1203816
virt-sysprep should error if a command line flag is not used because the operation is disabled
1203898 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1203898
Support inspecting docker images without /etc/fstab
1204063 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1204063
virt-resize should warn if it cannot resize filesystems because optional support is missing
1204131 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1204131
RFE: virt-builder creates qcow v3 images, add build option for qcow v2
1212507 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1212507
sfdisk-disk-geometry fails to display the disk geometry from the partition
1212546 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1212546
rsync-out fails to synchronize filesystem with remote filesystem
1212556 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1212556
The system release info get from 'utsname' is different from the host
1212679 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1212679
Failed to create a augeas handle with flag=8 because of custom lens (guestfs_lvm_conf.aug)
1212680 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1212680
RFE: virt-inspector xpath query should output a neat format of the query element
1212807 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1212807
virt-builder --selinux-relabel flag fails on cross-architecture builds
1212808 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1212808
RFE: virt-builder --touch
1213274 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1213274
Improve the misunderstanding error messages of virt-tar-in/virt-tar-out/virt-copy-in/virt-copy-out
1213319 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1213319
[RFE]virt-v2v support convert guest with all interface types to others
1213691 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1213691
Win2012R2 guest fails to boot on iscsi data domain after conversion by virt-v2v
1213701 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1213701
Fail to import win8/win2012 to rhev with error "selected display type is not supported"
1213844 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1213844
guestfish should reset the console on ^Z
1215803 NEW https://bugzilla.redhat.com/show_bug.cgi?id=1215803
'/var/lib/random-seed: No such file or directory' with virt-tools on images with bind-mount of /var
503134 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=503134
guestfish's list splitting does not recognize internal quoting
@@ -536,28 +521,55 @@ Bugs in NEW or ASSIGNED state are open and waiting for someone to fix.
547488 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=547488
guestfish cannot tab complete filenames that contain spaces
604041 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=604041
guestmount absolute symlinks don't work
619334 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=619334
RFE: Enable coredump capture in the appliance
691389 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=691389
SELinux labels don't work over guestmount (FUSE)
824782 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=824782
virt-resize cannot resize PowerPC guests
845234 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=845234
RFE: virt-ls on Windows guest doesn't support drive letters
988100 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=988100
RFE: journal reader in guestfish
1069966 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1069966
RFE: let virt-builder etc build ARM guests on x86 host
1109144 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1109144
virt-builder --get-kernel doesn't fetch the dtb from images
1113153 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1113153
RFE: Inspection should support systemd mount units
1130506 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1130506
RFE: virt-sparsify in copying mode should support qemu detect-zeroes
1141631 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1141631
[RFE] virt-v2v should support convert a guest to a dir-pool with using pool's uuid
1143887 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1143887
Warning shows when converting guests to rhev:chown: changing ownership of ?/tmp/v2v.u48xag/*.ovf?: Invalid argument
1145908 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1145908
No virtio drivers available warning shows when converting win8 guest
1144138 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1144138
virt-inspector fails on FreeBSD 9.3 guest
1156298 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1156298
Remove files in package libguestfs-bash-completion, these files are bash completion files, some of the virt tool completion are already implement in another file, so can remove its completion file
(179 bugs)
1198344 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1198344
[RFE] virt-builder should support download resume
1211996 ASSIGNED https://bugzilla.redhat.com/show_bug.cgi?id=1211996
virt-inspector gives incorrect arch (ppc64) for ppc64le guest
(183 bugs)
--------------------------------------------------
Bugs in MODIFIED, POST or ON_QA state are fixed.
@@ -566,20 +578,11 @@ You can help by testing the fixes.
1028650 POST https://bugzilla.redhat.com/show_bug.cgi?id=1028650
virt-* argument parser doesn't accept --arg=value (you have to use --arg value)
1175196 POST https://bugzilla.redhat.com/show_bug.cgi?id=1175196
"parse-environment" and "parse-environment-list" fail to parse "LIBGUESTFS_TRACE = 0"
1174073 POST https://bugzilla.redhat.com/show_bug.cgi?id=1174073
The listen address for vnc is changed after conversion by virt-v2v
1175676 POST https://bugzilla.redhat.com/show_bug.cgi?id=1175676
Typo error in 'help ping-daemon'
1176591 POST https://bugzilla.redhat.com/show_bug.cgi?id=1176591
virt-v2v -o vdsm doesn't work with multiple data domains
1176598 POST https://bugzilla.redhat.com/show_bug.cgi?id=1176598
virt-v2v -o vdsm write ovf to specify domain
1182463 POST https://bugzilla.redhat.com/show_bug.cgi?id=1182463
"mknod-b", "mknod-c", and "mkfifo" do not strip non-permissions bits from "mode"
1194472 POST https://bugzilla.redhat.com/show_bug.cgi?id=1194472
Current virt-builder index breaks version < 1.26
1053847 MODIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1053847
Recommended default clock/timer settings
@@ -587,35 +590,14 @@ You can help by testing the fixes.
1020950 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1020950
CVE-2013-4419 libguestfs: insecure temporary directory handling for guestfish's network socket [epel-5]
1021149 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1021149
Rebase libguestfs to 1.28 in RHEL 7.1
1076213 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1076213
OpenStack as a v2v target.
1100530 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1100530
These APIs also need to add to `guestfish -h` command list
1100533 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1100533
Missing 'user-cancel' documentation in guestfish(1)
1122557 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1122557
virt-sparsify overwrites block devices if used as output files
1128942 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1128942
libguests tools failing on images containing a colon in the path
1138630 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1138630
Remove user accounts from "/etc/shadow" when exeucte virt-sysprep with '--enable user-account' option
1140946 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1140946
qemu-img shows error message for backing file twice
1153846 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1153846
Redundancy whitespace at the end of directory name when use <TAB> to complete the directory name in guestfish with a xfs filesystem in guest
1159030 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1159030
libvirt backend does not set RBD password
1160203 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1160203
log of virt-sysprep contains only the output of the last script
1164708 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1164708
set-label can only set <=127 bytes for btrfs and <=126 bytes for ntfs filesystem which not meet the help message. Also for ntfs it should give a warning message when the length >128 bytes
1165564 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1165564
Provide Reboot/Shutdown button after virt-p2v
@@ -629,302 +611,119 @@ You can help by testing the fixes.
1167774 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1167774
virt-p2v fails with error:"nbd.c:nbd_receive_negotiate():L501: read failed"
(22 bugs)
1172660 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1172660
virt-resize --expand fails on ubuntu-14.04.img image
1174200 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1174200
New virt-v2v failure: CURL: Error opening file: NSS: client certificate not found (nickname not specified): Invalid argument
1175196 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1175196
"parse-environment" and "parse-environment-list" fail to parse "LIBGUESTFS_TRACE = 0"
1175676 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1175676
Typo error in 'help ping-daemon'
1176493 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1176493
virt-v2v ignores sound device when convert xen guest to local kvm
1176591 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1176591
virt-v2v -o vdsm doesn't work with multiple data domains
1176598 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1176598
virt-v2v -o vdsm write ovf to specify domain
1182463 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1182463
"mknod-b", "mknod-c", and "mkfifo" do not strip non-permissions bits from "mode"
1196705 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1196705
libguestfs requires selinux-policy, but selinux-policy should be optional
1201507 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1201507
fuse missing from BuildRequires
1209225 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1209225
Allow configurable location for virtio drivers
1211321 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1211321
kernel dependency dropped between libguestfs-1.28.1-1.18.el7 and RHEL 7.2
1212002 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1212002
yum install guestfish fails on RHEL 7.1
1212677 ON_QA https://bugzilla.redhat.com/show_bug.cgi?id=1212677
guestfish fails to add a remote image with ssh protocol
(26 bugs)
--------------------------------------------------
These bugs are in the VERIFIED state.
805417 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=805417
RFE: support inspection of installation ISOs of WinVista, Win7, Win2008 & Win2008r2
980790 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=980790
fstrim returns error "FITRIM ioctl failed: Inappropriate ioctl for device"
1028676 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1028676
Add virt-builder to RHEL 7.1
1041552 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1041552
virt-sysprep should remove Pegasus certificates
1042780 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1042780
Support the virt-sysprep --delete option
1073917 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1073917
java bindings inspect_list_applications2 throws java.lang.ArrayIndexOutOfBoundsException:
1074005 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1074005
java bindings inspect_list_applications2 throws java.lang.ArrayIndexOutOfBoundsException:
1091803 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1091803
tar-in-opts execute failed that cause libguestfs appliance crashed
1091856 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1091856
scrub-file can't handle link file
1091859 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1091859
scrub-file can't handle link file
1099284 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1099284
typo errors in man pages
1100528 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1100528
1100530 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1100530
These APIs also need to add to `guestfish -h` command list
1113020 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1113020
Support virt-sparsify option to allow specifying temporary file or block device
1100533 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1100533
Missing 'user-cancel' documentation in guestfish(1)
1123797 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1123797
libguestfs 'direct' backend should close file descriptors before exec-ing qemu to avoid leaking !O_CLOEXEC fds
1122557 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1122557
virt-sparsify overwrites block devices if used as output files
1136739 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1136739
virt-v2v warning info should be printed to fill the whole line
1128942 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1128942
libguests tools failing on images containing a colon in the path
1138182 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1138182
xen guest will be kernel panic after converted by virt-v2v
1138184 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1138184
virt-v2v will fail when converting guests with initramfs-*kdump.img under /boot
1138504 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1138504
Support conversion of guests from remote kvm/xen/esx connections by virt-v2v
1138586 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1138586
No error shows when converting running guest with virt-v2v
1138634 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1138634
1138630 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1138630
Remove user accounts from "/etc/shadow" when exeucte virt-sysprep with '--enable user-account' option
1139543 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1139543
Improve the error info when converting guest with no space left
1139973 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1139973
Improve the error info when converting xen guest with no passwordless SSH access configured
1140050 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1140050
No error shows when multiple conflicting options used with virt-v2v
1140547 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1140547
virt-builder option '--format' don't work well
1140894 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1140894
No error messages output if append '--format qcow2' after '-a guest.img', guest.img is a raw format image file
1141113 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1141113
virt-v2v fails to convert esx guests
1141145 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1141145
virt-v2v fails to convert xen pv guests.
1141157 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1141157
virt-sysprep option '--user-accounts' don't work well
1141626 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1141626
virt-sysprep option '--password' don't work well, it will cause login problem and if execute with other options it will take no effect
1141654 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1141654
virt-v2v: error: access: No such file or directory shows when converting xen/esx guests
1141680 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1141680
[RFE] virt-v2 should support convert a domain with using domain's UUID instead of domain name
1141723 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1141723
virt-v2v: error: disk sda has no defined format shows when converting xen hvm guest
1142004 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1142004
virt-v2v prints warning:WARNING:/files/boot/grub/device.map references unknown device "xvda"
1142008 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1142008
Conversion guest cannot been seen on rhevm server
1142158 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1142158
Illegal command 'part-get-name /dev/sda1 1' cause libguestfs appliance crashed
1142178 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1142178
virt-customize: No error messages output if append '--format qcow2' after '-a guest.img', guest.img is a raw format image file
1142186 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1142186
virt-sysprep option '--mount-options' don't work well
1142416 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1142416
part-get-name give 'libguestfs: error: part_get_name: parted does not support the machine output (-m)' error message when run 'part-get-name /dev/sda 1'
1143866 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1143866
virt-v2v fails with error: cannot open Packages index using db5
1143883 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1143883
warning shows when converting rhel7 guest:virt-v2v:could not update grub2 console: aug_get: no matching node (ignored)
1143949 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1143949
virt-customize option '--password-crypto' do not work
1144197 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1144197
Disable libguestfs UML backend mode in RHEL7
1144201 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1144201
guestfish can not restore terminal's output colour when exit guestfish, if the terminal's background colour is black then it will make a inconvenient
1144766 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1144766
futimens() is a no-op via guestmount
1144927 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1144927
Syntax error in lens definition: /usr/share/guestfs/guestfs_lvm_conf.aug:28.25-.40:Could not load module Quote for Quote.do_dquotee
1145582 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1145582
Failed to import sparse qcow2 disk image after converting to rhevm
1145916 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1145916
virt-v2v fails to convert win7 guest
1145995 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1145995
Improve the error info when converting windows guest with unclean file system
1146017 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1146017
virt-v2v -v -x during windows guest conversion will hang at hivex: hivex_open: used block id ??
1146815 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1146815
virt-v2v prints warning: /files/etc/fstab/8/spec references unknown device "cdrom"
1147065 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1147065
regression setting root password with virt-builder/virt-customize
1147313 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1147313
virt-v2v cmd with option --qemu-boot doesn't work: "qemu-system-x86_64: command not found"
1149640 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1149640
hardcoded el7 disttag in BR makes build fail on ppc64le
1150475 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1150475
Exporting 2+ disk guest to RHEV, only one disk shows after import
1150701 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1150701
virt-v2v does not fstrim data disks and non-mounted filesystems
1150815 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1150815
Can not find "RECURSIVE LONG LISTING" in 'man virt-diff'
1150867 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1150867
'copy-file-to-file /src /dest' create file /dest even if command 'copy-file-to-file /src /dest' failed
1150880 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1150880
virt-v2v: warning: display <graphics type='sdl'> was ignored when converting rhel5 guest with sdl graphics
1151033 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151033
virt-v2v conversions from VMware vCenter server run slowly
1151725 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151725
virt-v2v: warning: /files/boot/grub/device.map/hd0 references unknown device "sda" when convert a guest with ide bus
1151738 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151738
typo error in man page of virt-edit
1146832 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1146832
virt-v2v fail to convert guest with disk type volume
1151739 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151739
typo error in man page of virt-edit
1151766 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151766
libguestfs-bash-completion package contains file /usr/share/bash-completion/completions/virt-log, but no _virt_log() function in that file
1151900 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151900
Should also add a field for directory files when run virt-ls with --csv option
1151901 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151901
Should also add a field for directory files when run virt-ls with --csv option
1151910 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151910
virt-ls should remove '/' in the output when specify the directory name as /etc/
1151911 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1151911
virt-ls should remove '/' in the output when specify the directory name as /etc/
1152998 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1152998
virt-v2v / qemu-img fails on ova image
1153515 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1153515
empty (but set) LIBGUESTFS_BACKEND prints libguestfs: error: invalid backend:
1153589 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1153589
virt-v2v will hang when converting esx guest before disk copy phase
1153730 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1153730
Booting windows 2008 R2 if=virtio gets BSOD
1153844 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1153844
1153846 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1153846
Redundancy whitespace at the end of directory name when use <TAB> to complete the directory name in guestfish with a xfs filesystem in guest
1153974 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1153974
guestfish prints 'n' in error message
1155121 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1155121
Virt-v2v will fail when using relative path for -i ova
1155610 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1155610
disable uninstallation of VMware drivers on Linux for RHEL 7.1
1156301 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1156301
virt-inspector support adding a remote disk, but in its man page -a URI / --add URI is missing
1157691 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1157691
virt-p2v-make-disk should add firmwares
1158526 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1158526
Use password file instead of process interaction
1159258 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1159258
esx win2008 32 bit guest fail to load after conversion because the firmware isn't ACPI compatible
1159651 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1159651
virt-sysprep firstboot script is not deleted if it reboot a RHEL 7 guest
1160043 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1160043
virt-sysprep firstboot script is not deleted if it reboot a RHEL 7 guest
1160199 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1160199
1160203 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1160203
log of virt-sysprep contains only the output of the last script
1161575 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1161575
Failed to import guest with "rtl8139" nic to openstack server after converted by v2v
1162966 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1162966
xfs should also give a warning out to let customer know the limitation
1164619 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1164619
Inspect-get-icon failed on RHEL7 guest
1164697 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1164697
typo errors in man pages
1164732 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1164732
The description of 'help append' is not accurately, it add the kernel options to libguestfs appliance not the guest kernel
1164734 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1164734
The description of 'help append' is not accurately, it add the kernel options to libguestfs appliance not the guest kernel
1164853 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1164853
Booting in qemu found no volume groups and failed checking the filesystems
1165975 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1165975
File "/boot/grub2/device.map" showing is not right after converting a rhel7 guest from esx server
1166618 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1166618
virt-resize should give out the detail warning info to let customers know what's going wrong
1167302 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1167302
virt-v2v: warning: ova hard disk has no parent controller when convert from a ova file
1168632 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1168632
Fix kickstart for virt-p2v
1168144 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1168144
warning: fstrim: fstrim: /sysroot/: FITRIM ioctl failed: Operation not supported (ignored) when convert win2003 guest from xen server
1168751 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1168751
broken lvm-set-filter API with newer lvm2
1170073 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1170073
virt-v2v picks debug kernels over non-debug kernels when versions are equal
1186850 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1186850
Update RHEV APT.exe
1171130 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1171130
virt-v2v conversion of RHEL 3 guest fails with: All of your loopback devices are in use
1187231 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1187231
rhsrvany crashes when run as a service
1174123 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1174123
Graphics password disappear after conversion of virt-v2v
1190669 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1190669
Support virt-v2v conversion of Windows > 7
(97 bugs)
1213324 VERIFIED https://bugzilla.redhat.com/show_bug.cgi?id=1213324
virt-v2v: warning: unknown guest operating system: windows windows 6.3 when converting win8,win8.1,win2012,win2012R2 to rhev
(22 bugs)
End of BUGS file.

View File

@@ -137,6 +137,9 @@ SUBDIRS += \
sparsify \
sysprep \
v2v
if HAVE_OCAML_PKG_LIBVIRT
SUBDIRS += v2v/test-harness
endif
endif
# Perl tools.
@@ -159,7 +162,6 @@ EXTRA_DIST = \
.gitignore \
.lvimrc \
.mailmap \
.tx/config \
bootstrap \
bugs-in-changelog.sh \
autogen.sh \
@@ -204,9 +206,10 @@ EXTRA_DIST = \
tests/run-xml-to-junit.sh \
tests/run-xml-to-junit.xsl \
tmp/.gitignore \
tx-pull.sh \
update-bugs.sh \
valgrind-suppressions \
zanata.xml \
zanata-pull.sh \
.x-sc_avoid_ctype_macros \
.x-sc_prohibit_have_config_h \
.x-sc_prohibit_magic_number_exit \
@@ -550,8 +553,12 @@ maintainer-check-extra-dist:
zcat $(PACKAGE_NAME)-$(VERSION).tar.gz | tar tf - | sort | \
sed 's,^$(PACKAGE_NAME)-$(VERSION)/,,' > tmp/tarfiles
git ls-files | sort > tmp/gitfiles
diff -ur tmp/tarfiles tmp/gitfiles | grep '^\+' | \
grep -v src/api-support/[0-9]
diff -ur tmp/tarfiles tmp/gitfiles | \
grep '^\+' | \
grep -v '^\+src/api-support/[0-9]' | \
grep -v '^\+intltool-.*\.in' | \
grep -v '^\+.gitmodules' | \
grep -v '^\+.gnulib' ||:
rm tmp/tarfiles tmp/gitfiles
# Provide help on common Makefile targets.

6
README
View File

@@ -244,6 +244,8 @@ The full requirements are described below.
+--------------+-------------+---+-----------------------------------------+
| ocaml-ounit | | O | For the tests of the common OCaml |
| | | | modules. |
+--------------+-------------+---+-----------------------------------------+
| ocaml-libvirt| 0.6.1.5 | O | For building the virt-v2v test harness. |
+==============+=============+===+=========================================+
R = Required
O = Optional
@@ -385,8 +387,8 @@ distributions. Non-Linux ports are trickier, but we will accept
patches if they aren't too invasive.
The main porting issues are with the dependencies needed to build the
appliance. You will need to port febootstrap first
(http://people.redhat.com/~rjones/febootstrap/).
appliance. You will need to port supermin first
(http://people.redhat.com/~rjones/supermin/).
Note on using clang (from LLVM) instead of GCC

30
TODO
View File

@@ -501,12 +501,6 @@ this approach works, it doesn't solve the MBR problem, so likely we'd
have to write a library for that (or perhaps go back to sfdisk but
using a very abstracted interface over sfdisk).
virt-sparsify should use discard
--------------------------------
This requires some changes to qemu to make discard work properly
throughout the entire stack.
Reimplement some APIs to avoid protocol limits
----------------------------------------------
@@ -538,34 +532,18 @@ Ruby 1.8, and/or maintain volatile VALUEs on the stack.
virt-builder
------------
- set keyboard
- set default timezone and language
- set permissions on uploaded files & created directories
- how can we give users a shell for debugging purposes?
- allow non-xz-compressed templates (faster)
- let notes etc be localized, ie. notes[en]=...
- add a CLI option to print the in-built path/fingerprint(s)
- allow public keys to come from local file paths
- doing virt-builder then running (eg. via qemu, libvirt?) is common; is
it possible to make this more automatic?
- more common code between virt-sysprep & virt-builder:
* virt-sysprep should have --run, --run-command,
--firstboot-command options with common code from virt-builder
- document:
* how to integrate with ansible, puppet, chef
* how to import to OpenStack / Glance
* how to integrate with ansible, chef [puppet documented already]
* how to import to EC2
- /etc/resolv.conf handling works but is best described as a hack:
@@ -585,12 +563,6 @@ Write an extension for mc that would let people browse into
filesystems. See
http://repo.or.cz/w/midnight-commander.git/tree/HEAD:/misc/ext.d
Python
------
It seems as if we should call PyErr_Clear() somewhere in every
Python binding.
Improvements in virt-log
------------------------

View File

@@ -71,7 +71,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: check alignment of virtual machine partitions\n"
@@ -91,8 +91,8 @@ usage (int status)
" -V|--version Display version and exit\n"
" -x Trace libguestfs API calls\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -152,7 +152,7 @@ main (int argc, char *argv[])
uuid = 1;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -171,7 +171,7 @@ main (int argc, char *argv[])
case 'P':
if (sscanf (optarg, "%zu", &max_threads) != 1) {
fprintf (stderr, _("%s: -P option is not numeric\n"), program_name);
fprintf (stderr, _("%s: -P option is not numeric\n"), guestfs_int_program_name);
exit (EXIT_FAILURE);
}
break;
@@ -229,13 +229,13 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
#else
fprintf (stderr, _("%s: compiled without support for libvirt.\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
#endif
} else { /* Single guest. */
if (uuid) {
fprintf (stderr, _("%s: --uuid option cannot be used with -a or -d\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}

View File

@@ -38,6 +38,10 @@ mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run
mkdir -p /run/lock
ln -s ../run/lock /var/lock
# On Fedora 23, util-linux creates /etc/mtab in %post .. stupid
# and e2fsprogs fails if the link doesn't exist .. stupid stupid
ln -s /proc/mounts /etc/mtab
# devtmpfs is required since udev 176
mount -t devtmpfs /dev /dev

View File

@@ -30,6 +30,7 @@ EXTRA_DIST = \
test-virt-index-validate-bad-1 \
test-virt-index-validate-good-1 \
test-virt-index-validate-good-2 \
test-virt-index-validate-good-3 \
virt-builder.pod \
virt-index-validate.pod

View File

@@ -158,7 +158,7 @@ let main () =
proxy = Downloader.SystemProxy;
}
) sources in
let sources = List.append repos sources in
let sources = List.append sources repos in
let index : Index_parser.index =
List.concat (
List.map (
@@ -555,7 +555,8 @@ let main () =
let preallocation = if oformat = "qcow2" then Some "metadata" else None in
let () =
let g = new G.guestfs () in
if verbose then ( g#set_trace true; g#set_verbose true );
if trace then g#set_trace true;
if verbose then g#set_verbose true;
g#disk_create ?preallocation ofile oformat osize in
let cmd =
sprintf "virt-resize%s%s%s --output-format %s%s%s %s %s"
@@ -608,7 +609,8 @@ let main () =
msg (f_"Opening the new disk");
let g =
let g = new G.guestfs () in
if verbose then g#set_trace true;
if trace then g#set_trace true;
if verbose then g#set_verbose true;
(match memsize with None -> () | Some memsize -> g#set_memsize memsize);
(match smp with None -> () | Some smp -> g#set_smp smp);

View File

@@ -35,7 +35,7 @@ type t = {
let create ~verbose ~directory =
if not (is_directory directory) then
mkdir directory 0o755;
mkdir_p directory 0o755;
{
verbose = verbose;
directory = directory;

View File

@@ -31,11 +31,6 @@ open Unix
open Printf
let parse_cmdline () =
let display_version () =
printf "virt-builder %s\n" Config.package_version;
exit 0
in
let mode = ref `Install in
let list_mode () = mode := `List in
let notes_mode () = mode := `Notes in
@@ -154,8 +149,10 @@ let parse_cmdline () =
"--no-sync", Arg.Clear sync, " " ^ s_"Do not fsync output file on exit";
"-v", Arg.Set verbose, " " ^ s_"Enable debugging messages";
"--verbose", Arg.Set verbose, " " ^ s_"Enable debugging messages";
"-V", Arg.Unit display_version, " " ^ s_"Display version and exit";
"--version", Arg.Unit display_version, " " ^ s_"Display version and exit";
"-V", Arg.Unit (print_version_and_exit ~prog),
" " ^ s_"Display version and exit";
"--version", Arg.Unit (print_version_and_exit ~prog),
" " ^ s_"Display version and exit";
"-x", Arg.Set trace, " " ^ s_"Enable tracing of libguestfs calls";
] in
let customize_argspec, get_customize_ops = Customize_cmdline.argspec () in
@@ -281,13 +278,18 @@ read the man page virt-builder(1).
let nr_sources = List.length sources in
let fingerprints =
match fingerprints with
| [fingerprint] ->
(* You're allowed to have multiple sources and one fingerprint: it
* means that the same fingerprint is used for all sources.
*)
repeat fingerprint nr_sources
| xs -> xs in
if check_signature then (
match fingerprints with
| [fingerprint] ->
(* You're allowed to have multiple sources and one fingerprint: it
* means that the same fingerprint is used for all sources.
*)
repeat fingerprint nr_sources
| xs -> xs
) else
(* We are not checking signatures, so just ignore any fingerprint
* specified. *)
repeat "" nr_sources in
if List.length fingerprints <> nr_sources then
error (f_"source and fingerprint lists are not the same length");
@@ -308,8 +310,9 @@ read the man page virt-builder(1).
| `Delete _ | `Edit _ | `FirstbootCommand _ | `FirstbootPackages _
| `FirstbootScript _ | `Hostname _ | `Link _ | `Mkdir _
| `Password _ | `RootPassword _ | `Scrub _ | `SSHInject _
| `Timezone _ | `Upload _ | `Write _ | `Chmod _
| `CommandsFromFile _ -> false
| `Timezone _ | `Truncate _ | `TruncateRecursive _
| `Upload _ | `Write _ | `Chmod _
| `CommandsFromFile _ | `CopyIn _ | `Copy _ | `Move _ -> false
) ops.ops in
if requires_execute_on_guest then
error (f_"sorry, cannot run commands on a guest with a different architecture");

View File

@@ -104,10 +104,10 @@ index:
{ context->parsed_index = $2; }
sections:
section emptylines
{ $$ = $1; }
| section EMPTY_LINE emptylines sections
{ $$ = $1; $$->next = $4; }
emptylines section emptylines
{ $$ = $2; }
| emptylines section EMPTY_LINE emptylines sections
{ $$ = $2; $$->next = $5; }
| emptylines
{ $$ = NULL; }

View File

@@ -39,7 +39,7 @@ extern int do_parse (struct parse_context *context, FILE *in);
static void
usage (int exit_status)
{
printf ("%s index\n", program_name);
printf ("%s index\n", guestfs_int_program_name);
exit (exit_status);
}
@@ -83,13 +83,15 @@ main (int argc, char *argv[])
compat_1_24_1 = 1;
else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
case 'V':
printf ("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s %s%s\n",
guestfs_int_program_name,
PACKAGE_VERSION, PACKAGE_VERSION_EXTRA);
exit (EXIT_SUCCESS);
case HELP_OPTION:
@@ -115,20 +117,20 @@ main (int argc, char *argv[])
if (fclose (in) == EOF) {
fprintf (stderr, _("%s: %s: error closing input file: %m (ignored)\n"),
program_name, input);
guestfs_int_program_name, input);
}
if (ret != 0) {
parse_context_free (&context);
fprintf (stderr, _("%s: '%s' could not be validated, see errors above\n"),
program_name, input);
guestfs_int_program_name, input);
exit (EXIT_FAILURE);
}
if (compat_1_24_1 && context.seen_comments) {
parse_context_free (&context);
fprintf (stderr, _("%s: %s contains comments which will not work with virt-builder 1.24.1\n"),
program_name, input);
guestfs_int_program_name, input);
exit (EXIT_FAILURE);
}
@@ -141,7 +143,7 @@ main (int argc, char *argv[])
if (strchr (sections->name, '_')) {
parse_context_free (&context);
fprintf (stderr, _("%s: %s: section [%s] has invalid characters which will not work with virt-builder 1.24.0\n"),
program_name, input, sections->name);
guestfs_int_program_name, input, sections->name);
exit (EXIT_FAILURE);
}
}
@@ -152,7 +154,7 @@ main (int argc, char *argv[])
strchr (fields->key, ']')) {
parse_context_free (&context);
fprintf (stderr, _("%s: %s: section [%s], field '%s' has invalid characters which will not work with virt-builder 1.24.0\n"),
program_name, input, sections->name, fields->key);
guestfs_int_program_name, input, sections->name, fields->key);
exit (EXIT_FAILURE);
}
}
@@ -161,7 +163,7 @@ main (int argc, char *argv[])
strchr (fields->key, ',')) {
parse_context_free (&context);
fprintf (stderr, _("%s: %s: section [%s], field '%s' has invalid characters which will not work with virt-builder 1.24.1\n"),
program_name, input, sections->name, fields->key);
guestfs_int_program_name, input, sections->name, fields->key);
exit (EXIT_FAILURE);
}
}
@@ -172,7 +174,7 @@ main (int argc, char *argv[])
if (compat_1_24_0 && !seen_sig) {
parse_context_free (&context);
fprintf (stderr, _("%s: %s: section [%s] is missing a 'sig' field which will not work with virt-builder 1.24.0\n"),
program_name, input, sections->name);
guestfs_int_program_name, input, sections->name);
exit (EXIT_FAILURE);
}
}

View File

@@ -19,4 +19,4 @@
# Hack automake to link binary properly. There is no other way to add
# the -cclib parameter to the end of the command line.
exec "$@" -linkpkg -cclib '-pthread -lpthread -lutils @LIBTINFO_LIBS@ -lcrypt @LIBLZMA_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
exec "$@" -linkpkg -cclib '-pthread -lpthread -lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ @LIBLZMA_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'

View File

@@ -214,8 +214,10 @@ pxzcat (value filenamev, value outputfilev, unsigned nr_threads)
unix_error (err, (char *) "ftruncate", outputfilev);
}
#if defined HAVE_POSIX_FADVISE
/* Tell the kernel we won't read the output file. */
ignore_value (posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED));
#endif
/* Iterate over blocks. */
iter_blocks (idx, nr_threads, filenamev, fd, outputfilev, ofd);
@@ -597,7 +599,7 @@ worker_thread (void *vp)
/* Now read and decode the block header. */
n = pread (global->fd, &header[1], block.header_size-1, position);
if (n >= 0 && n != block.header_size-1) {
if (n >= 0 && n != (ssize_t) block.header_size-1) {
fprintf (stderr,
"%s: read: unexpected end of file reading block header\n",
global->filename);
@@ -640,14 +642,14 @@ worker_thread (void *vp)
strm.next_in = NULL;
strm.avail_in = 0;
strm.next_out = outbuf;
strm.avail_out = sizeof outbuf;
strm.avail_out = BUFFER_SIZE;
for (;;) {
lzma_action action = LZMA_RUN;
if (strm.avail_in == 0) {
strm.next_in = buf;
n = pread (global->fd, buf, sizeof buf, position);
n = pread (global->fd, buf, BUFFER_SIZE, position);
if (n == -1) {
perror (global->filename);
return &state->status;
@@ -661,7 +663,7 @@ worker_thread (void *vp)
r = lzma_code (&strm, action);
if (strm.avail_out == 0 || r == LZMA_STREAM_END) {
size_t wsz = sizeof outbuf - strm.avail_out;
size_t wsz = BUFFER_SIZE - strm.avail_out;
/* Don't write if the block is all zero, to preserve output file
* sparseness. However we have to update oposition.
@@ -675,7 +677,7 @@ worker_thread (void *vp)
oposition += wsz;
strm.next_out = outbuf;
strm.avail_out = sizeof outbuf;
strm.avail_out = BUFFER_SIZE;
}
if (r == LZMA_STREAM_END)

View File

@@ -0,0 +1,4 @@
# Empty lines before the first section
[foo]
key=value

View File

@@ -22,3 +22,4 @@ set -e
! $VG virt-index-validate test-virt-index-validate-bad-1
$VG virt-index-validate test-virt-index-validate-good-1
$VG virt-index-validate test-virt-index-validate-good-2
$VG virt-index-validate test-virt-index-validate-good-3

View File

@@ -1440,7 +1440,7 @@ instead of I<--install>.
To install a Fedora guest using a local mirror:
virt-builder fedora 20 \
virt-builder fedora-20 \
--edit '/etc/yum.repos.d/fedora.repo:
s{.*baseurl=.*}{baseurl=http://example.com/mirror/};
s{.*metalink=.*}{};
@@ -1458,7 +1458,7 @@ Assuming that you are using C<apt-proxy> to mirror the repository, you
should create a new C<sources.list> file to point to your proxy (see
L<https://help.ubuntu.com/community/AptProxy>) and then do:
virt-builder fedora 20 \
virt-builder debian-7 \
--upload sources.list:/etc/apt/sources.list \
--run-command 'apt-get -y update' \
--run-command 'apt-get -y install pkg1 pkg2 ...'

View File

@@ -29,7 +29,13 @@ EXTRA_DIST = \
debian.preseed \
debian.sh \
fedora.sh \
fedora-aarch64.sh \
fedora-armv7l.sh \
fedora-ppc64.sh \
fedora-ppc64le.sh \
rhel.sh \
rhel-ppc64.sh \
rhel-ppc64le.sh \
scientificlinux.sh \
ubuntu.preseed \
ubuntu.sh

View File

@@ -89,7 +89,7 @@ virt-install \
--os-type=linux --os-variant=rhel$major \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \
--disk $(pwd)/$output,size=6 \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \

View File

@@ -63,7 +63,7 @@ virt-install \
--os-type=linux --os-variant=debian$dist \
--initrd-inject=$(pwd)/preseed.cfg \
--extra-args="auto console=tty0 console=ttyS0,115200" \
--disk=$(pwd)/$output,size=4 \
--disk=$(pwd)/$output,size=4,format=raw \
--serial pty \
--location=$location \
--nographics \

103
builder/website/fedora-aarch64.sh Executable file
View File

@@ -0,0 +1,103 @@
#!/bin/bash -
# virt-builder
# Copyright (C) 2013-2015 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.
# Build Fedora images for aarch64 (secondary arch).
unset CDPATH
export LANG=C
set -e
set -x
if [ $# -ne 1 ]; then
echo "$0 VERSION"
exit 1
fi
version=$1
tree=https://download.fedoraproject.org/pub/fedora-secondary/releases/21/Server/aarch64/os/
output=fedora-$version-aarch64
tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8)
rm -f $output $output.old $output.xz
# Generate the kickstart to a temporary file.
ks=$(mktemp)
cat > $ks <<'EOF'
install
text
reboot
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw builder
firewall --enabled --ssh
selinux --enforcing
timezone --utc America/New_York
bootloader --location=mbr --append="console=ttyAMA0 earlyprintk=pl011,0x9000000 ignore_loglevel no_timer_check printk.time=1 rd_NO_PLYMOUTH"
zerombr
clearpart --all --initlabel
autopart --type=plain
# Halt the system once configuration has finished.
poweroff
%packages
@core
%end
%post
# Rerun dracut for the installed kernel (not the running kernel):
KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n')
dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION
%end
EOF
# Clean up function.
cleanup ()
{
rm -f $ks
virsh undefine --nvram $tmpname ||:
}
trap cleanup INT QUIT TERM EXIT ERR
# virt-install nvram_template option is broken for non-root users
# https://bugzilla.redhat.com/show_bug.cgi?id=1189143
# work around it:
vars=$(mktemp)
cp /usr/share/AAVMF/AAVMF_VARS.fd $vars
virt-install \
--name=$tmpname \
--ram=4096 \
--cpu=host --vcpus=2 \
--os-type=linux --os-variant=fedora21 \
--boot loader=/usr/share/AAVMF/AAVMF_CODE.fd,loader_ro=yes,loader_type=pflash,nvram=$vars \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` earlyprintk=pl011,0x9000000 ignore_loglevel console=ttyAMA0 no_timer_check printk.time=1 proxy=$http_proxy" \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \
--noreboot
# NB: We need to preserve the nvram after installation since
# it contains the EFI boot variables set by grub.
cp $vars $output-nvram
xz --best $output-nvram
source $(dirname "$0")/compress.sh $output

View File

@@ -0,0 +1,91 @@
#!/bin/bash -
# virt-builder
# Copyright (C) 2013-2015 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.
# Build Fedora images for armv7l.
unset CDPATH
export LANG=C
set -e
set -x
if [ $# -ne 1 ]; then
echo "$0 VERSION"
exit 1
fi
version=$1
tree=http://mirror.ox.ac.uk/sites/download.fedora.redhat.com/pub/fedora/linux/releases/21/Server/armhfp/os/
output=fedora-$version-armv7l
tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8)
rm -f $output $output.old $output.xz
# Generate the kickstart to a temporary file.
ks=$(mktemp)
cat > $ks <<'EOF'
install
text
reboot
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw builder
firewall --enabled --ssh
selinux --enforcing
timezone --utc America/New_York
bootloader --location=mbr --append="console=tty0 console=ttyAMA0,115200 rd_NO_PLYMOUTH"
zerombr
clearpart --all --initlabel
autopart --type=plain
# Halt the system once configuration has finished.
poweroff
%packages
@core
%end
%post
# Rerun dracut for the installed kernel (not the running kernel):
KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n')
dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION
%end
EOF
# Clean up function.
cleanup ()
{
rm -f $ks
virsh undefine $tmpname ||:
}
trap cleanup INT QUIT TERM EXIT ERR
virt-install \
--name=$tmpname \
--ram=1024 \
--cpu=host --vcpus=2 \
--os-type=linux --os-variant=fedora21 \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=ttyAMA0,115200 proxy=$http_proxy" \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \
--noreboot
source $(dirname "$0")/compress.sh $output

92
builder/website/fedora-ppc64.sh Executable file
View File

@@ -0,0 +1,92 @@
#!/bin/bash -
# virt-builder
# Copyright (C) 2013-2015 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.
# Build Fedora images for ppc64 big endian (secondary arch).
unset CDPATH
export LANG=C
set -e
set -x
if [ $# -ne 1 ]; then
echo "$0 VERSION"
exit 1
fi
version=$1
tree=https://download.fedoraproject.org/pub/fedora-secondary/releases/21/Server/ppc64/os/
output=fedora-$version-ppc64
tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8)
rm -f $output $output.old $output.xz
# Generate the kickstart to a temporary file.
ks=$(mktemp)
cat > $ks <<'EOF'
install
text
reboot
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw builder
firewall --enabled --ssh
selinux --enforcing
timezone --utc America/New_York
bootloader --location=mbr --append="console=tty0 console=hvc0 rd_NO_PLYMOUTH"
zerombr
clearpart --all --initlabel
autopart --type=lvm
# Halt the system once configuration has finished.
poweroff
%packages
@core
%end
%post
# Rerun dracut for the installed kernel (not the running kernel):
KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n')
dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION
%end
EOF
# Clean up function.
cleanup ()
{
rm -f $ks
virsh undefine $tmpname ||:
}
trap cleanup INT QUIT TERM EXIT ERR
virt-install \
--name=$tmpname \
--ram=4096 \
--vcpus=1 \
--os-type=linux --os-variant=fedora21 \
--arch ppc64 --machine pseries \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=hvc0 proxy=$http_proxy" \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \
--noreboot
source $(dirname "$0")/compress.sh $output

View File

@@ -0,0 +1,92 @@
#!/bin/bash -
# virt-builder
# Copyright (C) 2013-2015 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.
# Build Fedora images for ppc64le (secondary arch).
unset CDPATH
export LANG=C
set -e
set -x
if [ $# -ne 1 ]; then
echo "$0 VERSION"
exit 1
fi
version=$1
tree=https://download.fedoraproject.org/pub/fedora-secondary/releases/21/Server/ppc64le/os/
output=fedora-$version-ppc64le
tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8)
rm -f $output $output.old $output.xz
# Generate the kickstart to a temporary file.
ks=$(mktemp)
cat > $ks <<'EOF'
install
text
reboot
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw builder
firewall --enabled --ssh
selinux --enforcing
timezone --utc America/New_York
bootloader --location=mbr --append="console=tty0 console=hvc0 rd_NO_PLYMOUTH"
zerombr
clearpart --all --initlabel
autopart --type=lvm
# Halt the system once configuration has finished.
poweroff
%packages
@core
%end
%post
# Rerun dracut for the installed kernel (not the running kernel):
KERNEL_VERSION=$(rpm -q kernel --qf '%{version}-%{release}.%{arch}\n')
dracut -f /boot/initramfs-$KERNEL_VERSION.img $KERNEL_VERSION
%end
EOF
# Clean up function.
cleanup ()
{
rm -f $ks
virsh undefine $tmpname ||:
}
trap cleanup INT QUIT TERM EXIT ERR
virt-install \
--name=$tmpname \
--ram=4096 \
--vcpus=1 \
--os-type=linux --os-variant=fedora21 \
--arch ppc64le --machine pseries \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=hvc0 proxy=$http_proxy" \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \
--noreboot
source $(dirname "$0")/compress.sh $output

View File

@@ -91,7 +91,7 @@ virt-install \
--os-type=linux --os-variant=fedora18 \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \
--disk $(pwd)/$output,size=6 \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \

View File

@@ -40,6 +40,25 @@ notes=CentOS 7.0
builder/website/centos.sh
[centos-7.1]
name=CentOS 7.1
osinfo=centos7.1
arch=x86_64
file=centos-7.1.xz
checksum=4bd2536710daa27a70ff69a96d8a694bde1ecf48d811e75d5e6881cfdcd214c0af6949d5a8252ace06e4e8b33337f65ccb16305c85ff88156d49ac559e840b5c
format=raw
size=6442450944
compressed_size=238579176
expand=/dev/sda3
notes=CentOS 7.1
This CentOS image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/centos.sh
[cirros-0.3.1]
name=CirrOS 0.3.1
arch=x86_64
@@ -153,7 +172,7 @@ file=fedora-19.xz
revision=2
checksum=acecd8d4bca0d6a3f937e0c9386f3185c916df3eaf5f825988c73d41e946a6dc4fda06cdd74a12bc60932edd65846097547b11aca2309a61dd6d0e91ab9d16f3
format=raw
size=4294967296
size=6442450944
compressed_size=169531628
expand=/dev/sda3
notes=Fedora 19.
@@ -176,7 +195,7 @@ file=fedora-20.xz
revision=2
checksum=983a1b33c34cb311ea3a283f06312d24dc81041b64ebc90e40ef2fd7587362acd1a5654b13252f9f57001870aa95495065537e730d5225b49389c1a0478cb028
format=raw
size=4294967296
size=6442450944
compressed_size=181164220
expand=/dev/sda3
notes=Fedora 20.
@@ -199,7 +218,7 @@ file=fedora-21.xz
revision=1
checksum=4dc92cbf540d3a0745ffe1fa01ffae15f17e7a8aa45c70ad975a1dda82b7f1ebe42f912be74d91a5866a91ee2ca3be3c2be274b5da29db930fe1ec8c2286575b
format=raw
size=4294967296
size=6442450944
compressed_size=209059864
expand=/dev/sda3
notes=Fedora 21 Server.
@@ -214,6 +233,99 @@ notes=Fedora 21 Server.
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (aarch64)
osinfo=fedora21
arch=aarch64
file=fedora-21-aarch64.xz
checksum=57026dd867cbc2e49894dd056ffdc1c397548f4f7e296f393a77ee55343a17f684ddcd3ff7661f514b54209c472f41fce809f2e36064fb66d4f92d8dce5e9b62
format=raw
size=6442450944
compressed_size=186616612
expand=/dev/sda4
notes=Fedora 21 Server (aarch64)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-aarch64.sh
Please note you will need to use the associated EFI NVRAM variables:
http://libguestfs.org/download/builder/fedora-21-aarch64-nvram.xz
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (armv7l)
osinfo=fedora21
arch=armv7l
file=fedora-21-armv7l.xz
checksum=eb44c66f04781064850380fa1747cadc8645c2f3fd8f2dc1b45cbf5b3f31b91383fa9b7b8b2c951556de2ca499a9251487845208aa1a3881ada6d15e49d24300
format=raw
size=6442450944
compressed_size=199232964
expand=/dev/sda4
notes=Fedora 21 Server (armv7l)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-armv7l.sh
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (ppc64)
osinfo=fedora21
arch=ppc64
file=fedora-21-ppc64.xz
revision=3
checksum=acdd9bbd2a434cae48b8f8cf715b00a0cedbb8d276d76a9d4a4f1d469c9522755e82dd03e5f499c1447e09d9bb5a33ada8a061a601d91c007704edfdd80cddb2
format=raw
size=6442450944
compressed_size=233099788
expand=/dev/sda3
notes=Fedora 21 Server (ppc64 big endian)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-ppc64.sh
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (ppc64le)
osinfo=fedora21
arch=ppc64le
file=fedora-21-ppc64le.xz
revision=3
checksum=490aeb5f1bd8754a3c2ed705d3ca84ccec26f839492c6955f40289c4ce9754ad40f22710e24449aeda4177ae16541dc61c989e3c1751f657ffbd4740240c13c4
format=raw
size=6442450944
compressed_size=233706980
expand=/dev/sda3
notes=Fedora 21 Server (ppc64le)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-ppc64le.sh
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[scientificlinux-6]
name=Scientific Linux 6.5
osinfo=centos6.5

View File

@@ -43,6 +43,25 @@ notes=CentOS 7.0
builder/website/centos.sh
[centos-7.1]
name=CentOS 7.1
osinfo=centos7.1
arch=x86_64
file=centos-7.1.xz
checksum=4bd2536710daa27a70ff69a96d8a694bde1ecf48d811e75d5e6881cfdcd214c0af6949d5a8252ace06e4e8b33337f65ccb16305c85ff88156d49ac559e840b5c
format=raw
size=6442450944
compressed_size=238579176
expand=/dev/sda3
notes=CentOS 7.1
This CentOS image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/centos.sh
[cirros-0.3.1]
name=CirrOS 0.3.1
arch=x86_64
@@ -156,7 +175,7 @@ file=fedora-19.xz
revision=2
checksum=acecd8d4bca0d6a3f937e0c9386f3185c916df3eaf5f825988c73d41e946a6dc4fda06cdd74a12bc60932edd65846097547b11aca2309a61dd6d0e91ab9d16f3
format=raw
size=4294967296
size=6442450944
compressed_size=169531628
expand=/dev/sda3
notes=Fedora 19.
@@ -179,7 +198,7 @@ file=fedora-20.xz
revision=2
checksum=983a1b33c34cb311ea3a283f06312d24dc81041b64ebc90e40ef2fd7587362acd1a5654b13252f9f57001870aa95495065537e730d5225b49389c1a0478cb028
format=raw
size=4294967296
size=6442450944
compressed_size=181164220
expand=/dev/sda3
notes=Fedora 20.
@@ -202,7 +221,7 @@ file=fedora-21.xz
revision=1
checksum=4dc92cbf540d3a0745ffe1fa01ffae15f17e7a8aa45c70ad975a1dda82b7f1ebe42f912be74d91a5866a91ee2ca3be3c2be274b5da29db930fe1ec8c2286575b
format=raw
size=4294967296
size=6442450944
compressed_size=209059864
expand=/dev/sda3
notes=Fedora 21 Server.
@@ -217,6 +236,99 @@ notes=Fedora 21 Server.
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (aarch64)
osinfo=fedora21
arch=aarch64
file=fedora-21-aarch64.xz
checksum=57026dd867cbc2e49894dd056ffdc1c397548f4f7e296f393a77ee55343a17f684ddcd3ff7661f514b54209c472f41fce809f2e36064fb66d4f92d8dce5e9b62
format=raw
size=6442450944
compressed_size=186616612
expand=/dev/sda4
notes=Fedora 21 Server (aarch64)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-aarch64.sh
Please note you will need to use the associated EFI NVRAM variables:
http://libguestfs.org/download/builder/fedora-21-aarch64-nvram.xz
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (armv7l)
osinfo=fedora21
arch=armv7l
file=fedora-21-armv7l.xz
checksum=eb44c66f04781064850380fa1747cadc8645c2f3fd8f2dc1b45cbf5b3f31b91383fa9b7b8b2c951556de2ca499a9251487845208aa1a3881ada6d15e49d24300
format=raw
size=6442450944
compressed_size=199232964
expand=/dev/sda4
notes=Fedora 21 Server (armv7l)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-armv7l.sh
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (ppc64)
osinfo=fedora21
arch=ppc64
file=fedora-21-ppc64.xz
revision=3
checksum=acdd9bbd2a434cae48b8f8cf715b00a0cedbb8d276d76a9d4a4f1d469c9522755e82dd03e5f499c1447e09d9bb5a33ada8a061a601d91c007704edfdd80cddb2
format=raw
size=6442450944
compressed_size=233099788
expand=/dev/sda3
notes=Fedora 21 Server (ppc64 big endian)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-ppc64.sh
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[fedora-21]
name=Fedora® 21 Server (ppc64le)
osinfo=fedora21
arch=ppc64le
file=fedora-21-ppc64le.xz
revision=3
checksum=490aeb5f1bd8754a3c2ed705d3ca84ccec26f839492c6955f40289c4ce9754ad40f22710e24449aeda4177ae16541dc61c989e3c1751f657ffbd4740240c13c4
format=raw
size=6442450944
compressed_size=233706980
expand=/dev/sda3
notes=Fedora 21 Server (ppc64le)
This Fedora image contains only unmodified @Core group packages.
It is thus very minimal. The kickstart and install script can be
found in the libguestfs source tree:
builder/website/fedora-ppc64le.sh
Fedora and the Infinity design logo are trademarks of Red Hat, Inc.
Source and further information is available from http://fedoraproject.org/
[scientificlinux-6]
name=Scientific Linux 6.5
osinfo=centos6.5
@@ -323,17 +435,17 @@ notes=Ubuntu 14.04 (Trusty).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBAgAGBQJUh0qYAAoJEJFzj3Pht2igo4gP/jHI52b2SNlKDkIFMjM26ztL
UxtxHlU+70y8pOq/78beVHuiGYFGpkgmbU6lzPpVDivZP4riX1VWUWDWppmu2eEr
SatDQEaUI1dlETFULXA2kpebH0Q4HsuALZeTt8y9j2U8l/JbKmqBM95f4YOxZiaf
/UCfF+Er23Lp0whbPVlKDlWQvEVuGANllhoP0lGzLjaz5AHdjLewC+VcJrax74TO
Lo/aelcZ6M0IYHyXJKUFHl1MrudoWcPvwvTevS7T9zTWJv4Pr+cfCquRxuZ2WZez
hlwDcMYAO8XF7GsIjGl5ay2Y2H0Anm9iIFwR/bfGMr2EnLLxYZ0qYmeZeO9ZCQFK
or57RjBebb4qvl5LQQ6JcagRUBPpQ7V5H0sbKTZgLbTDyuUWy+3xJ1MOIZPlnVvB
gqVgbim9oPatIAgDUS60v4Gu5IFWoi8rgKoPUbY2eSmCfLd8wf1TeC2wQ4vKYJjj
pMnnmR74gOUL5uUSFV+kM9PqdO65T5YJEG0Be09WCWqkvXbDsOpWDnBz4d5rfxbA
78lAILtBcDZJvYk+dEekK2TKcWEBfqOPJ5ecWSoogn8pCdnvx3mMzGDaFzDiiiC+
75nhFNimJs/akwOFh2DLkML0dfIMoaRwTrSoyAfAY+k9rCXBxNVsR0PtThEXaNYo
RnA1DWswrHxjgIEj4pao
=TEYf
iQIcBAEBAgAGBQJVMjEnAAoJEJFzj3Pht2igYFgQAIEZajaapKb/iqVBNdYGS1gj
TUlfUg/naCAGnd8FmFH3BBsWO97l5XSkk/BpVNWJZg0y5d4S3HBmL7KmeVF+wsfG
nv0mcX6kJqNntrGfiLgcV7jwe3E3WgP87m6cDVPq2xRGqcTp5FBg520y00phPF50
nNrC8CAyvnlOLn3pvatpznvZzScLa+ZWZHKU5y/dDhsMSaX9RRdNE8szMIJklECw
Rxk6CBnyybDeOEcNVt8XQAUQhKnRk32dn/2gRmjiQOqVU+y+AWDkej7V6wiablXV
vjsHeud7zDbIApiXYnY+pbg4aAdsKdS9BoI6fKPs8WCejpOFY5mbj2M/utJ1f6hH
mI6SRYqKDYIOBFe5XdVwmMlF4afQB6d7PPRoOX7ffBRB584xrCePSJWBpZWhzO5K
BwydDA4F27fvlBqHq8WZK3xcNs0moXg1mi+U2Q3sIuGl9185Ag3mPX3vaK+gViks
GSLrLdts2Qe5vXeyZf6Z1YDWeh2Pm7iOH2lQ7tFOQVnT4iiOGms7hHFJ6vplRju+
TjGXB+I19My75xPRO3BQ7mOg3ebSQozj8y9KzOVzzgqnj2NgESMuFXTCBQzskS55
v0jxIDrHRYG+Fd9FsSmZlE3r37TNOFYonK3y4MRLd7reiEhN/NiS11s1SHsXg1Tq
3yIbFcOxdUrYmxu7cibb
=er4y
-----END PGP SIGNATURE-----

143
builder/website/rhel-ppc64.sh Executable file
View File

@@ -0,0 +1,143 @@
#!/bin/bash -
# virt-builder
# Copyright (C) 2013-2015 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.
unset CDPATH
export LANG=C
set -e
set -x
# Hack for RWMJ
unset http_proxy
if [ $# -ne 1 ]; then
echo "$0 VERSION"
exit 1
fi
version=$1
output=rhel-$version-ppc64
tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8)
guestroot=/dev/rhel/root
case $version in
7.*)
major=7
topurl=http://download.devel.redhat.com/released/RHEL-$major/$version
tree=$topurl/Server/ppc64/os
baseurl=$tree
srpms=$topurl/Server/source/tree
optional=$topurl/Server-optional/ppc64/os
optionalsrpms=$topurl/Server-optional/source/tree
;;
*)
echo "$0: version $version not supported by this script yet"
exit 1
esac
rm -f $output $output.old $output.xz
# Generate the kickstart to a temporary file.
ks=$(mktemp)
cat > $ks <<EOF
install
text
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw builder
firewall --enabled --ssh
timezone --utc America/New_York
selinux --enforcing
bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH"
zerombr
clearpart --all --initlabel
autopart --type=lvm
# Halt the system once configuration has finished.
poweroff
%packages
@core
%end
EOF
# Yum configuration.
yum=$(mktemp)
cat > $yum <<EOF
[rhel$major]
name=RHEL $major Server
baseurl=$baseurl
enabled=1
gpgcheck=0
keepcache=0
[rhel$major-source]
name=RHEL $major Server Source
baseurl=$srpms
enabled=0
gpgcheck=0
keepcache=0
EOF
if [ -n "$optional" ]; then
cat >> $yum <<EOF
[rhel$major-optional]
name=RHEL $major Server Optional
baseurl=$optional
enabled=1
gpgcheck=0
keepcache=0
[rhel$major-optional-source]
name=RHEL $major Server Optional
baseurl=$optionalsrpms
enabled=0
gpgcheck=0
keepcache=0
EOF
fi
# Clean up function.
cleanup ()
{
rm -f $ks
rm -f $yum
virsh undefine $tmpname ||:
}
trap cleanup INT QUIT TERM EXIT ERR
virt-install \
--name=$tmpname \
--ram=4096 \
--vcpus=1 \
--os-type=linux --os-variant=rhel$major \
--arch ppc64 --machine pseries \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200" \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \
--noreboot
# We have to replace yum config so it doesn't try to use RHN (it
# won't be registered).
guestfish --rw -a $output -m $guestroot \
upload $yum /etc/yum.repos.d/download.devel.redhat.com.repo
source $(dirname "$0")/compress.sh $output

143
builder/website/rhel-ppc64le.sh Executable file
View File

@@ -0,0 +1,143 @@
#!/bin/bash -
# virt-builder
# Copyright (C) 2013-2015 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.
unset CDPATH
export LANG=C
set -e
set -x
# Hack for RWMJ
unset http_proxy
if [ $# -ne 1 ]; then
echo "$0 VERSION"
exit 1
fi
version=$1
output=rhel-$version-ppc64le
tmpname=tmp-$(tr -cd 'a-f0-9' < /dev/urandom | head -c 8)
guestroot=/dev/rhel-l/root
case $version in
7.*)
major=7
topurl=http://download.devel.redhat.com/released/RHEL-LE-$major/$version
tree=$topurl/Server/ppc64le/os
baseurl=$tree
srpms=$topurl/Server/source/tree
optional=$topurl/Server-optional/ppc64le/os
optionalsrpms=$topurl/Server-optional/source/tree
;;
*)
echo "$0: version $version not supported by this script yet"
exit 1
esac
rm -f $output $output.old $output.xz
# Generate the kickstart to a temporary file.
ks=$(mktemp)
cat > $ks <<EOF
install
text
lang en_US.UTF-8
keyboard us
network --bootproto dhcp
rootpw builder
firewall --enabled --ssh
timezone --utc America/New_York
selinux --enforcing
bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH"
zerombr
clearpart --all --initlabel
autopart --type=lvm
# Halt the system once configuration has finished.
poweroff
%packages
@core
%end
EOF
# Yum configuration.
yum=$(mktemp)
cat > $yum <<EOF
[rhel$major]
name=RHEL $major Server
baseurl=$baseurl
enabled=1
gpgcheck=0
keepcache=0
[rhel$major-source]
name=RHEL $major Server Source
baseurl=$srpms
enabled=0
gpgcheck=0
keepcache=0
EOF
if [ -n "$optional" ]; then
cat >> $yum <<EOF
[rhel$major-optional]
name=RHEL $major Server Optional
baseurl=$optional
enabled=1
gpgcheck=0
keepcache=0
[rhel$major-optional-source]
name=RHEL $major Server Optional
baseurl=$optionalsrpms
enabled=0
gpgcheck=0
keepcache=0
EOF
fi
# Clean up function.
cleanup ()
{
rm -f $ks
rm -f $yum
virsh undefine $tmpname ||:
}
trap cleanup INT QUIT TERM EXIT ERR
virt-install \
--name=$tmpname \
--ram=4096 \
--vcpus=1 \
--os-type=linux --os-variant=rhel$major \
--arch ppc64le --machine pseries \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200" \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \
--noreboot
# We have to replace yum config so it doesn't try to use RHN (it
# won't be registered).
guestfish --rw -a $output -m $guestroot \
upload $yum /etc/yum.repos.d/download.devel.redhat.com.repo
source $(dirname "$0")/compress.sh $output

View File

@@ -1,6 +1,6 @@
#!/bin/bash -
# virt-builder
# Copyright (C) 2013 Red Hat Inc.
# Copyright (C) 2013-2015 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
@@ -40,6 +40,7 @@ case $version in
minor=`echo $version | awk -F. '{print $2}'`
topurl=http://download.devel.redhat.com/released/RHEL-$major/U$minor/AS
tree=$topurl/x86_64/tree
baseurl=$tree
srpms=$topurl/x86_64/tree/SRPMS
bootfs=ext2
rootfs=ext3
@@ -50,6 +51,7 @@ case $version in
minor=`echo $version | awk -F. '{print $2}'`
topurl=http://download.devel.redhat.com/released/RHEL-$major/U$minor/AS
tree=$topurl/x86_64/tree
baseurl=$tree
srpms=$topurl/x86_64/tree/SRPMS
bootfs=ext2
rootfs=ext3
@@ -59,7 +61,8 @@ case $version in
major=5
minor=`echo $version | awk -F. '{print $2}'`
topurl=http://download.devel.redhat.com/released/RHEL-$major-Server/U$minor
tree=$topurl/x86_64/os/Server
tree=$topurl/x86_64/os
baseurl=$tree/Server
srpms=$topurl/source/SRPMS
bootfs=ext2
rootfs=ext4
@@ -69,6 +72,7 @@ case $version in
major=6
topurl=http://download.devel.redhat.com/released/RHEL-$major/$version
tree=$topurl/Server/x86_64/os
baseurl=$tree
srpms=$topurl/source/SRPMS
optional=$topurl/Server/optional/x86_64/os
optionalsrpms=$topurl/Server/optional/source/SRPMS
@@ -79,7 +83,8 @@ case $version in
major=7
topurl=http://download.devel.redhat.com/released/RHEL-$major/$version
tree=$topurl/Server/x86_64/os
srpms=$topurl/source/SRPMS
baseurl=$tree
srpms=$topurl/Server/source/tree
optional=$topurl/Server-optional/x86_64/os
optionalsrpms=$topurl/Server-optional/source/tree
bootfs=ext4
@@ -160,7 +165,7 @@ yum=$(mktemp)
cat > $yum <<EOF
[rhel$major]
name=RHEL $major Server
baseurl=$tree
baseurl=$baseurl
enabled=1
gpgcheck=0
keepcache=0
@@ -207,7 +212,7 @@ virt-install \
--os-type=linux --os-variant=rhel$major \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200" \
--disk $(pwd)/$output,size=6 \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \

View File

@@ -80,7 +80,7 @@ virt-install \
--os-type=linux --os-variant=rhel$major \
--initrd-inject=$ks \
--extra-args="ks=file:/`basename $ks` console=tty0 console=ttyS0,115200 proxy=$http_proxy" \
--disk $(pwd)/$output,size=6 \
--disk $(pwd)/$output,size=6,format=raw \
--serial pty \
--location=$tree \
--nographics \

View File

@@ -66,7 +66,7 @@ virt-install \
--os-type=linux --os-variant=$osvariant \
--initrd-inject=$(pwd)/preseed.cfg \
--extra-args="auto console=tty0 console=ttyS0,115200" \
--disk=$(pwd)/$output,size=4 \
--disk=$(pwd)/$output,size=4,format=raw \
--serial pty \
--location=$location \
--nographics \

View File

@@ -51,7 +51,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: display files in a virtual machine\n"
@@ -73,8 +73,8 @@ usage (int status)
" -V|--version Display version and exit\n"
" -x Trace libguestfs API calls\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -139,7 +139,7 @@ main (int argc, char *argv[])
OPTION_format;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;

View File

@@ -85,7 +85,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: list filesystems, partitions, block devices, LVM in a VM\n"
@@ -122,8 +122,8 @@ usage (int status)
" Display LVM volume groups\n"
" -x Trace libguestfs API calls\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -240,7 +240,7 @@ main (int argc, char *argv[])
output |= OUTPUT_VGS;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -304,7 +304,7 @@ main (int argc, char *argv[])
*/
if (human && csv) {
fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -811,7 +811,7 @@ parents_of_vg (char *vg)
if (!pvuuids)
exit (EXIT_FAILURE);
n = guestfs___count_strings (pvuuids);
n = guestfs_int_count_strings (pvuuids);
ret = malloc ((n + 1) * sizeof (char *));
if (!ret) {
@@ -892,7 +892,7 @@ write_row (const char *name, const char *type,
}
if ((columns & COLUMN_PARENTS)) {
/* Internally comma-separated field. */
parents_str = guestfs___join_strings (",", parents);
parents_str = guestfs_int_join_strings (",", parents);
strings[len++] = parents_str;
}
if ((columns & COLUMN_UUID))

View File

@@ -60,7 +60,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: display log files in a virtual machine\n"
@@ -80,8 +80,8 @@ usage (int status)
" -V|--version Display version and exit\n"
" -x Trace libguestfs API calls\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -141,7 +141,7 @@ main (int argc, char *argv[])
OPTION_format;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -244,7 +244,7 @@ do_log (void)
fprintf (stderr,
_("%s: Windows Event Log for pre-Vista guests is not supported.\n"),
program_name);
guestfs_int_program_name);
return -1;
}
@@ -352,7 +352,7 @@ do_log_journal (void)
if (strftime (buf, sizeof buf, "%b %d %H:%M:%S",
localtime_r (&t, &tm)) <= 0) {
fprintf (stderr, _("%s: could not format journal entry timestamp\n"),
program_name);
guestfs_int_program_name);
errors++;
continue;
}
@@ -421,7 +421,7 @@ do_log_windows_evtx (void)
"in order to parse Windows Event Logs. If you cannot install this, then\n"
"use virt-copy-out(1) to copy the contents of /Windows/System32/winevt/Logs\n"
"from this guest, and examine in a binary file viewer.\n"),
program_name);
guestfs_int_program_name);
return -1;
}
@@ -437,7 +437,7 @@ do_log_windows_evtx (void)
GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1,
-1) <= 0) {
fprintf (stderr, _("%s: Windows Event Log file (%s) not found\n"),
program_name, filename);
guestfs_int_program_name, filename);
return -1;
}
@@ -469,8 +469,8 @@ do_log_windows_evtx (void)
if (status) {
char buf[256];
fprintf (stderr, "%s: %s\n",
program_name,
guestfs___exit_status_to_string (status, "evtxdump.py",
guestfs_int_program_name,
guestfs_int_exit_status_to_string (status, "evtxdump.py",
buf, sizeof buf));
return -1;
}

View File

@@ -81,7 +81,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: list files in a virtual machine\n"
@@ -114,8 +114,8 @@ usage (int status)
" -V|--version Display version and exit\n"
" -x Trace libguestfs API calls\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -229,7 +229,7 @@ main (int argc, char *argv[])
enable_uids = 1;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -335,7 +335,7 @@ main (int argc, char *argv[])
(csv || human || enable_uids || enable_times || enable_extra_stats ||
checksum)) {
fprintf (stderr, _("%s: used a flag which can only be combined with -lR mode\nFor more information, read the virt-ls(1) man page.\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -344,7 +344,7 @@ main (int argc, char *argv[])
*/
if (human && csv) {
fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}

View File

@@ -100,7 +100,7 @@ _visit (guestfs_h *g, int depth, const char *dir,
if (xattrs->val[xattrp].attrval_len == 0) {
fprintf (stderr, _("%s: error getting extended attrs for %s %s\n"),
program_name, dir, names[i]);
guestfs_int_program_name, dir, names[i]);
return -1;
}
/* attrval is not \0-terminated. */
@@ -110,7 +110,7 @@ _visit (guestfs_h *g, int depth, const char *dir,
attrval[xattrs->val[xattrp].attrval_len] = '\0';
if (sscanf (attrval, "%zu", &nr_xattrs) != 1) {
fprintf (stderr, _("%s: error: cannot parse xattr count for %s %s\n"),
program_name, dir, names[i]);
guestfs_int_program_name, dir, names[i]);
return -1;
}

View File

@@ -26,7 +26,7 @@
# freeform string.
m4_define([libguestfs_major], [1])
m4_define([libguestfs_minor], [29])
m4_define([libguestfs_release], [23])
m4_define([libguestfs_release], [38])
AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release)
AC_CONFIG_AUX_DIR([build-aux])
@@ -90,6 +90,9 @@ AC_DEFINE([PACKAGE_VERSION_MAJOR],[libguestfs_major],[Major version number.])
AC_DEFINE([PACKAGE_VERSION_MINOR],[libguestfs_minor],[Minor version number.])
AC_DEFINE([PACKAGE_VERSION_RELEASE],[libguestfs_release],[Release number.])
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_EXTRA],["$libguestfs_extra"],[Extra version string.])
PACKAGE_VERSION_FULL="libguestfs_major.libguestfs_minor.libguestfs_release${libguestfs_extra}"
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_FULL],["$PACKAGE_VERSION_FULL"],[Full version string.])
AC_SUBST([PACKAGE_VERSION_FULL])
# Define $(SED).
m4_ifdef([AC_PROG_SED],[
@@ -315,6 +318,7 @@ AC_CHECK_FUNCS([\
be32toh \
fsync \
futimens \
getprogname \
getxattr \
htonl \
htons \
@@ -589,6 +593,15 @@ AC_ARG_WITH([extra-packages],
[EXTRA_PACKAGES=])
AC_SUBST([EXTRA_PACKAGES])
dnl Check if crypt() is provided by a separate library.
old_LIBS="$LIBS"
AC_SEARCH_LIBS([crypt],[crypt])
LIBS="$old_LIBS"
if test "$ac_cv_search_crypt" = "-lcrypt" ; then
LIBCRYPT_LIBS="-lcrypt"
fi
AC_SUBST([LIBCRYPT_LIBS])
dnl Check for libdl/dlopen (optional - only used to test if the library
dnl can be used with libdl).
AC_CHECK_LIB([dl],[dlopen],[have_libdl=yes],[have_libdl=no])
@@ -1120,6 +1133,7 @@ AS_IF([test "x$OCAMLC" != "xno"],[
])
OCAML_PKG_gettext=no
OCAML_PKG_libvirt=no
OCAML_PKG_oUnit=no
AS_IF([test "x$OCAMLC" != "xno"],[
# Create mllib/common_gettext.ml, gettext functions or stubs.
@@ -1130,10 +1144,13 @@ AS_IF([test "x$OCAMLC" != "xno"],[
GUESTFS_CREATE_COMMON_GETTEXT_ML([mllib/common_gettext.ml])
AC_CHECK_OCAML_PKG(libvirt)
AC_CHECK_OCAML_PKG(oUnit)
])
AM_CONDITIONAL([HAVE_OCAML_PKG_GETTEXT],
[test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && test "x$OCAML_PKG_gettext" != "xno"])
AM_CONDITIONAL([HAVE_OCAML_PKG_LIBVIRT],
[test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && test "x$OCAML_PKG_libvirt" != "xno"])
AM_CONDITIONAL([HAVE_OCAML_PKG_OUNIT],
[test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno" && test "x$OCAML_PKG_oUnit" != "xno"])
@@ -1819,7 +1836,8 @@ AC_CONFIG_FILES([Makefile
tests/xml/Makefile
tools/Makefile
v2v/Makefile
v2v/test-v2v-networks-and-bridges.xml])
v2v/test-harness/Makefile
v2v/test-harness/META])
AC_OUTPUT
dnl Produce summary.

View File

@@ -88,9 +88,9 @@ virt_customize_CFLAGS = \
$(LIBXML2_CFLAGS)
BOBJECTS = \
$(top_builddir)/mllib/config.cmo \
$(top_builddir)/mllib/common_gettext.cmo \
$(top_builddir)/mllib/common_utils.cmo \
$(top_builddir)/mllib/config.cmo \
$(top_builddir)/mllib/regedit.cmo \
$(top_builddir)/mllib/uRI.cmo \
$(SOURCES_ML:.ml=.cmo)

View File

@@ -59,10 +59,7 @@ let main () =
let trace = ref false in
let verbose = ref false in
let display_version () =
printf "virt-customize %s\n" Config.package_version;
exit 0
and add_file arg =
let add_file arg =
let uri =
try URI.parse_uri arg
with Invalid_argument "URI.parse_uri" ->
@@ -103,8 +100,10 @@ let main () =
"--smp", Arg.Int set_smp, "vcpus" ^ " " ^ s_"Set number of vCPUs";
"-v", Arg.Set verbose, " " ^ s_"Enable debugging messages";
"--verbose", Arg.Set verbose, " " ^ s_"Enable debugging messages";
"-V", Arg.Unit display_version, " " ^ s_"Display version and exit";
"--version", Arg.Unit display_version, " " ^ s_"Display version and exit";
"-V", Arg.Unit (print_version_and_exit ~prog),
" " ^ s_"Display version and exit";
"--version", Arg.Unit (print_version_and_exit ~prog),
" " ^ s_"Display version and exit";
"-x", Arg.Set trace, " " ^ s_"Enable tracing of libguestfs calls";
] in
let customize_argspec, get_customize_ops =

View File

@@ -104,8 +104,7 @@ exec >>%s 2>&1
| "yum" ->
sprintf "yum -y install %s" quoted_args
| "zypper" ->
(* XXX Should we use -n option? *)
sprintf "zypper in %s" quoted_args
sprintf "zypper -n in %s" quoted_args
| "unknown" ->
error (f_"--install is not supported for this guest operating system")
| pm ->
@@ -144,9 +143,6 @@ exec >>%s 2>&1
if not (Random_seed.set_random_seed g root) then
warning (f_"random seed could not be set for this type of guest");
(* Used for numbering firstboot commands. *)
let i = ref 0 in
(* Store the passwords and set them all at the end. *)
let passwords = Hashtbl.create 13 in
let set_password user pw =
@@ -175,6 +171,14 @@ exec >>%s 2>&1
* read when their arguments are met. *)
()
| `Copy (src, dest) ->
msg (f_"Copying (in image): %s to %s") src dest;
g#cp_a src dest
| `CopyIn (localpath, remotedir) ->
msg (f_"Copying: %s to %s") localpath remotedir;
g#copy_in localpath remotedir
| `Delete path ->
msg (f_"Deleting: %s") path;
g#rm_rf path
@@ -188,22 +192,20 @@ exec >>%s 2>&1
Perl_edit.edit_file ~verbose g#ocaml_handle path expr
| `FirstbootCommand cmd ->
incr i;
msg (f_"Installing firstboot command: [%d] %s") !i cmd;
Firstboot.add_firstboot_script g root !i cmd
msg (f_"Installing firstboot command: %s") cmd;
Firstboot.add_firstboot_script g root cmd cmd
| `FirstbootPackages pkgs ->
incr i;
msg (f_"Installing firstboot packages: [%d] %s") !i
msg (f_"Installing firstboot packages: %s")
(String.concat " " pkgs);
let cmd = guest_install_command pkgs in
Firstboot.add_firstboot_script g root !i cmd
let name = String.concat " " ("install" :: pkgs) in
Firstboot.add_firstboot_script g root name cmd
| `FirstbootScript script ->
incr i;
msg (f_"Installing firstboot script: [%d] %s") !i script;
msg (f_"Installing firstboot script: %s") script;
let cmd = read_whole_file script in
Firstboot.add_firstboot_script g root !i cmd
Firstboot.add_firstboot_script g root script cmd
| `Hostname hostname ->
msg (f_"Setting the hostname: %s") hostname;
@@ -226,6 +228,10 @@ exec >>%s 2>&1
msg (f_"Making directory: %s") dir;
g#mkdir_p dir
| `Move (src, dest) ->
msg (f_"Moving: %s -> %s") src dest;
g#mv src dest
| `Password (user, pw) ->
set_password user pw
@@ -249,6 +255,14 @@ exec >>%s 2>&1
| _ ->
warning (f_"SSH key could be injected for this type of guest"))
| `Truncate path ->
msg (f_"Truncating: %s") path;
g#truncate path
| `TruncateRecursive path ->
msg (f_"Recursively truncating: %s") path;
truncate_recursive g path
| `Timezone tz ->
msg (f_"Setting the timezone: %s") tz;
if not (Timezone.set_timezone g root tz) then
@@ -276,7 +290,13 @@ exec >>%s 2>&1
let perms = statbuf.st_perm land 0o7777 (* sticky & set*id *) in
g#chmod perms dest;
let uid, gid = statbuf.st_uid, statbuf.st_gid in
g#chown uid gid dest
let chown () =
try g#chown uid gid dest
with Guestfs.Error m as e ->
if g#last_errno () = Guestfs.Errno.errno_EPERM
then warning "%s" m
else raise e in
chown ()
| `Write (path, content) ->
msg (f_"Writing: %s") path;

View File

@@ -24,6 +24,16 @@ open Common_gettext.Gettext
open Customize_utils
open Regedit
let unix2dos s =
String.concat "\r\n" (Str.split_delim (Str.regexp_string "\n") s)
let sanitize_name =
let rex = Str.regexp "[^A-Za-z0-9_]" in
fun n ->
let n = Str.global_replace rex "-" n in
let len = String.length n and max = 60 in
if len >= max then String.sub n 0 max else n
(* For Linux guests. *)
module Linux = struct
let firstboot_dir = "/usr/lib/virt-sysprep"
@@ -207,22 +217,41 @@ module Windows = struct
* scripts in the directory. Note we need to use CRLF line endings
* in this script.
*)
let firstboot_script = [
"@echo off";
"echo starting firstboot service >>log.txt";
(* Notes:
* - You have to use double %% inside the batch file, but NOT
* when typing the same commands on the command line.
* - You have to use 'call' in front of every external command
* else it basically exec's the command and never returns.
* FFS.
*)
"for /f %%f in ('dir /b scripts') do call \"scripts\\%%f\" >>log.txt";
"echo uninstalling firstboot service >>log.txt";
"rhsrvany.exe -s firstboot uninstall >>log.txt";
] in
let firstboot_script = String.concat "\r\n" firstboot_script ^ "\r\n" in
g#write (firstboot_dir // "firstboot.bat") firstboot_script;
let firstboot_script = sprintf "\
@echo off
setlocal EnableDelayedExpansion
set firstboot=%s
set log=%%firstboot%%\\log.txt
set scripts=%%firstboot%%\\scripts
set scripts_done=%%firstboot%%\\scripts-done
call :main > \"%%log%%\" 2>&1
exit /b
:main
echo starting firstboot service
if not exist \"%%scripts_done%%\" (
mkdir \"%%scripts_done%%\"
)
for %%%%f in (\"%%scripts%%\"\\*.bat) do (
echo running \"%%%%f\"
call \"%%%%f\"
set elvl=!errorlevel!
echo .... exit code !elvl!
if !elvl! equ 0 (
move \"%%%%f\" \"%%scripts_done%%\"
)
)
echo uninstalling firstboot service
rhsrvany.exe -s firstboot uninstall
" firstboot_dir_win in
g#write (firstboot_dir // "firstboot.bat") (unix2dos firstboot_script);
(* Open the SYSTEM hive. *)
let systemroot = g#inspect_get_windows_systemroot root in
@@ -267,24 +296,24 @@ module Windows = struct
end
let add_firstboot_script (g : Guestfs.guestfs) root i content =
let script_count = ref 0
let add_firstboot_script (g : Guestfs.guestfs) root name content =
let typ = g#inspect_get_type root in
let distro = g#inspect_get_distro root in
incr script_count;
let filename = sprintf "%04d-%s" !script_count (sanitize_name name) in
match typ, distro with
| "linux", _ ->
Linux.install_service g distro;
let t = Int64.of_float (Unix.time ()) in
let r = string_random8 () in
let filename = sprintf "%s/scripts/%04d-%Ld-%s" Linux.firstboot_dir i t r in
let filename = Linux.firstboot_dir // "scripts" // filename in
g#write filename content;
g#chmod 0o755 filename
| "windows", _ ->
let firstboot_dir = Windows.install_service g root in
let t = Int64.of_float (Unix.time ()) in
let r = string_random8 () in
let filename = sprintf "%s/scripts/%04d-%Ld-%s.bat" firstboot_dir i t r in
g#write filename content
let filename = firstboot_dir // "scripts" // filename ^ ".bat" in
g#write filename (unix2dos content)
| _ ->
error (f_"guest type %s/%s is not supported") typ distro

View File

@@ -16,13 +16,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*)
val add_firstboot_script : Guestfs.guestfs -> string -> int -> string -> unit
(** [add_firstboot_script g root idx content] adds a firstboot
script called [shortname] containing [content].
val add_firstboot_script : Guestfs.guestfs -> string -> string -> string -> unit
(** [add_firstboot_script g root name content] adds a firstboot
script called [name] containing [content].
NB. [content] is the contents of the script, {b not} a filename.
[content] is the contents of the script, {b not} a filename.
The scripts run in index ([idx]) order.
The actual name of the script on the guest filesystem is made of [name]
with all characters but alphanumeric replaced with dashes.
The scripts are run in the order they are registered.
For Linux guests using SELinux you should make sure the
filesystem is relabelled after calling this. *)

View File

@@ -19,4 +19,4 @@
# Hack automake to link binary properly. There is no other way to add
# the -cclib parameter to the end of the command line.
exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ -lcrypt @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'
exec "$@" -linkpkg -cclib '-lutils @LIBTINFO_LIBS@ @LIBCRYPT_LIBS@ @LIBVIRT_LIBS@ @LIBXML2_LIBS@ @LIBINTL@ -lgnu'

View File

@@ -56,8 +56,13 @@ let rec set_random_seed (g : Guestfs.guestfs) root =
None in
match file with
| Some file ->
make_random_seed_file g file;
created := true
let dir =
let i = String.rindex file '/' in
String.sub file 0 i in
if g#is_dir dir then (
make_random_seed_file g file;
created := true
)
| None -> ()
);

View File

@@ -37,6 +37,7 @@ GUESTFSD_EXT_CMD(str_btrfstune, btrfstune);
GUESTFSD_EXT_CMD(str_btrfsck, btrfsck);
GUESTFSD_EXT_CMD(str_mkfs_btrfs, mkfs.btrfs);
GUESTFSD_EXT_CMD(str_umount, umount);
GUESTFSD_EXT_CMD(str_btrfsimage, btrfs-image);
int
optgroup_btrfs_available (void)
@@ -610,7 +611,7 @@ do_btrfs_subvolume_get_default (const mountable_t *fs)
goto error;
}
if (sscanf (out, "ID %" SCNi64, &ret) != 1) {
reply_with_error ("%s: could not parse subvolume id: %s.", argv[0], out);
reply_with_error ("%s: could not parse subvolume id: %s", argv[0], out);
ret = -1;
goto error;
}
@@ -1210,12 +1211,45 @@ do_btrfs_qgroup_destroy (const char *qgroupid, const char *subvolume)
return 0;
}
/* btrfs qgroup show command change default output to
* binary prefix since v3.18.2, such as KiB;
* also introduced '--raw' to keep traditional behaviour.
* We could check wheter 'btrfs qgroup show' support '--raw'
* option by checking the output of
* 'btrfs qgroup show' support --help' command.
*/
static int
test_btrfs_qgroup_show_raw_opt (void)
{
static int result = -1;
if (result != -1)
return result;
CLEANUP_FREE char *err = NULL;
CLEANUP_FREE char *out = NULL;
int r = commandr (&out, &err, str_btrfs, "qgroup", "show", "--help", NULL);
if (r == -1) {
reply_with_error ("btrfs qgroup show --help: %s", err);
return -1;
}
if (strstr (out, "--raw") == NULL)
result = 0;
else
result = 1;
return result;
}
guestfs_int_btrfsqgroup_list *
do_btrfs_qgroup_show (const char *path)
{
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
size_t i = 0;
int has_raw_opt = test_btrfs_qgroup_show_raw_opt ();
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
CLEANUP_FREE char *out = NULL;
@@ -1231,6 +1265,8 @@ do_btrfs_qgroup_show (const char *path)
ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "qgroup");
ADD_ARG (argv, i, "show");
if (has_raw_opt > 0)
ADD_ARG (argv, i, "--raw");
ADD_ARG (argv, i, path_buf);
ADD_ARG (argv, i, NULL);
@@ -1275,7 +1311,7 @@ do_btrfs_qgroup_show (const char *path)
if (sscanf (line, "%" SCNu64 "/%" SCNu64 " %" SCNu64 " %" SCNu64,
&dummy1, &dummy2, &this->btrfsqgroup_rfer,
&this->btrfsqgroup_excl) != 4) {
reply_with_perror ("sscanf");
reply_with_error ("cannot parse output of qgroup show command: %s", line);
goto error;
}
p = strchr(line, ' ');
@@ -1659,3 +1695,391 @@ do_btrfs_rescue_super_recover (const char *device)
return 0;
}
guestfs_int_btrfsbalance *
do_btrfs_balance_status (const char *path)
{
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
char *out;
int r;
guestfs_int_btrfsbalance *ret;
char **lines;
size_t nlines;
const char *errptr;
int erroffset;
#define N_MATCH 2
int ovector[N_MATCH * 3];
pcre *re = NULL;
path_buf = sysroot_path (path);
if (path_buf == NULL) {
reply_with_perror ("malloc");
return NULL;
}
ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "balance");
ADD_ARG (argv, i, "status");
ADD_ARG (argv, i, path_buf);
ADD_ARG (argv, i, NULL);
r = commandv (&out, &err, argv);
if (r == -1) {
reply_with_error ("%s: %s", path, err);
return NULL;
}
lines = split_lines (out);
if (!lines)
return NULL;
nlines = count_strings (lines);
ret = malloc(sizeof *ret);
if (ret == NULL) {
reply_with_perror ("malloc");
goto error;
}
memset (ret, 0, sizeof(*ret));
/* Output of `btrfs balance status' is like:
*
* running:
*
* Balance on '/' is running
* 3 out of about 8 chunks balanced (3 considered), 62% left
*
* paused:
*
* Balance on '/' is paused
* 3 out of about 8 chunks balanced (3 considered), 62% left
*
* no balance running:
*
* No Balance found on '/'
*
*/
if (nlines < 1) {
reply_with_perror ("No balance status output");
return NULL;
}
if (strstr (lines[0], "No balance found on")) {
ret->btrfsbalance_status = strdup("none");
if (ret->btrfsbalance_status == NULL) {
reply_with_perror ("strdup");
return NULL;
}
return ret;
}
re = pcre_compile ("Balance on '.*' is (.*)", 0, &errptr, &erroffset, NULL);
if (re == NULL) {
reply_with_error ("pcre_compile (%i): %s", erroffset, errptr);
goto error;
}
if (pcre_exec (re, NULL, lines[0], strlen (lines[0]), 0, 0,
ovector, N_MATCH * 3) < 0) {
reply_with_error ("unexpected output from 'btrfs balance status' command: %s", lines[0]);
goto error;
}
#undef N_MATCH
if (STREQ (lines[0] + ovector[2], "running"))
ret->btrfsbalance_status = strdup("running");
else if (STREQ (lines[0] + ovector[2], "paused"))
ret->btrfsbalance_status = strdup("paused");
else {
reply_with_error ("unexpected output from 'btrfs balance status' command: %s", lines[0]);
goto error;
}
if (nlines < 2) {
reply_with_error ("truncated output from 'btrfs balance status' command");
goto error;
}
if (sscanf (lines[1], "%" SCNu64 " out of about %" SCNu64
" chunks balanced (%" SCNu64 " considered), %" SCNu64 "%% left",
&ret->btrfsbalance_balanced, &ret->btrfsbalance_total,
&ret->btrfsbalance_considered, &ret->btrfsbalance_left) != 4) {
reply_with_perror ("sscanf");
goto error;
}
pcre_free (re);
return ret;
error:
free (ret->btrfsbalance_status);
free (ret);
pcre_free (re);
return NULL;
}
guestfs_int_btrfsscrub *
do_btrfs_scrub_status (const char *path)
{
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
char *out;
int r;
guestfs_int_btrfsscrub *ret;
char **lines;
path_buf = sysroot_path (path);
if (path_buf == NULL) {
reply_with_perror ("malloc");
return NULL;
}
ADD_ARG (argv, i, str_btrfs);
ADD_ARG (argv, i, "scrub");
ADD_ARG (argv, i, "status");
ADD_ARG (argv, i, "-R");
ADD_ARG (argv, i, path_buf);
ADD_ARG (argv, i, NULL);
r = commandv (&out, &err, argv);
if (r == -1) {
reply_with_error ("%s: %s", path, err);
return NULL;
}
if (verbose)
fprintf (stderr, "output from 'btrfs scrub status -R %s' is:\n%s", path, out);
lines = split_lines (out);
if (!lines)
return NULL;
if (count_strings (lines) < 2) {
reply_with_error ("truncated output from 'btrfs scrub status -R' command");
return NULL;
}
ret = malloc (sizeof *ret);
if (ret == NULL) {
reply_with_perror ("malloc");
return NULL;
}
memset (ret, 0, sizeof(*ret));
/* Output of `btrfs scrub -R status' is like:
*
* scrub status for 346121d1-1847-40f8-9b7b-2bf3d539c68f
* scrub started at Mon Feb 2 17:39:38 2015, running for 93 seconds
* data_extents_scrubbed: 136670
* tree_extents_scrubbed: 30023
* data_bytes_scrubbed: 4474441728
* tree_bytes_scrubbed: 491896832
* read_errors: 0
* csum_errors: 0
* verify_errors: 0
* no_csum: 17760
* csum_discards: 197622
* super_errors: 0
* malloc_errors: 0
* uncorrectable_errors: 0
* unverified_errors: 0
* corrected_errors: 0
* last_physical: 10301341696
*
* or:
*
* scrub status for 346121d1-1847-40f8-9b7b-2bf3d539c68f
* no stats available
*/
for (i = 1; lines[i] != NULL; ++i) {
if ((i == 1) && STREQ (lines[i], "\tno stats available"))
return ret;
else if (STRPREFIX (lines[i], "\tscrub started at"))
continue;
else if (sscanf (lines[i], "\tdata_extents_scrubbed: %" SCNu64,
&ret->btrfsscrub_data_extents_scrubbed) == 1)
continue;
else if (sscanf (lines[i], "\ttree_extents_scrubbed: %" SCNu64,
&ret->btrfsscrub_tree_extents_scrubbed) == 1)
continue;
else if (sscanf (lines[i], "\tdata_bytes_scrubbed: %" SCNu64,
&ret->btrfsscrub_data_bytes_scrubbed) == 1)
continue;
else if (sscanf (lines[i], "\ttree_bytes_scrubbed: %" SCNu64,
&ret->btrfsscrub_tree_bytes_scrubbed) == 1)
continue;
else if (sscanf (lines[i], "\tread_errors: %" SCNu64,
&ret->btrfsscrub_read_errors) == 1)
continue;
else if (sscanf (lines[i], "\tcsum_errors: %" SCNu64,
&ret->btrfsscrub_csum_errors) == 1)
continue;
else if (sscanf (lines[i], "\tverify_errors: %" SCNu64,
&ret->btrfsscrub_verify_errors) == 1)
continue;
else if (sscanf (lines[i], "\tno_csum: %" SCNu64,
&ret->btrfsscrub_no_csum) == 1)
continue;
else if (sscanf (lines[i], "\tcsum_discards: %" SCNu64,
&ret->btrfsscrub_csum_discards) == 1)
continue;
else if (sscanf (lines[i], "\tsuper_errors: %" SCNu64,
&ret->btrfsscrub_super_errors) == 1)
continue;
else if (sscanf (lines[i], "\tmalloc_errors: %" SCNu64,
&ret->btrfsscrub_malloc_errors) == 1)
continue;
else if (sscanf (lines[i], "\tuncorrectable_errors: %" SCNu64,
&ret->btrfsscrub_uncorrectable_errors) == 1)
continue;
else if (sscanf (lines[i], "\tunverified_errors: %" SCNu64,
&ret->btrfsscrub_unverified_errors) == 1)
continue;
else if (sscanf (lines[i], "\tcorrected_errors: %" SCNu64,
&ret->btrfsscrub_corrected_errors) == 1)
continue;
else if (sscanf (lines[i], "\tlast_physical: %" SCNu64,
&ret->btrfsscrub_last_physical) == 1)
continue;
else
goto error;
}
if (i < 17) {
reply_with_error ("truncated output from 'btrfs scrub status -R' command");
free (ret);
return NULL;
}
return ret;
error:
reply_with_error ("%s: could not parse btrfs scrub status.", lines[i]);
free (ret);
return NULL;
}
int
do_btrfstune_seeding (const char *device, int svalue)
{
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
size_t i = 0;
CLEANUP_FREE char *err = NULL;
CLEANUP_FREE char *out = NULL;
int r;
const char *s_value = svalue ? "1" : "0";
ADD_ARG (argv, i, str_btrfstune);
ADD_ARG (argv, i, "-S");
ADD_ARG (argv, i, s_value);
if (svalue == 0)
ADD_ARG (argv, i, "-f");
ADD_ARG (argv, i, device);
ADD_ARG (argv, i, NULL);
r = commandv (&out, &err, argv);
if (r == -1) {
reply_with_error ("%s: %s", device, err);
return -1;
}
return 0;
}
int
do_btrfstune_enable_extended_inode_refs (const char *device)
{
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
size_t i = 0;
CLEANUP_FREE char *err = NULL;
CLEANUP_FREE char *out = NULL;
int r;
ADD_ARG (argv, i, str_btrfstune);
ADD_ARG (argv, i, "-r");
ADD_ARG (argv, i, device);
ADD_ARG (argv, i, NULL);
r = commandv (&out, &err, argv);
if (r == -1) {
reply_with_error ("%s: %s", device, err);
return -1;
}
return 0;
}
int
do_btrfstune_enable_skinny_metadata_extent_refs (const char *device)
{
const size_t MAX_ARGS = 64;
const char *argv[MAX_ARGS];
size_t i = 0;
CLEANUP_FREE char *err = NULL;
CLEANUP_FREE char *out = NULL;
int r;
ADD_ARG (argv, i, str_btrfstune);
ADD_ARG (argv, i, "-x");
ADD_ARG (argv, i, device);
ADD_ARG (argv, i, NULL);
r = commandv (&out, &err, argv);
if (r == -1) {
reply_with_error ("%s: %s", device, err);
return -1;
}
return 0;
}
int
do_btrfs_image (char *const *sources, const char *image,
int compresslevel)
{
size_t nr_sources = count_strings (sources);
const size_t MAX_ARGS = 64 + nr_sources;
const char *argv[MAX_ARGS];
size_t i = 0, j;
CLEANUP_FREE char *err = NULL;
CLEANUP_FREE char *out = NULL;
char compresslevel_s[64];
int r;
if (nr_sources == 0) {
reply_with_error ("list of sources must be non-empty");
return -1;
}
ADD_ARG (argv, i, str_btrfsimage);
if ((optargs_bitmask & GUESTFS_BTRFS_IMAGE_COMPRESSLEVEL_BITMASK)
&& compresslevel >= 0) {
snprintf (compresslevel_s, sizeof compresslevel_s, "%d", compresslevel);
ADD_ARG (argv, i, "-c");
ADD_ARG (argv, i, compresslevel_s);
}
for (j = 0; j < nr_sources; ++j)
ADD_ARG (argv, i, sources[j]);
ADD_ARG (argv, i, image);
ADD_ARG (argv, i, NULL);
r = commandv (&out, &err, argv);
if (r == -1) {
reply_with_error ("%s %s: %s", sources[0], image, err);
return -1;
}
return 0;
}

View File

@@ -296,9 +296,9 @@ do_e2fsck (const char *device,
ADD_ARG (argv, i, device);
ADD_ARG (argv, i, NULL);
r = commandvf (NULL, &err,
COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
argv);
r = commandrvf (NULL, &err,
COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
argv);
/* 0 = no errors, 1 = errors corrected.
*
* >= 4 means uncorrected or other errors.

View File

@@ -33,6 +33,13 @@ GUESTFSD_EXT_CMD(str_parted, parted);
GUESTFSD_EXT_CMD(str_sfdisk, sfdisk);
GUESTFSD_EXT_CMD(str_sgdisk, sgdisk);
enum parted_has_m_opt {
PARTED_INVALID = -1,
/* parted do not support -m option */
PARTED_OPT_NO_M = 0,
PARTED_OPT_HAS_M = 1,
};
/* Notes:
*
* Parted 1.9 sends error messages to stdout, hence use of the
@@ -317,10 +324,10 @@ get_table_field (const char *line, int n)
* print_partition_table below. Test for this option the first time
* this function is called.
*/
static int
static enum parted_has_m_opt
test_parted_m_opt (void)
{
static int result = -1;
static enum parted_has_m_opt result = PARTED_INVALID;
if (result >= 0)
return result;
@@ -334,20 +341,21 @@ test_parted_m_opt (void)
}
if (err && strstr (err, "invalid option -- m"))
result = 0;
result = PARTED_OPT_NO_M;
else
result = 1;
result = PARTED_OPT_HAS_M;
return result;
}
static char *
print_partition_table (const char *device, int parted_has_m_opt)
print_partition_table (const char *device,
enum parted_has_m_opt parted_has_m_opt)
{
char *out;
CLEANUP_FREE char *err = NULL;
int r;
if (parted_has_m_opt)
if (PARTED_OPT_HAS_M == parted_has_m_opt)
r = command (&out, &err, str_parted, "-m", "--", device,
"unit", "b",
"print", NULL);
@@ -369,15 +377,15 @@ print_partition_table (const char *device, int parted_has_m_opt)
char *
do_part_get_parttype (const char *device)
{
int parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == -1)
enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == PARTED_INVALID)
return NULL;
CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
if (!out)
return NULL;
if (parted_has_m_opt) {
if (PARTED_OPT_HAS_M == parted_has_m_opt) {
/* New-style parsing using the "machine-readable" format from
* 'parted -m'.
*/
@@ -451,8 +459,8 @@ do_part_get_parttype (const char *device)
guestfs_int_partition_list *
do_part_list (const char *device)
{
int parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == -1)
enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == PARTED_INVALID)
return NULL;
CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
@@ -466,7 +474,7 @@ do_part_list (const char *device)
guestfs_int_partition_list *r;
if (parted_has_m_opt) {
if (PARTED_OPT_HAS_M == parted_has_m_opt) {
/* New-style parsing using the "machine-readable" format from
* 'parted -m'.
*
@@ -577,8 +585,8 @@ do_part_get_bootable (const char *device, int partnum)
return -1;
}
int parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == -1)
enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == PARTED_INVALID)
return -1;
CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
@@ -590,7 +598,7 @@ do_part_get_bootable (const char *device, int partnum)
if (!lines)
return -1;
if (parted_has_m_opt) {
if (PARTED_OPT_HAS_M == parted_has_m_opt) {
/* New-style parsing using the "machine-readable" format from
* 'parted -m'.
*
@@ -681,6 +689,30 @@ do_part_get_bootable (const char *device, int partnum)
}
}
/* Test if sfdisk is recent enough to have --part-type, to be used instead
* of --print-id and --change-id.
*/
static int
test_sfdisk_has_part_type (void)
{
static int tested = -1;
if (tested != -1)
return tested;
int r;
CLEANUP_FREE char *out = NULL, *err = NULL;
r = command (&out, &err, str_sfdisk, "--help", NULL);
if (r == -1) {
reply_with_error ("%s: %s", "sfdisk --help", err);
return -1;
}
tested = strstr (out, "--part-type") != NULL;
return tested;
}
/* Currently we use sfdisk for getting and setting the ID byte. In
* future, extend parted to provide this functionality. As a result
* of using sfdisk, this won't work for non-MBR-style partitions, but
@@ -695,6 +727,8 @@ do_part_get_mbr_id (const char *device, int partnum)
return -1;
}
const char *param = test_sfdisk_has_part_type () ? "--part-type" : "--print-id";
char partnum_str[16];
snprintf (partnum_str, sizeof partnum_str, "%d", partnum);
@@ -703,9 +737,9 @@ do_part_get_mbr_id (const char *device, int partnum)
udev_settle ();
r = command (&out, &err, str_sfdisk, "--print-id", device, partnum_str, NULL);
r = command (&out, &err, str_sfdisk, param, device, partnum_str, NULL);
if (r == -1) {
reply_with_error ("sfdisk --print-id: %s", err);
reply_with_error ("sfdisk %s: %s", param, err);
return -1;
}
@@ -729,6 +763,8 @@ do_part_set_mbr_id (const char *device, int partnum, int idbyte)
return -1;
}
const char *param = test_sfdisk_has_part_type () ? "--part-type" : "--change-id";
char partnum_str[16];
snprintf (partnum_str, sizeof partnum_str, "%d", partnum);
@@ -741,9 +777,9 @@ do_part_set_mbr_id (const char *device, int partnum, int idbyte)
udev_settle ();
r = command (NULL, &err, str_sfdisk,
"--change-id", device, partnum_str, idbyte_str, NULL);
param, device, partnum_str, idbyte_str, NULL);
if (r == -1) {
reply_with_error ("sfdisk --change-id: %s", err);
reply_with_error ("sfdisk %s: %s", param, err);
return -1;
}
@@ -759,7 +795,7 @@ optgroup_gdisk_available (void)
}
int
do_part_set_gpt_type(const char *device, int partnum, const char *guid)
do_part_set_gpt_type (const char *device, int partnum, const char *guid)
{
if (partnum <= 0) {
reply_with_error ("partition number must be >= 1");
@@ -784,6 +820,32 @@ do_part_set_gpt_type(const char *device, int partnum, const char *guid)
return 0;
}
int
do_part_set_gpt_guid (const char *device, int partnum, const char *guid)
{
if (partnum <= 0) {
reply_with_error ("partition number must be >= 1");
return -1;
}
CLEANUP_FREE char *typecode = NULL;
if (asprintf (&typecode, "%i:%s", partnum, guid) == -1) {
reply_with_perror ("asprintf");
return -1;
}
CLEANUP_FREE char *err = NULL;
int r = commandf (NULL, &err, COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
str_sgdisk, device, "-u", typecode, NULL);
if (r == -1) {
reply_with_error ("%s %s -u %s: %s", str_sgdisk, device, typecode, err);
return -1;
}
return 0;
}
static char *
sgdisk_info_extract_field (const char *device, int partnum, const char *field,
char *(*extract) (const char *path))
@@ -893,6 +955,13 @@ do_part_get_gpt_type (const char *device, int partnum)
"Partition GUID code", extract_uuid);
}
char *
do_part_get_gpt_guid (const char *device, int partnum)
{
return sgdisk_info_extract_field (device, partnum,
"Partition unique GUID", extract_uuid);
}
char *
do_part_get_name (const char *device, int partnum)
{
@@ -903,15 +972,15 @@ do_part_get_name (const char *device, int partnum)
return NULL;
if (STREQ (parttype, "gpt")) {
int parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == -1)
enum parted_has_m_opt parted_has_m_opt = test_parted_m_opt ();
if (parted_has_m_opt == PARTED_INVALID)
return NULL;
CLEANUP_FREE char *out = print_partition_table (device, parted_has_m_opt);
if (!out)
return NULL;
if (parted_has_m_opt) {
if (PARTED_OPT_HAS_M == parted_has_m_opt) {
/* New-style parsing using the "machine-readable" format from
* 'parted -m'.
*/
@@ -961,3 +1030,109 @@ do_part_get_name (const char *device, int partnum)
reply_with_error ("cannot get the partition name from '%s' layouts", parttype);
return NULL;
}
char *
do_part_get_mbr_part_type (const char *device, int partnum)
{
CLEANUP_FREE char *parttype;
char *part_type;
parttype = do_part_get_parttype (device);
if (parttype == NULL)
return NULL;
/* machine parseable output by 'parted -m' did not provide
* partition type info.
* Use traditional style.
*/
CLEANUP_FREE char *out = print_partition_table (device, PARTED_OPT_NO_M);
if (!out)
return NULL;
CLEANUP_FREE_STRING_LIST char **lines = split_lines (out);
if (!lines)
return NULL;
size_t start = 0, end = 0, row;
for (row = 0; lines[row] != NULL; ++row)
if (STRPREFIX (lines[row], "Number")) {
start = row + 1;
break;
}
if (start == 0) {
reply_with_error ("parted output has no \"Number\" line");
return NULL;
}
for (row = start; lines[row] != NULL; ++row)
if (STREQ (lines[row], "")) {
end = row;
break;
}
if (end == 0) {
reply_with_error ("parted output has no blank after end of table");
return NULL;
}
/* Now parse the lines. */
size_t i;
int64_t temp_int64;
int part_num;
char temp_type[16] = {'\0'};
for (i = 0, row = start; row < end; ++i, ++row) {
if (STREQ (parttype, "gpt")) {
memcpy (temp_type, "primary", strlen("primary"));
if (sscanf (lines[row], "%d%" SCNi64 "B%" SCNi64 "B%" SCNi64 "B",
&part_num,
&temp_int64,
&temp_int64,
&temp_int64) != 4) {
reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
return NULL;
}
} else {
if (sscanf (lines[row], "%d%" SCNi64 "B%" SCNi64 "B%" SCNi64 "B" "%15s",
&part_num,
&temp_int64,
&temp_int64,
&temp_int64,
temp_type) != 5) {
reply_with_error ("could not parse row from output of parted print command: %s", lines[row]);
return NULL;
}
}
if (part_num != partnum)
continue;
if (STRPREFIX (temp_type, "primary")) {
part_type = strdup("primary");
if (part_type == NULL)
goto error;
} else if (STRPREFIX (temp_type, "logical")) {
part_type = strdup("logical");
if (part_type == NULL)
goto error;
} else if (STRPREFIX (temp_type, "extended")) {
part_type = strdup("extended");
if (part_type == NULL)
goto error;
} else
goto error;
return part_type;
}
if (row == end) {
reply_with_error ("could not find partnum: %d", partnum);
return NULL;
}
error:
reply_with_error ("strdup failed");
return NULL;
}

View File

@@ -309,7 +309,7 @@ send_error (int errnum, char *msg)
* to (char *) because they are defined that way in the XDR structs.
*/
err.errno_string =
(char *) (errnum > 0 ? guestfs___errno_to_string (errnum) : "");
(char *) (errnum > 0 ? guestfs_int_errno_to_string (errnum) : "");
err.error_message = (char *) msg;
if (!xdr_guestfs_message_error (&xdr, &err)) {

View File

@@ -83,7 +83,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
err = virGetLastError ();
fprintf (stderr,
_("%s: could not connect to libvirt (code %d, domain %d): %s\n"),
program_name, err->code, err->domain, err->message);
guestfs_int_program_name, err->code, err->domain, err->message);
exit (EXIT_FAILURE);
}
@@ -92,7 +92,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
err = virGetLastError ();
fprintf (stderr,
_("%s: could not get number of running domains (code %d, domain %d): %s\n"),
program_name, err->code, err->domain, err->message);
guestfs_int_program_name, err->code, err->domain, err->message);
exit (EXIT_FAILURE);
}
@@ -102,7 +102,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
err = virGetLastError ();
fprintf (stderr,
_("%s: could not list running domains (code %d, domain %d): %s\n"),
program_name, err->code, err->domain, err->message);
guestfs_int_program_name, err->code, err->domain, err->message);
exit (EXIT_FAILURE);
}
@@ -113,7 +113,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
err = virGetLastError ();
fprintf (stderr,
_("%s: could not get number of inactive domains (code %d, domain %d): %s\n"),
program_name, err->code, err->domain, err->message);
guestfs_int_program_name, err->code, err->domain, err->message);
exit (EXIT_FAILURE);
}
@@ -123,7 +123,7 @@ get_all_libvirt_domains (const char *libvirt_uri)
err = virGetLastError ();
fprintf (stderr,
_("%s: could not list inactive domains (code %d, domain %d): %s\n"),
program_name, err->code, err->domain, err->message);
guestfs_int_program_name, err->code, err->domain, err->message);
exit (EXIT_FAILURE);
}

View File

@@ -64,7 +64,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: display free space on virtual filesystems\n"
@@ -88,8 +88,8 @@ usage (int status)
" -V|--version Display version and exit\n"
" -x Trace libguestfs API calls\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -156,7 +156,7 @@ main (int argc, char *argv[])
uuid = 1;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -183,7 +183,7 @@ main (int argc, char *argv[])
case 'P':
if (sscanf (optarg, "%zu", &max_threads) != 1) {
fprintf (stderr, _("%s: -P option is not numeric\n"), program_name);
fprintf (stderr, _("%s: -P option is not numeric\n"), guestfs_int_program_name);
exit (EXIT_FAILURE);
}
break;
@@ -263,7 +263,7 @@ main (int argc, char *argv[])
*/
if (human && csv) {
fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -280,7 +280,7 @@ main (int argc, char *argv[])
free_domains ();
#else
fprintf (stderr, _("%s: compiled without support for libvirt.\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
#endif
}

View File

@@ -259,7 +259,7 @@ worker_thread (void *thread_data_vp)
static void
thread_failure (const char *fn, int err)
{
fprintf (stderr, "%s: %s: %s\n", program_name, fn, strerror (err));
fprintf (stderr, "%s: %s: %s\n", guestfs_int_program_name, fn, strerror (err));
}
#endif /* HAVE_LIBVIRT */

View File

@@ -90,7 +90,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: list differences between virtual machines\n"
@@ -126,8 +126,8 @@ usage (int status)
" -x Trace libguestfs API calls\n"
" --xattrs Display extended attributes\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -262,7 +262,7 @@ main (int argc, char *argv[])
enable_xattrs = 1;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -319,7 +319,7 @@ main (int argc, char *argv[])
if (drvs == NULL || drvs2 == NULL) {
fprintf (stderr,
_("%s: you must specify some -a|-A|-d|-D options, see %s(1)\n"),
program_name, program_name);
guestfs_int_program_name, guestfs_int_program_name);
usage (EXIT_FAILURE);
}
@@ -328,13 +328,13 @@ main (int argc, char *argv[])
*/
if (human && csv) {
fprintf (stderr, _("%s: you cannot use -h and --csv options together.\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
if (optind != argc) {
fprintf (stderr, _("%s: extra arguments on the command line\n"),
program_name);
guestfs_int_program_name);
usage (EXIT_FAILURE);
}
@@ -741,7 +741,7 @@ diff (struct file *file1, guestfs_h *g1, struct file *file2, guestfs_h *g2)
fprintf (stderr, "%s\n", cmd);
r = system (cmd);
if (!WIFEXITED (r) || WEXITSTATUS (r) != 0) {
fprintf (stderr, _("%s: external diff command failed\n"), program_name);
fprintf (stderr, _("%s: external diff command failed\n"), guestfs_int_program_name);
goto out;
}

View File

@@ -61,7 +61,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: Edit a file in a virtual machine\n"
@@ -85,8 +85,8 @@ usage (int status)
" -V|--version Display version and exit\n"
" -x Trace libguestfs API calls\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -156,7 +156,7 @@ main (int argc, char *argv[])
OPTION_format;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -168,7 +168,7 @@ main (int argc, char *argv[])
case 'b':
if (backup_extension) {
fprintf (stderr, _("%s: -b option given multiple times\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
backup_extension = optarg;
@@ -185,7 +185,7 @@ main (int argc, char *argv[])
case 'e':
if (perl_expr) {
fprintf (stderr, _("%s: -e option given multiple times\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
perl_expr = optarg;

View File

@@ -278,14 +278,10 @@ L<https://fedoraproject.org/wiki/EPEL>
=item RHEL 6
It is part of the default install. On RHEL 6 and 7 (only) you have to
install C<libguestfs-winsupport> to get Windows guest support.
=item RHEL 7
It will be part of the default install, and based on S<libguestfs 1.22>.
You will need to install C<libguestfs-winsupport> separately to get
Windows guest support.
It is part of the default install. On RHEL 6 and 7 (only) you have to
install C<libguestfs-winsupport> to get Windows guest support.
=back
@@ -417,8 +413,8 @@ C<localenv> should contain:
#export SUPERMIN=/tmp/supermin/src/supermin
#export LIBGUESTFS_HV=/tmp/qemu/x86_64-softmmu/qemu-system-x86_64
#export SUPERMIN_KERNEL=/tmp/linux/arch/x86/boot/bzImage
#export SUPERMIN_KERNEL_VERSION=3.XX.0
#export SUPERMIN_MODULES=/tmp/lib/modules/3.XX.0
#export SUPERMIN_KERNEL_VERSION=4.XX.0
#export SUPERMIN_MODULES=/tmp/lib/modules/4.XX.0
Uncomment and adjust these lines as required to use the alternate
programs you have compiled.

View File

@@ -423,22 +423,26 @@ Avoid processors that don't have hardware virtualization, and some
processors which are simply very slow (AMD Geode being a great
example).
=head1 DETAILED TIMINGS USING ANNOTATE
=head1 DETAILED TIMINGS USING TS
Use the L<annotate(1)>/L<annotate-output(1)> command to show detailed
Use the L<ts(1)> command (from moreutils) to show detailed
timings:
$ annotate-output +'%T.%N' guestfish -a /dev/null run -v
22:17:53.215784625 I: Started guestfish -a /dev/null run -v
22:17:53.240335409 E: libguestfs: [00000ms] supermin-helper --verbose -f checksum '/usr/lib64/guestfs/supermin.d' x86_64
22:17:53.266857866 E: supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = (null), initrd = (null), appliance = (null)
22:17:53.272704072 E: supermin helper [00000ms] inputs[0] = /usr/lib64/guestfs/supermin.d
22:17:53.276528651 E: checking modpath /lib/modules/3.4.0-1.fc17.x86_64.debug is a directory
$ guestfish -a /dev/null run -v |& ts -i '%.s'
0.000022 libguestfs: launch: program=guestfish
0.000134 libguestfs: launch: version=1.29.31fedora=23,release=2.fc23,libvirt
0.000044 libguestfs: launch: backend registered: unix
0.000035 libguestfs: launch: backend registered: uml
0.000035 libguestfs: launch: backend registered: libvirt
0.000032 libguestfs: launch: backend registered: direct
0.000030 libguestfs: launch: backend=libvirt
0.000031 libguestfs: launch: tmpdir=/tmp/libguestfsw18rBQ
0.000029 libguestfs: launch: umask=0002
0.000031 libguestfs: launch: euid=1000
0.000030 libguestfs: libvirt version = 1002012 (1.2.12)
[etc]
The timestamps are C<hours:minutes:seconds.nanoseconds>. By comparing
the timestamps you can see exactly how long each operation in the boot
sequence takes.
The timestamps are seconds (incrementally since the previous line).
=head1 DETAILED TIMINGS USING SYSTEMTAP
@@ -496,9 +500,9 @@ example:
xxxx (+0): guestfs_create
xxxx (+29): guestfs_set_pgroup g=0x17a9de0 pgroup=0x1
xxxx (+9): guestfs_add_drive_opts_argv g=0x17a9de0 [...]
xxxx (+8): guestfs___safe_strdup g=0x17a9de0 str=0x7f8a153bed5d
xxxx (+19): guestfs___safe_malloc g=0x17a9de0 nbytes=0x38
xxxx (+5): guestfs___safe_strdup g=0x17a9de0 str=0x17a9f60
xxxx (+8): guestfs_int_safe_strdup g=0x17a9de0 str=0x7f8a153bed5d
xxxx (+19): guestfs_int_safe_malloc g=0x17a9de0 nbytes=0x38
xxxx (+5): guestfs_int_safe_strdup g=0x17a9de0 str=0x17a9f60
xxxx (+10): guestfs_launch g=0x17a9de0
xxxx (+4): launch_start
[etc]

View File

@@ -57,13 +57,13 @@ read_config_from_file (const char *filename)
/*
if (verbose)
fprintf (stderr, "%s: reading configuration from %s\n",
program_name, filename);
guestfs_int_program_name, filename);
*/
if (config_read (&conf, fp) == CONFIG_FALSE) {
fprintf (stderr,
_("%s: %s: line %d: error parsing configuration file: %s\n"),
program_name, filename, config_error_line (&conf),
guestfs_int_program_name, filename, config_error_line (&conf),
config_error_text (&conf));
exit (EXIT_FAILURE);
}
@@ -95,8 +95,8 @@ parse_config (void)
xdg_env = getenv ("XDG_CONFIG_DIRS");
var = xdg_env != NULL && xdg_env[0] != 0 ? xdg_env : "/etc/xdg";
xdg_config_dirs = guestfs___split_string (':', var);
xdg_config_dirs_count = guestfs___count_strings (xdg_config_dirs);
xdg_config_dirs = guestfs_int_split_string (':', var);
xdg_config_dirs_count = guestfs_int_count_strings (xdg_config_dirs);
for (size_t i = xdg_config_dirs_count; i > 0; --i) {
CLEANUP_FREE char *path = NULL;
const char *dir = xdg_config_dirs[i - 1];
@@ -165,7 +165,7 @@ parse_config (void)
if (verbose)
fprintf (stderr,
_("%s: compiled without libconfig, guestfish configuration file ignored\n"),
program_name);
guestfs_int_program_name);
*/
}

View File

@@ -22,25 +22,11 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <libintl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <assert.h>
#include "fish.h"
struct fd_pid {
int fd; /* -1 == error */
pid_t pid;
};
static struct fd_pid make_tar_from_local (const char *local);
static struct fd_pid make_tar_output (const char *local, const char *basename);
static int split_path (char *buf, size_t buf_size, const char *path, const char **dirname, const char **basename);
int
run_copy_in (const char *cmd, size_t argc, char *argv[])
{
@@ -61,40 +47,10 @@ run_copy_in (const char *cmd, size_t argc, char *argv[])
int nr_locals = argc-1;
int remote_is_dir = guestfs_is_dir (g, remote);
if (remote_is_dir == -1)
return -1;
if (!remote_is_dir) {
fprintf (stderr, _("copy-in: target '%s' is not a directory\n"), remote);
return -1;
}
/* Upload each local one at a time using tar-in. */
/* Upload each local one at a time using copy-in. */
int i;
for (i = 0; i < nr_locals; ++i) {
struct fd_pid fdpid = make_tar_from_local (argv[i]);
if (fdpid.fd == -1)
return -1;
char fdbuf[64];
snprintf (fdbuf, sizeof fdbuf, "/dev/fd/%d", fdpid.fd);
int r = guestfs_tar_in (g, fdbuf, remote);
if (close (fdpid.fd) == -1) {
perror ("close (tar-from-local subprocess)");
r = -1;
}
int status;
if (waitpid (fdpid.pid, &status, 0) == -1) {
perror ("wait (tar-from-local subprocess)");
return -1;
}
if (!(WIFEXITED (status) && WEXITSTATUS (status) == 0))
return -1;
int r = guestfs_copy_in (g, argv[i], remote);
if (r == -1)
return -1;
}
@@ -102,98 +58,6 @@ run_copy_in (const char *cmd, size_t argc, char *argv[])
return 0;
}
static void tar_create (const char *dir, const char *path) __attribute__((noreturn));
/* This creates a subprocess which feeds a tar file back to the
* main guestfish process.
*/
static struct fd_pid
make_tar_from_local (const char *local)
{
int fd[2];
struct fd_pid r = { .fd = -1 };
if (pipe (fd) == -1) {
perror ("pipe");
return r;
}
r.pid = fork ();
if (r.pid == -1) {
perror ("fork");
return r;
}
if (r.pid > 0) { /* Parent */
close (fd[1]);
r.fd = fd[0];
return r;
}
/* Child. */
close (fd[0]);
dup2 (fd[1], 1);
close (fd[1]);
size_t buf_len = strlen (local) + 1;
char buf[buf_len];
const char *dirname, *basename;
if (split_path (buf, buf_len, local, &dirname, &basename) == -1)
_exit (EXIT_FAILURE);
tar_create (dirname, basename);
}
/* Split path into directory name and base name, using the buffer
* provided as a working area. If there is no directory name
* (eg. path == "/") then this can return dirname as NULL.
*/
static int
split_path (char *buf, size_t buf_size,
const char *path, const char **dirname, const char **basename)
{
size_t len = strlen (path);
if (len == 0 || len > buf_size - 1) {
fprintf (stderr, _("error: argument is zero length or longer than maximum permitted\n"));
return -1;
}
strcpy (buf, path);
if (len >= 2 && buf[len-1] == '/') {
buf[len-1] = '\0';
len--;
}
char *p = strrchr (buf, '/');
if (p && p > buf) { /* "foo/bar" */
*p = '\0';
p++;
if (dirname) *dirname = buf;
if (basename) *basename = p;
} else if (p && p == buf) { /* "/foo" */
if (dirname) *dirname = "/";
if (basename) *basename = buf+1;
} else {
if (dirname) *dirname = NULL;
if (basename) *basename = buf;
}
return 0;
}
static void
tar_create (const char *dir, const char *path)
{
if (dir)
execlp ("tar", "tar", "-C", dir, "-cf", "-", path, NULL);
else
execlp ("tar", "tar", "-cf", "-", path, NULL);
perror ("execlp: tar");
_exit (EXIT_FAILURE);
}
int
run_copy_out (const char *cmd, size_t argc, char *argv[])
{
@@ -207,14 +71,7 @@ run_copy_out (const char *cmd, size_t argc, char *argv[])
const char *local = argv[argc-1];
int nr_remotes = argc-1;
struct stat statbuf;
if (stat (local, &statbuf) == -1 ||
! (S_ISDIR (statbuf.st_mode))) {
fprintf (stderr, _("copy-out: target '%s' is not a directory\n"), local);
return -1;
}
/* Download each remote one at a time using tar-out. */
/* Download each remote one at a time using copy-out. */
int i, r;
for (i = 0; i < nr_remotes; ++i) {
CLEANUP_FREE char *remote = NULL;
@@ -224,138 +81,10 @@ run_copy_out (const char *cmd, size_t argc, char *argv[])
if (remote == NULL)
return -1;
/* If the remote is a file, download it. If it's a directory,
* create the directory in local first before using tar-out.
*/
r = guestfs_is_file (g, remote);
r = guestfs_copy_out (g, remote, local);
if (r == -1)
return -1;
if (r == 1) { /* is file */
CLEANUP_FREE char *filename = NULL;
size_t buf_len = strlen (remote) + 1;
char buf[buf_len];
const char *basename;
if (split_path (buf, buf_len, remote, NULL, &basename) == -1)
return -1;
if (asprintf (&filename, "%s/%s", local, basename) == -1) {
perror ("asprintf");
return -1;
}
if (guestfs_download (g, remote, filename) == -1)
return -1;
}
else { /* not a regular file */
r = guestfs_is_dir (g, remote);
if (r == -1)
return -1;
if (r == 0) {
fprintf (stderr, _("copy-out: '%s' is not a file or directory\n"),
remote);
return -1;
}
size_t buf_len = strlen (remote) + 1;
char buf[buf_len];
const char *basename;
if (split_path (buf, buf_len, remote, NULL, &basename) == -1)
return -1;
/* RHBZ#845522: If remote == "/" then basename would be an empty
* string. Replace it with "." so that make_tar_output writes
* to "local/."
*/
if (STREQ (basename, ""))
basename = ".";
struct fd_pid fdpid = make_tar_output (local, basename);
if (fdpid.fd == -1)
return -1;
char fdbuf[64];
snprintf (fdbuf, sizeof fdbuf, "/dev/fd/%d", fdpid.fd);
int r = guestfs_tar_out (g, remote, fdbuf);
if (close (fdpid.fd) == -1) {
perror ("close (tar-output subprocess)");
r = -1;
}
int status;
if (waitpid (fdpid.pid, &status, 0) == -1) {
perror ("wait (tar-output subprocess)");
return -1;
}
if (!(WIFEXITED (status) && WEXITSTATUS (status) == 0))
return -1;
if (r == -1)
return -1;
}
}
return 0;
}
/* This creates a subprocess which takes a tar file from the main
* guestfish process and unpacks it into the 'local/basename'
* directory.
*/
static struct fd_pid
make_tar_output (const char *local, const char *basename)
{
int fd[2];
struct fd_pid r = { .fd = -1 };
/* local can't be an empty string because the caller stats it and
* checks it is a directory.
*/
assert (STRNEQ (local, ""));
/* basename must not be an empty string (see RHBZ#845522). */
assert (STRNEQ (basename, ""));
if (pipe (fd) == -1) {
perror ("pipe");
return r;
}
r.pid = fork ();
if (r.pid == -1) {
perror ("fork");
return r;
}
if (r.pid > 0) { /* Parent */
close (fd[0]);
r.fd = fd[1];
return r;
}
/* Child. */
close (fd[1]);
dup2 (fd[0], 0);
close (fd[0]);
if (chdir (local) == -1) {
perror (local);
_exit (EXIT_FAILURE);
}
if (mkdir (basename, 0777) == -1 && errno != EEXIST) {
perror (basename);
_exit (EXIT_FAILURE);
}
if (chdir (basename) == -1) {
perror (basename);
_exit (EXIT_FAILURE);
}
execlp ("tar", "tar", "-xf", "-", NULL);
perror ("execlp: tar");
_exit (EXIT_FAILURE);
}

View File

@@ -108,7 +108,7 @@ complete_dest_paths_generator (const char *text, int state)
do { \
if (strs) { \
size_t i; \
size_t n = guestfs___count_strings (strs); \
size_t n = guestfs_int_count_strings (strs); \
\
if ( n > 0 && ! xalloc_oversized (nr_words + n, sizeof (struct word))) { \
struct word *w; \

View File

@@ -103,7 +103,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: guest filesystem shell\n"
@@ -152,9 +152,9 @@ usage (int status)
"run again without -i and use 'run' + 'list-filesystems' + 'mount' cmds.\n"
"\n"
"For more information, see the manpage %s(1).\n"),
program_name, program_name, program_name,
program_name, program_name, program_name,
program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name,
guestfs_int_program_name);
}
exit (status);
}
@@ -254,7 +254,7 @@ main (int argc, char *argv[])
if (optarg) {
if (sscanf (optarg, "%d", &remote_control) != 1) {
fprintf (stderr, _("%s: --listen=PID: PID was not a number: %s\n"),
program_name, optarg);
guestfs_int_program_name, optarg);
exit (EXIT_FAILURE);
}
} else {
@@ -262,7 +262,7 @@ main (int argc, char *argv[])
if (!p || sscanf (p, "%d", &remote_control) != 1) {
fprintf (stderr, _("%s: remote: $GUESTFISH_PID must be set"
" to the PID of the remote process\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
}
@@ -292,7 +292,7 @@ main (int argc, char *argv[])
complete_dest_paths = 0;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -311,14 +311,14 @@ main (int argc, char *argv[])
case 'D':
fprintf (stderr, _("%s: warning: -D option is deprecated, use --no-dest-paths instead\n"),
program_name);
guestfs_int_program_name);
complete_dest_paths = 0;
break;
case 'f':
if (file) {
fprintf (stderr, _("%s: only one -f parameter can be given\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
file = optarg;
@@ -515,7 +515,7 @@ main (int argc, char *argv[])
if (remote_control_listen && remote_control) {
fprintf (stderr,
_("%s: cannot use --listen and --remote options at the same time\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -523,13 +523,13 @@ main (int argc, char *argv[])
if (optind < argc) {
fprintf (stderr,
_("%s: extra parameters on the command line with --listen flag\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
if (file) {
fprintf (stderr,
_("%s: cannot use --listen and --file options at the same time\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
rc_listen ();
@@ -868,7 +868,7 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
if (p[len+1] && (p[len+1] != ' ' && p[len+1] != '\t')) {
fprintf (stderr,
_("%s: command arguments not separated by whitespace\n"),
program_name);
guestfs_int_program_name);
pcmd.status = -1;
return pcmd;
}
@@ -877,14 +877,14 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
p++;
len = strcspn (p, "'");
if (p[len] == '\0') {
fprintf (stderr, _("%s: unterminated single quote\n"), program_name);
fprintf (stderr, _("%s: unterminated single quote\n"), guestfs_int_program_name);
pcmd.status = -1;
return pcmd;
}
if (p[len+1] && (p[len+1] != ' ' && p[len+1] != '\t')) {
fprintf (stderr,
_("%s: command arguments not separated by whitespace\n"),
program_name);
guestfs_int_program_name);
pcmd.status = -1;
return pcmd;
}
@@ -908,7 +908,7 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
pend = &p[len];
} else {
fprintf (stderr, _("%s: internal error parsing string at '%s'\n"),
program_name, p);
guestfs_int_program_name, p);
abort ();
}
@@ -924,7 +924,7 @@ parse_command_line (char *buf, int *exit_on_error_rtn)
}
if (i == argv_len) {
fprintf (stderr, _("%s: too many arguments\n"), program_name);
fprintf (stderr, _("%s: too many arguments\n"), guestfs_int_program_name);
pcmd.status = -1;
return pcmd;
}
@@ -1000,7 +1000,7 @@ parse_quoted_string (char *p)
default:
error:
fprintf (stderr, _("%s: invalid escape sequence in string (starting at offset %d)\n"),
program_name, (int) (p - start));
guestfs_int_program_name, (int) (p - start));
return -1;
}
memmove (p+1, p+1+m, strlen (p+1+m) + 1);
@@ -1008,7 +1008,7 @@ parse_quoted_string (char *p)
}
if (!*p) {
fprintf (stderr, _("%s: unterminated double quote\n"), program_name);
fprintf (stderr, _("%s: unterminated double quote\n"), guestfs_int_program_name);
return -1;
}
@@ -1071,7 +1071,7 @@ cmdline (char *argv[], size_t optind, size_t argc)
cmd = argv[optind++];
if (STREQ (cmd, ":")) {
fprintf (stderr, _("%s: empty command on command line\n"), program_name);
fprintf (stderr, _("%s: empty command on command line\n"), guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -1200,7 +1200,7 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd,
}
if (ferror (stdout)) {
if (!pipecmd || pipe_error) {
fprintf (stderr, "%s: write error%s\n", program_name,
fprintf (stderr, "%s: write error%s\n", guestfs_int_program_name,
pipecmd ? " on pipe" : "");
r = -1;
}
@@ -1743,13 +1743,13 @@ win_prefix_drive_letter (char drive_letter, const char *path)
return NULL;
if (roots[0] == NULL) {
fprintf (stderr, _("%s: to use Windows drive letters, you must inspect the guest (\"-i\" option or run \"inspect-os\" command)\n"),
program_name);
guestfs_int_program_name);
return NULL;
}
drives = guestfs_inspect_get_drive_mappings (g, roots[0]);
if (drives == NULL || drives[0] == NULL) {
fprintf (stderr, _("%s: to use Windows drive letters, this must be a Windows guest\n"),
program_name);
guestfs_int_program_name);
return NULL;
}
@@ -1763,7 +1763,7 @@ win_prefix_drive_letter (char drive_letter, const char *path)
if (device == NULL) {
fprintf (stderr, _("%s: drive '%c:' not found. To list available drives do:\n inspect-get-drive-mappings %s\n"),
program_name, drive_letter, roots[0]);
guestfs_int_program_name, drive_letter, roots[0]);
return NULL;
}
@@ -1782,7 +1782,7 @@ win_prefix_drive_letter (char drive_letter, const char *path)
if (mountpoint == NULL) {
fprintf (stderr, _("%s: to access '%c:', mount %s first. One way to do this is:\n umount-all\n mount %s /\n"),
program_name, drive_letter, device, device);
guestfs_int_program_name, drive_letter, device, device);
return NULL;
}
@@ -1819,7 +1819,7 @@ file_in (const char *arg)
const char *endmarker = &arg[3];
if (*endmarker == '\0') {
fprintf (stderr, "%s: missing end marker in -<< expression\n",
program_name);
guestfs_int_program_name);
return NULL;
}
ret = file_in_heredoc (endmarker);
@@ -1884,7 +1884,7 @@ file_in_heredoc (const char *endmarker)
* is likely to be an error.
*/
fprintf (stderr, "%s: end of input reached without finding '%s'\n",
program_name, endmarker);
guestfs_int_program_name, endmarker);
goto error2;
found_end:

View File

@@ -103,7 +103,7 @@ run_glob (const char *cmd, size_t argc, char *argv[])
}
globs[i] = pp;
count[i] = guestfs___count_strings (pp);
count[i] = guestfs_int_count_strings (pp);
}
/* Issue the commands. */
@@ -113,7 +113,7 @@ run_glob (const char *cmd, size_t argc, char *argv[])
error:
for (i = 1; i < argc; ++i)
if (globs[i])
guestfs___free_string_list (globs[i]);
guestfs_int_free_string_list (globs[i]);
return r;
}
@@ -170,23 +170,23 @@ expand_devicename (guestfs_h *g, const char *device)
pp = guestfs_list_devices (g);
if (pp == NULL) goto error;
if (add_strings_matching (pp, device, &ret, &size) == -1) goto error;
guestfs___free_string_list (pp);
guestfs_int_free_string_list (pp);
pp = guestfs_list_partitions (g);
if (pp == NULL) goto error;
if (add_strings_matching (pp, device, &ret, &size) == -1) goto error;
guestfs___free_string_list (pp);
guestfs_int_free_string_list (pp);
pp = guestfs_list_md_devices (g);
if (pp == NULL) goto error;
if (add_strings_matching (pp, device, &ret, &size) == -1) goto error;
guestfs___free_string_list (pp);
guestfs_int_free_string_list (pp);
if (guestfs_feature_available (g, (char **) lvm2)) {
pp = guestfs_lvs (g);
if (pp == NULL) goto error;
if (add_strings_matching (pp, device, &ret, &size) == -1) goto error;
guestfs___free_string_list (pp);
guestfs_int_free_string_list (pp);
pp = NULL;
}
@@ -197,9 +197,9 @@ expand_devicename (guestfs_h *g, const char *device)
error:
if (pp)
guestfs___free_string_list (pp);
guestfs_int_free_string_list (pp);
if (ret)
guestfs___free_string_list (ret);
guestfs_int_free_string_list (ret);
return NULL;
}

View File

@@ -1391,13 +1391,6 @@ guestfish returns 0 if the commands completed without error, or
The C<edit> command uses C<$EDITOR> as the editor. If not
set, it uses C<vi>.
=item FEBOOTSTRAP_KERNEL
=item FEBOOTSTRAP_MODULES
When using supermin E<ge> 4.1.0, these have been renamed
L</SUPERMIN_KERNEL> and L</SUPERMIN_MODULES>.
=item GUESTFISH_DISPLAY_IMAGE
The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to
@@ -1520,13 +1513,14 @@ the path of qemu/KVM.
=item SUPERMIN_KERNEL
=item SUPERMIN_KERNEL_VERSION
=item SUPERMIN_MODULES
These two environment variables allow the kernel that libguestfs uses
in the appliance to be selected. If C<$SUPERMIN_KERNEL> is not set,
then the most recent host kernel is chosen. For more information
about kernel selection, see L<supermin(1)>. This feature is only
available in supermin / febootstrap E<ge> 3.8.
These three environment variables allow the kernel that libguestfs
uses in the appliance to be selected. If C<$SUPERMIN_KERNEL> is not
set, then the most recent host kernel is chosen. For more information
about kernel selection, see L<supermin(1)>.
=item TMPDIR

View File

@@ -60,7 +60,7 @@ inspect_mount_handle (guestfs_h *g)
{
if (live) {
fprintf (stderr, _("%s: don't use --live and -i options together\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -86,8 +86,8 @@ inspect_mount_handle (guestfs_h *g)
"If using other virt tools, this disk image won't work\n"
"with these tools. Use the guestfish equivalent commands\n"
"(see the virt tool manual page).\n"),
program_name);
guestfs___free_string_list (roots);
guestfs_int_program_name);
guestfs_int_free_string_list (roots);
exit (EXIT_FAILURE);
}
@@ -107,8 +107,8 @@ inspect_mount_handle (guestfs_h *g)
"If using other virt tools, multi-boot operating systems won't work\n"
"with these tools. Use the guestfish equivalent commands\n"
"(see the virt tool manual page).\n"),
program_name);
guestfs___free_string_list (roots);
guestfs_int_program_name);
guestfs_int_free_string_list (roots);
exit (EXIT_FAILURE);
}
@@ -132,7 +132,7 @@ inspect_mount_root (guestfs_h *g, const char *root)
/* Sort by key length, shortest key first, so that we end up
* mounting the filesystems in the correct order.
*/
qsort (mountpoints, guestfs___count_strings (mountpoints) / 2,
qsort (mountpoints, guestfs_int_count_strings (mountpoints) / 2,
2 * sizeof (char *),
compare_keys_len);
@@ -156,7 +156,7 @@ inspect_mount_root (guestfs_h *g, const char *root)
if (mount_errors)
fprintf (stderr, _("%s: some filesystems could not be mounted (ignored)\n"),
program_name);
guestfs_int_program_name);
}
/* This function is called only if the above function was called,
@@ -178,7 +178,7 @@ print_inspect_prompt (void)
return;
/* Sort by key. */
qsort (mountpoints, guestfs___count_strings (mountpoints) / 2,
qsort (mountpoints, guestfs_int_count_strings (mountpoints) / 2,
2 * sizeof (char *),
compare_keys);

View File

@@ -55,7 +55,7 @@ run_man (const char *cmd, size_t argc, char *argv[])
char status_string[80];
fprintf (stderr, "%s\n",
guestfs___exit_status_to_string (r, "man",
guestfs_int_exit_status_to_string (r, "man",
status_string,
sizeof status_string));
return -1;

View File

@@ -105,7 +105,7 @@ add_drives_handle (guestfs_h *g, struct drv *drv, char next_drive)
if (next_drive > 'z') {
fprintf (stderr,
_("%s: too many drives added on the command line\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -269,19 +269,19 @@ display_mountpoints_on_failure (const char *mp_device,
return;
fprintf (stderr, _("%s: '%s' could not be mounted.\n"),
program_name, mp_device);
guestfs_int_program_name, mp_device);
if (user_supplied_options)
fprintf (stderr, _("%s: Check mount(8) man page to ensure options '%s'\n"
"%s: are supported by the filesystem that is being mounted.\n"),
program_name, user_supplied_options, program_name);
guestfs_int_program_name, user_supplied_options, guestfs_int_program_name);
fprintf (stderr, _("%s: Did you mean to mount one of these filesystems?\n"),
program_name);
guestfs_int_program_name);
for (i = 0; fses[i] != NULL; i += 2) {
CLEANUP_FREE char *p = guestfs_canonical_device_name (g, fses[i]);
fprintf (stderr, "%s: \t%s (%s)\n", program_name,
fprintf (stderr, "%s: \t%s (%s)\n", guestfs_int_program_name,
p ? p : fses[i], fses[i+1]);
}
}
@@ -304,7 +304,7 @@ free_drives (struct drv *drv)
case drv_uri:
free (drv->uri.path);
free (drv->uri.protocol);
guestfs___free_string_list (drv->uri.server);
guestfs_int_free_string_list (drv->uri.server);
free (drv->uri.username);
free (drv->uri.password);
break;

View File

@@ -19,6 +19,8 @@
#ifndef OPTIONS_H
#define OPTIONS_H
#include <config.h>
#include <stdbool.h>
#include <getopt.h>
@@ -217,17 +219,16 @@ extern void display_long_options (const struct option *) __attribute__((noreturn
#define OPTION_V \
{ \
struct guestfs_version *v = guestfs_version (g); \
printf ("%s %"PRIi64".%"PRIi64".%"PRIi64"%s\n", \
program_name, \
v->major, v->minor, v->release, v->extra); \
printf ("%s %s\n", \
guestfs_int_program_name, \
PACKAGE_VERSION_FULL); \
exit (EXIT_SUCCESS); \
}
#define OPTION_w \
if (read_only) { \
fprintf (stderr, _("%s: cannot mix --ro and --rw options\n"), \
program_name); \
guestfs_int_program_name); \
exit (EXIT_FAILURE); \
}
@@ -239,7 +240,7 @@ extern void display_long_options (const struct option *) __attribute__((noreturn
if (!format_consumed) { \
fprintf (stderr, \
_("%s: --format parameter must appear before -a parameter\n"), \
program_name); \
guestfs_int_program_name); \
exit (EXIT_FAILURE); \
} \
} while (0)

View File

@@ -110,7 +110,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
uri = xmlParseURI (arg);
if (!uri) {
fprintf (stderr, _("%s: --add: could not parse URI '%s'\n"),
program_name, arg);
guestfs_int_program_name, arg);
return -1;
}
@@ -121,7 +121,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
if (uri->scheme == NULL || STREQ (uri->scheme, "")) {
/* Probably can never happen. */
fprintf (stderr, _("%s: %s: scheme of URI is NULL or empty\n"),
program_name, arg);
guestfs_int_program_name, arg);
return -1;
}
@@ -129,14 +129,14 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
if (uri->server && STRNEQ (uri->server, "") && socket) {
fprintf (stderr, _("%s: %s: cannot both a server name and a socket query parameter\n"),
program_name, arg);
guestfs_int_program_name, arg);
return -1;
}
/* Is this needed? XXX
if (socket && socket[0] != '/') {
fprintf (stderr, _("%s: --add %s: socket query parameter must be an absolute path\n"),
program_name, arg);
guestfs_int_program_name, arg);
return -1;
}
*/
@@ -162,7 +162,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
if (*password_ret == NULL) {
perror ("strdup: password");
free (*protocol_ret);
guestfs___free_string_list (*server_ret);
guestfs_int_free_string_list (*server_ret);
return -1;
}
}
@@ -173,7 +173,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
perror ("strdup: username");
free (*password_ret);
free (*protocol_ret);
guestfs___free_string_list (*server_ret);
guestfs_int_free_string_list (*server_ret);
return -1;
}
}
@@ -195,7 +195,7 @@ parse (const char *arg, char **path_ret, char **protocol_ret,
if (*path_ret == NULL) {
perror ("strdup: path");
free (*protocol_ret);
guestfs___free_string_list (*server_ret);
guestfs_int_free_string_list (*server_ret);
free (*username_ret);
free (*password_ret);
return -1;

View File

@@ -16,4 +16,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
for arg in $@; do
case $arg in
"--help")
exec man $(basename "$0")
;;
esac
done
exec guestfish --rw -i copy-in "$@"

View File

@@ -16,4 +16,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
for arg in $@; do
case $arg in
"--help")
exec man $(basename "$0")
;;
esac
done
exec guestfish --ro -i copy-out "$@"

View File

@@ -16,4 +16,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
for arg in $@; do
case $arg in
"--help")
exec man $(basename "$0")
;;
esac
done
exec guestfish --rw -i tar-in "$@"

View File

@@ -16,4 +16,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
for arg in $@; do
case $arg in
"--help")
exec man $(basename "$0")
;;
esac
done
exec guestfish --ro -i tar-out "$@"

View File

@@ -104,7 +104,7 @@ mount_drive_letter (guestfs_h *g, char drive_letter, const char *root,
guestfs_inspect_get_drive_mappings (g, root);
if (drives == NULL || drives[0] == NULL) {
fprintf (stderr, _("%s: to use Windows drive letters, this must be a Windows guest\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -118,7 +118,7 @@ mount_drive_letter (guestfs_h *g, char drive_letter, const char *root,
if (device == NULL) {
fprintf (stderr, _("%s: drive '%c:' not found.\n"),
program_name, drive_letter);
guestfs_int_program_name, drive_letter);
exit (EXIT_FAILURE);
}

View File

@@ -63,7 +63,7 @@ usage (int status)
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n%s\n"),
program_name, warning);
guestfs_int_program_name, warning);
else {
fprintf (stdout,
_("%s: erase and make a blank disk\n"
@@ -88,7 +88,7 @@ usage (int status)
"For more information, see the manpage %s(1).\n"
"\n"
"%s\n\n"),
program_name, warning, program_name, program_name,
guestfs_int_program_name, warning, guestfs_int_program_name, guestfs_int_program_name,
warning);
}
exit (status);
@@ -149,7 +149,7 @@ main (int argc, char *argv[])
filesystem = NULL;
else if (optarg[0] == '-') { /* eg: --filesystem --lvm */
fprintf (stderr, _("%s: no filesystem was specified\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
} else
filesystem = optarg;
@@ -157,7 +157,7 @@ main (int argc, char *argv[])
if (vg || lv) {
fprintf (stderr,
_("%s: --lvm option cannot be given multiple times\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
if (optarg == NULL) {
@@ -182,7 +182,7 @@ main (int argc, char *argv[])
label = optarg;
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -275,7 +275,7 @@ main (int argc, char *argv[])
"may mean there is some sort of partition table or disk\n"
"data which we are unable to remove. If you think this\n"
"is a bug, please file a bug at http://libguestfs.org/\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
}
@@ -313,7 +313,7 @@ parse_vg_lv (const char *lvm)
} else {
cannot_parse:
fprintf (stderr, _("%s: cannot parse --lvm option (%s)\n"),
program_name, lvm);
guestfs_int_program_name, lvm);
exit (EXIT_FAILURE);
}

View File

@@ -88,7 +88,7 @@ static void __attribute__((noreturn))
fuse_help (void)
{
static struct fuse_operations null_operations;
const char *tmp_argv[] = { program_name, "--help", NULL };
const char *tmp_argv[] = { guestfs_int_program_name, "--help", NULL };
fuse_main (2, (char **) tmp_argv, &null_operations, NULL);
exit (EXIT_SUCCESS);
}
@@ -98,7 +98,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: FUSE module for libguestfs\n"
@@ -131,7 +131,7 @@ usage (int status)
" -w|--rw Mount read-write\n"
" -x|--trace Trace guestfs API calls\n"
),
program_name, program_name, program_name);
guestfs_int_program_name, guestfs_int_program_name, guestfs_int_program_name);
}
exit (status);
}
@@ -245,12 +245,12 @@ main (int argc, char *argv[])
} else if (STREQ (long_options[option_index].name, "fd")) {
if (sscanf (optarg, "%d", &pipe_fd) != 1 || pipe_fd < 0) {
fprintf (stderr, _("%s: unable to parse --fd option value: %s\n"),
program_name, optarg);
guestfs_int_program_name, optarg);
exit (EXIT_FAILURE);
}
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -320,7 +320,7 @@ main (int argc, char *argv[])
if (!drvs || !(mps || inspector)) {
fprintf (stderr,
_("%s: must have at least one -a/-d and at least one -m/-i option\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
} else {
@@ -330,14 +330,14 @@ main (int argc, char *argv[])
if (read_only) {
fprintf (stderr,
_("%s: --live is not compatible with --ro option\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
if (inspector) {
fprintf (stderr,
_("%s: --live is not compatible with -i option\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -352,14 +352,14 @@ main (int argc, char *argv[])
if (count_d != 1) {
fprintf (stderr,
_("%s: with --live, you must use exactly one -d option\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
if (count_other != 0) {
fprintf (stderr,
_("%s: --live is not compatible with -a option\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
}
@@ -368,7 +368,7 @@ main (int argc, char *argv[])
if (optind+1 != argc) {
fprintf (stderr,
_("%s: you must specify a mountpoint in the host filesystem\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}

View File

@@ -332,6 +332,19 @@ a good idea if you can afford the extra memory usage.
Use these options to map all UIDs and GIDs inside the guest filesystem
to the chosen values.
=item B<-o use_ino>
Preserve inode numbers from the underlying filesystem.
Without this option, FUSE makes up its own inode numbers. The inode
numbers you see in L<stat(2)>, C<ls -i> etc aren't the inode numbers
of the underlying filesystem.
B<Note> this option is potentially dangerous if the underlying
filesystem consists of multiple mountpoints, as you may see duplicate
inode numbers appearing through FUSE. Use of this option can confuse
some software.
=back
=item B<--pid-file filename>

View File

@@ -50,7 +50,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
guestfs_int_program_name);
else {
fprintf (stdout,
_("%s: clean up a mounted filesystem\n"
@@ -66,7 +66,7 @@ usage (int status)
" -v|--verbose Verbose messages\n"
" -V|--version Display version and exit\n"
),
program_name, program_name);
guestfs_int_program_name, guestfs_int_program_name);
}
exit (status);
}
@@ -109,7 +109,7 @@ main (int argc, char *argv[])
if (STREQ (long_options[option_index].name, "fd")) {
if (sscanf (optarg, "%d", &fd) != 1 || fd < 0) {
fprintf (stderr, _("%s: cannot parse fd option '%s'\n"),
program_name, optarg);
guestfs_int_program_name, optarg);
exit (EXIT_FAILURE);
}
} else if (STREQ (long_options[option_index].name, "no-retry")) {
@@ -117,12 +117,12 @@ main (int argc, char *argv[])
} else if (STREQ (long_options[option_index].name, "retry")) {
if (sscanf (optarg, "%zu", &retries) != 1 || retries >= 64) {
fprintf (stderr, _("%s: cannot parse retries option or value is too large '%s'\n"),
program_name, optarg);
guestfs_int_program_name, optarg);
exit (EXIT_FAILURE);
}
} else {
fprintf (stderr, _("%s: unknown long option: %s (%d)\n"),
program_name, long_options[option_index].name, option_index);
guestfs_int_program_name, long_options[option_index].name, option_index);
exit (EXIT_FAILURE);
}
break;
@@ -151,7 +151,7 @@ main (int argc, char *argv[])
if (optind+1 != argc) {
fprintf (stderr,
_("%s: you must specify a mountpoint in the host filesystem\n"),
program_name);
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
@@ -206,7 +206,7 @@ main (int argc, char *argv[])
/* fusermount failed after N retries */
if (!quiet) {
fprintf (stderr, _("%s: failed to unmount %s: %s\n"),
program_name, mountpoint, error);
guestfs_int_program_name, mountpoint, error);
do_fuser (mountpoint);
}
free (error);
@@ -217,7 +217,7 @@ main (int argc, char *argv[])
not_mounted:
if (!quiet)
fprintf (stderr, _("%s: %s is not mounted: %s\n"),
program_name, mountpoint, error);
guestfs_int_program_name, mountpoint, error);
free (error);
@@ -242,6 +242,10 @@ do_fusermount (const char *mountpoint, char **error_rtn)
exit (EXIT_FAILURE);
}
if (verbose)
fprintf (stderr, "%s: running: fusermount -u %s\n",
guestfs_int_program_name, mountpoint);
pid = fork ();
if (pid == -1) {
perror ("fork");
@@ -257,7 +261,12 @@ do_fusermount (const char *mountpoint, char **error_rtn)
/* We have to parse error messages from fusermount, so ... */
setenv ("LC_ALL", "C", 1);
#ifdef __linux__
execlp ("fusermount", "fusermount", "-u", mountpoint, NULL);
#else
/* use umount where fusermount is not available */
execlp ("umount", "umount", mountpoint, NULL);
#endif
perror ("exec");
_exit (EXIT_FAILURE);
}
@@ -311,10 +320,17 @@ do_fusermount (const char *mountpoint, char **error_rtn)
}
if (!WIFEXITED (r) || WEXITSTATUS (r) != 0) {
if (verbose)
fprintf (stderr, "%s\n", buf);
*error_rtn = buf;
return 1; /* fusermount or exec failed */
}
if (verbose)
fprintf (stderr, "%s: fusermount successful\n",
guestfs_int_program_name);
free (buf);
return 0; /* fusermount successful */
}
@@ -334,7 +350,11 @@ do_fuser (const char *mountpoint)
}
if (pid == 0) { /* Child - run /sbin/fuser. */
#ifdef __linux__
execlp ("/sbin/fuser", "fuser", "-v", "-m", mountpoint, NULL);
#else
execlp ("/sbin/fuser", "fuser", "-c", mountpoint, NULL);
#endif
_exit (EXIT_FAILURE);
}

View File

@@ -61,7 +61,7 @@ pid="$(cat test.pid)"
timeout=10
# Unmount the mountpoint.
./guestunmount mp
./guestunmount -v mp
# Wait for guestmount to exit.
count=$timeout

View File

@@ -50,9 +50,9 @@ main (int argc, char *argv[])
/* Allow the test to be skipped. */
skip = getenv ("SKIP_TEST_GUESTMOUNT_FD");
if (skip && guestfs___is_true (skip) > 0) {
if (skip && guestfs_int_is_true (skip) > 0) {
fprintf (stderr, "%s: test skipped because environment variable set.\n",
program_name);
guestfs_int_program_name);
exit (77);
}
@@ -117,7 +117,7 @@ main (int argc, char *argv[])
}
if (r == 0) {
fprintf (stderr, "%s: unexpected end of file on pipe fd.\n",
program_name);
guestfs_int_program_name);
ignore_value (rmdir (MOUNTPOINT));
exit (EXIT_FAILURE);
}
@@ -125,7 +125,7 @@ main (int argc, char *argv[])
/* Check that the test image was mounted. */
if (access (TEST_FILE, R_OK) == -1) {
fprintf (stderr, "%s: test failed because test image is not mounted and ready.",
program_name);
guestfs_int_program_name);
ignore_value (rmdir (MOUNTPOINT));
exit (EXIT_FAILURE);
}
@@ -135,8 +135,8 @@ main (int argc, char *argv[])
if (r != 0) {
char status_string[80];
fprintf (stderr, "%s: test failed: %s\n", program_name,
guestfs___exit_status_to_string (r, GUESTUNMOUNT_BINARY,
fprintf (stderr, "%s: test failed: %s\n", guestfs_int_program_name,
guestfs_int_exit_status_to_string (r, GUESTUNMOUNT_BINARY,
status_string,
sizeof status_string));
ignore_value (rmdir (MOUNTPOINT));
@@ -156,8 +156,8 @@ main (int argc, char *argv[])
char status_string[80];
fprintf (stderr, "%s: test failed: %s\n",
program_name,
guestfs___exit_status_to_string (status, GUESTMOUNT_BINARY,
guestfs_int_program_name,
guestfs_int_exit_status_to_string (status, GUESTMOUNT_BINARY,
status_string,
sizeof status_string));
ignore_value (rmdir (MOUNTPOINT));

View File

@@ -83,8 +83,8 @@ main (int argc, char *argv[])
if (r != 0) {
char status_string[80];
fprintf (stderr, "%s: test failed: %s\n", program_name,
guestfs___exit_status_to_string (r, "guestunmount",
fprintf (stderr, "%s: test failed: %s\n", guestfs_int_program_name,
guestfs_int_exit_status_to_string (r, "guestunmount",
status_string,
sizeof status_string));
exit (EXIT_FAILURE);
@@ -105,8 +105,8 @@ main (int argc, char *argv[])
char status_string[80];
fprintf (stderr, "%s: test failed: guestunmount didn't return status code 2; %s\n",
program_name,
guestfs___exit_status_to_string (status, "guestunmount",
guestfs_int_program_name,
guestfs_int_exit_status_to_string (status, "guestunmount",
status_string,
sizeof status_string));
exit (EXIT_FAILURE);

View File

@@ -683,7 +683,7 @@ calls, parameters and return values are traced.
If you want to trace C API calls into libguestfs (and
other libraries) then possibly a better way is to use
the external ltrace(1) command.
the external L<ltrace(1)> command.
Command traces are disabled unless the environment variable
C<LIBGUESTFS_TRACE> is defined and set to C<1>.
@@ -813,6 +813,10 @@ to specify the QEMU interface emulation to use at run time." };
[["file_architecture"; "/initrd-x86_64.img"]], "x86_64"), [];
InitISOFS, Always, TestResultString (
[["file_architecture"; "/initrd-x86_64.img.gz"]], "x86_64"), [];
InitISOFS, Always, TestResultString (
[["file_architecture"; "/bin-x86_64-dynamic.gz"]], "x86_64"), [];
InitISOFS, Always, TestResultString (
[["file_architecture"; "/lib-i586.so.xz"]], "i386"), [];
];
shortdesc = "detect the architecture of a binary file";
longdesc = "\
@@ -2415,7 +2419,7 @@ the algorithm described in L<guestfs(3)/BLOCK DEVICE NAMING>.
=item C</dev/dm-N>
Converted to C</dev/VG/LV> form using C<guestfs_lvm_canonical_lvm_name>.
Converted to C</dev/VG/LV> form using C<guestfs_lvm_canonical_lv_name>.
=back
@@ -2700,10 +2704,10 @@ On return you get a list of strings, with a one-to-one
correspondence to the C<names> list. Each string is the
value of the symbolic link.
If the C<readlink(2)> operation fails on any name, then
If the L<readlink(2)> operation fails on any name, then
the corresponding result string is the empty string C<\"\">.
However the whole operation is completed even if there
were C<readlink(2)> errors, and so you can call this
were L<readlink(2)> errors, and so you can call this
function with names where you don't know if they are
symbolic links already (albeit slightly less efficient).
@@ -3276,7 +3280,7 @@ See L<guestfs(3)/BACKEND>, L<guestfs(3)/BACKEND SETTINGS>." };
longdesc = "\
Returns file information for the given C<path>.
This is the same as the C<stat(2)> system call." };
This is the same as the L<stat(2)> system call." };
{ defaults with
name = "lstat";
@@ -3294,7 +3298,7 @@ This is the same as C<guestfs_stat> except that if C<path>
is a symbolic link, then the link is stat-ed, not the file it
refers to.
This is the same as the C<lstat(2)> system call." };
This is the same as the L<lstat(2)> system call." };
{ defaults with
name = "c_pointer";
@@ -3310,6 +3314,34 @@ In non-C language bindings, this allows you to retrieve the underlying
C pointer to the handle (ie. C<guestfs_h *>). The purpose of this is
to allow other libraries to interwork with libguestfs." };
{ defaults with
name = "copy_in";
style = RErr, [String "localpath"; Pathname "remotedir"], [];
visibility = VPublicNoFish;
shortdesc = "copy local files or directories into an image";
longdesc = "\
C<guestfs_copy_in> copies local files or directories recursively into
the disk image, placing them in the directory called C<remotedir>
(which must exist).
Wildcards cannot be used." };
{ defaults with
name = "copy_out";
style = RErr, [Pathname "remotepath"; String "localdir"], [];
visibility = VPublicNoFish;
shortdesc = "copy remote files or directories out of an image";
longdesc = "\
C<guestfs_copy_out> copies remote files or directories recursively
out of the disk image, placing them on the host disk in a local
directory called C<localdir> (which must exist).
To download to the current directory, use C<.> as in:
C<guestfs_copy_out> /home .
Wildcards cannot be used." };
]
(* daemon_functions are any functions which cause some action
@@ -4447,7 +4479,7 @@ Returns file system statistics for any mounted file system.
C<path> should be a file or directory in the mounted file system
(typically it is the mount point itself, but it doesn't need to be).
This is the same as the C<statvfs(2)> system call." };
This is the same as the L<statvfs(2)> system call." };
{ defaults with
name = "tune2fs_l";
@@ -7612,10 +7644,10 @@ On return you get a list of strings, with a one-to-one
correspondence to the C<names> list. Each string is the
value of the symbolic link.
If the C<readlink(2)> operation fails on any name, then
If the L<readlink(2)> operation fails on any name, then
the corresponding result string is the empty string C<\"\">.
However the whole operation is completed even if there
were C<readlink(2)> errors, and so you can call this
were L<readlink(2)> errors, and so you can call this
function with names where you don't know if they are
symbolic links already (albeit slightly less efficient).
@@ -8563,6 +8595,11 @@ a file in the host and attach it as a device." };
[["part_disk"; "/dev/sda"; "mbr"];
["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""; "test-label"];
["vfs_label"; "/dev/sda1"]], "test-label"), [];
InitEmpty, IfAvailable "btrfs", TestResultString (
[["part_disk"; "/dev/sda"; "mbr"];
["mkfs"; "btrfs"; "/dev/sda1"; ""; "NOARG"; ""; ""; ""];
["set_label"; "/dev/sda1"; "test-label-btrfs"];
["vfs_label"; "/dev/sda1"]], "test-label-btrfs"), [];
];
shortdesc = "get the filesystem label";
longdesc = "\
@@ -11773,7 +11810,7 @@ to read data.
The returned boolean tells you if there are any more journal
records to read. C<true> means you can read the next record
(eg. using C<guestfs_journal_get_data>), and C<false> means you
(eg. using C<guestfs_journal_get>), and C<false> means you
have reached the end of the journal." };
{ defaults with
@@ -12024,7 +12061,7 @@ Get the realtime (wallclock) timestamp of the current journal entry." };
longdesc = "\
Returns file information for the given C<path>.
This is the same as the C<stat(2)> system call." };
This is the same as the L<stat(2)> system call." };
{ defaults with
name = "lstatns";
@@ -12042,7 +12079,7 @@ This is the same as C<guestfs_statns> except that if C<path>
is a symbolic link, then the link is stat-ed, not the file it
refers to.
This is the same as the C<lstat(2)> system call." };
This is the same as the L<lstat(2)> system call." };
{ defaults with
name = "internal_lstatnslist";
@@ -12229,7 +12266,7 @@ Destroy a quota group." };
optional = Some "btrfs"; camel_name = "BTRFSQgroupShow";
shortdesc = "show subvolume quota groups";
longdesc = "\
Show all subvolume quota groups in a btrfs filesystem, inclding their
Show all subvolume quota groups in a btrfs filesystem, including their
usages." };
{ defaults with
@@ -12369,7 +12406,7 @@ Defragment a file or directory on a btrfs filesystem. compress is one of zlib or
];
shortdesc = "recover the chunk tree of btrfs filesystem";
longdesc = "\
Recover the chunk tree of btrfs filesystem by scannning the devices one by one." };
Recover the chunk tree of btrfs filesystem by scanning the devices one by one." };
{ defaults with
name = "btrfs_rescue_super_recover";
@@ -12385,6 +12422,163 @@ Recover the chunk tree of btrfs filesystem by scannning the devices one by one."
longdesc = "\
Recover bad superblocks from good copies." };
{ defaults with
name = "part_set_gpt_guid";
style = RErr, [Device "device"; Int "partnum"; GUID "guid"], [];
proc_nr = Some 446;
optional = Some "gdisk";
tests = [
InitGPT, Always, TestLastFail (
[["part_set_gpt_guid"; "/dev/sda"; "1"; "f"]]), [];
InitGPT, Always, TestResultString (
[["part_set_gpt_guid"; "/dev/sda"; "1";
"01234567-89AB-CDEF-0123-456789ABCDEF"];
["part_get_gpt_guid"; "/dev/sda"; "1"]],
"01234567-89AB-CDEF-0123-456789ABCDEF"), [];
];
shortdesc = "set the GUID of a GPT partition";
longdesc = "\
Set the GUID of numbered GPT partition C<partnum> to C<guid>. Return an
error if the partition table of C<device> isn't GPT, or if C<guid> is not a
valid GUID." };
{ defaults with
name = "part_get_gpt_guid";
style = RString "guid", [Device "device"; Int "partnum"], [];
proc_nr = Some 447;
optional = Some "gdisk";
tests = [
InitGPT, Always, TestResultString (
[["part_set_gpt_guid"; "/dev/sda"; "1";
"01234567-89AB-CDEF-0123-456789ABCDEF"];
["part_get_gpt_guid"; "/dev/sda"; "1"]],
"01234567-89AB-CDEF-0123-456789ABCDEF"), [];
];
shortdesc = "get the GUID of a GPT partition";
longdesc = "\
Return the GUID of numbered GPT partition C<partnum>." };
{ defaults with
name = "btrfs_balance_status";
style = RStruct ("status", "btrfsbalance"), [Pathname "path"], [];
proc_nr = Some 448;
optional = Some "btrfs"; camel_name = "BTRFSBalanceStatus";
test_excuse = "test disk isn't large enough that btrfs_balance completes before we can get its status";
shortdesc = "show the status of a running or paused balance";
longdesc = "\
Show the status of a running or paused balance on a btrfs filesystem." };
{ defaults with
name = "btrfs_scrub_status";
style = RStruct ("status", "btrfsscrub"), [Pathname "path"], [];
proc_nr = Some 449;
optional = Some "btrfs"; camel_name = "BTRFSScrubStatus";
tests = [
InitPartition, Always, TestRun (
[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
["mount"; "/dev/sda1"; "/"];
["btrfs_scrub_start"; "/"];
["btrfs_scrub_status"; "/"]]), [];
];
shortdesc = "show status of running or finished scrub";
longdesc = "\
Show status of running or finished scrub on a btrfs filesystem." };
{ defaults with
name = "btrfstune_seeding";
style = RErr, [Device "device"; Bool "seeding"], [];
proc_nr = Some 450;
optional = Some "btrfs"; camel_name = "BTRFSTuneSeeding";
tests = [
InitPartition, Always, TestRun (
[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
["btrfstune_seeding"; "/dev/sda1"; "true"];
["btrfstune_seeding"; "/dev/sda1"; "false"]]), []
];
shortdesc = "enable or disable seeding of a btrfs device";
longdesc = "\
Enable seeding of a btrfs device, this will force a fs readonly
so that you can use it to build other filesystems." };
{ defaults with
name = "btrfstune_enable_extended_inode_refs";
style = RErr, [Device "device"], [];
proc_nr = Some 451;
optional = Some "btrfs"; camel_name = "BTRFSTuneEnableExtendedInodeRefs";
tests = [
InitPartition, Always, TestRun (
[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
["btrfstune_enable_extended_inode_refs"; "/dev/sda1"]]), []
];
shortdesc = "enable extended inode refs";
longdesc = "\
This will Enable extended inode refs." };
{ defaults with
name = "btrfstune_enable_skinny_metadata_extent_refs";
style = RErr, [Device "device"], [];
proc_nr = Some 452;
optional = Some "btrfs"; camel_name = "BTRFSTuneEnableSkinnyMetadataExtentRefs";
tests = [
InitPartition, Always, TestRun (
[["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
["btrfstune_enable_skinny_metadata_extent_refs"; "/dev/sda1"]]), []
];
shortdesc = "enable skinny metadata extent refs";
longdesc = "\
This enable skinny metadata extent refs." };
{ defaults with
name = "btrfs_image";
style = RErr, [DeviceList "source"; Pathname "image"], [OInt "compresslevel"];
proc_nr = Some 453;
optional = Some "btrfs"; camel_name = "BTRFSImage";
tests = [
InitPartition, Always, TestRun (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "p"; "204800"; "409599"];
["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
["mkfs_btrfs"; "/dev/sda2"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; ""; ""];
["mount"; "/dev/sda1"; "/"];
["btrfs_image"; "/dev/sda2"; "/1.img"; ""];
["btrfs_image"; "/dev/sda2"; "/2.img"; "2"]]), []
];
shortdesc = "create an image of a btrfs filesystem";
longdesc = "\
This is used to create an image of a btrfs filesystem.
All data will be zeroed, but metadata and the like is preserved." };
{ defaults with
name = "part_get_mbr_part_type";
style = RString "partitiontype", [Device "device"; Int "partnum"], [];
proc_nr = Some 454;
tests = [
InitEmpty, Always, TestResultString (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "e"; "204800"; "614400"];
["part_add"; "/dev/sda"; "l"; "204864"; "205988"];
["part_get_mbr_part_type"; "/dev/sda"; "5"]], "logical"), [];
InitEmpty, Always, TestResultString (
[["part_init"; "/dev/sda"; "mbr"];
["part_add"; "/dev/sda"; "p"; "64"; "204799"];
["part_add"; "/dev/sda"; "e"; "204800"; "614400"];
["part_add"; "/dev/sda"; "l"; "204864"; "205988"];
["part_get_mbr_part_type"; "/dev/sda"; "2"]], "extended"), []
];
shortdesc = "get the MBR partition type";
longdesc = "\
This returns the partition type of an MBR partition
numbered C<partnum> on device C<device>.
It returns C<primary>, C<logical>, or C<extended>." };
]
(* Non-API meta-commands available only in guestfish.
@@ -12744,19 +12938,19 @@ let non_daemon_functions, daemon_functions =
let all_functions = non_daemon_functions @ daemon_functions
let is_external { visibility = v } = match v with
| VPublic | VStateTest | VBindTest | VDebug -> true
| VPublic | VPublicNoFish | VStateTest | VBindTest | VDebug -> true
| VInternal -> false
let is_internal f = not (is_external f)
let is_documented { visibility = v } = match v with
| VPublic | VStateTest -> true
| VPublic | VPublicNoFish | VStateTest -> true
| VBindTest | VDebug | VInternal -> false
let is_fish { visibility = v; style = (_, args, _) } =
(* Internal functions are not exported to guestfish. *)
match v with
| VStateTest | VBindTest | VInternal -> false
| VPublicNoFish | VStateTest | VBindTest | VInternal -> false
| VPublic | VDebug ->
(* Functions that take Pointer parameters cannot be used in
* guestfish, since there is no way the user could safely

View File

@@ -46,7 +46,7 @@ let rec generate_bindtests () =
#include \"guestfs_protocol.h\"
int
guestfs__internal_test_set_output (guestfs_h *g, const char *filename)
guestfs_impl_internal_test_set_output (guestfs_h *g, const char *filename)
{
FILE *fp;
@@ -67,7 +67,7 @@ guestfs__internal_test_set_output (guestfs_h *g, const char *filename)
}
int
guestfs__internal_test_close_output (guestfs_h *g)
guestfs_impl_internal_test_close_output (guestfs_h *g)
{
if (g->test_fp != NULL) {
if (fclose (g->test_fp) == EOF) {
@@ -141,7 +141,7 @@ fill_lvm_pv (guestfs_h *g, struct guestfs_lvm_pv *pv, size_t i)
pr " */\n";
generate_prototype ~extern:false ~semicolon:false ~newline:true
~handle:"g" ~prefix:"guestfs__" ~optarg_proto:Argv name style;
~handle:"g" ~prefix:"guestfs_impl_" ~optarg_proto:Argv name style;
pr "{\n";
pr " FILE *fp = get_fp (g);\n";
pr "\n";
@@ -215,7 +215,7 @@ fill_lvm_pv (guestfs_h *g, struct guestfs_lvm_pv *pv, size_t i)
if String.sub name (String.length name - 3) 3 <> "err" then (
pr "/* Test normal return. */\n";
generate_prototype ~extern:false ~semicolon:false ~newline:true
~handle:"g" ~prefix:"guestfs__" name style;
~handle:"g" ~prefix:"guestfs_impl_" name style;
pr "{\n";
(match ret with
| RErr ->
@@ -302,7 +302,7 @@ fill_lvm_pv (guestfs_h *g, struct guestfs_lvm_pv *pv, size_t i)
) else (
pr "/* Test error return. */\n";
generate_prototype ~extern:false ~semicolon:false ~newline:true
~handle:"g" ~prefix:"guestfs__" name style;
~handle:"g" ~prefix:"guestfs_impl_" name style;
pr "{\n";
pr " error (g, \"error\");\n";
(match ret with
@@ -909,6 +909,74 @@ and generate_golang_bindtests () =
pr " return &s;\n";
pr "}\n"
and generate_php_bindtests () =
(* No header for this, as it is a .phpt file. *)
(* Unfortunately, due to the way optional arguments work in PHP,
* we cannot test arbitrary arguments skipping the previous ones
* in the function signatures.
*
* Hence, check only the non-optional arguments, and fix the
* baseline output to expect always "unset" optional arguments.
*)
pr "--TEST--\n";
pr "General PHP binding test.\n";
pr "--SKIPIF--\n";
pr "<?php\n";
pr "if (PHP_INT_SIZE < 8)\n";
pr " print 'skip 32bit platforms due to limited int in PHP';\n";
pr "?>\n";
pr "--FILE--\n";
pr "<?php\n";
pr "$g = guestfs_create ();\n";
let mkargs args =
String.concat ", " (
List.map (
function
| CallString s -> "\"" ^ s ^ "\""
| CallOptString None -> "NULL"
| CallOptString (Some s) -> sprintf "\"%s\"" s
| CallStringList xs ->
sprintf "array(%s)"
(String.concat "," (List.map (sprintf "\"%s\"") xs))
| CallInt i -> string_of_int i
| CallInt64 i -> Int64.to_string i
| CallBool b -> if b then "1" else "0"
| CallBuffer s -> "\"" ^ c_quote s ^ "\""
) args
)
in
generate_lang_bindtests (
fun f args optargs ->
pr "if (guestfs_%s ($g, %s) == false) {\n" f (mkargs args);
pr " echo (\"Call failed: \" . guestfs_last_error ($g) . \"\\n\");\n";
pr " exit;\n";
pr "}\n";
);
pr "echo (\"EOF\\n\");\n";
pr "?>\n";
pr "--EXPECT--\n";
let dump filename =
let chan = open_in filename in
let rec loop () =
let line = input_line chan in
(match string_split ":" line with
| ("obool"|"oint"|"oint64"|"ostring"|"ostringlist") as x :: _ ->
pr "%s: unset\n" x
| _ -> pr "%s\n" line
);
loop ()
in
(try loop () with End_of_file -> ());
close_in chan in
dump "bindtests"
(* Language-independent bindings tests - we do it this way to
* ensure there is parity in testing bindings across all languages.
*)

View File

@@ -45,7 +45,7 @@ let hash_matches h { name = name } =
type optarg_proto = Dots | VA | Argv
let is_public { visibility = v } = match v with
| VPublic | VStateTest | VDebug -> true
| VPublic | VPublicNoFish | VStateTest | VDebug -> true
| VBindTest | VInternal -> false
let is_private f = not (is_public f)
@@ -791,7 +791,7 @@ and generate_internal_actions_h () =
List.iter (
fun { c_name = c_name; style = style } ->
generate_prototype ~single_line:true ~newline:true ~handle:"g"
~prefix:"guestfs__" ~optarg_proto:Argv
~prefix:"guestfs_impl_" ~optarg_proto:Argv
c_name style
) non_daemon_functions;
@@ -819,9 +819,9 @@ and generate_internal_frontend_cleanups_h () =
List.iter (
fun { s_name = name } ->
pr "#define CLEANUP_FREE_%s \\\n" (String.uppercase name);
pr " __attribute__((cleanup(guestfs___cleanup_free_%s)))\n" name;
pr " __attribute__((cleanup(guestfs_int_cleanup_free_%s)))\n" name;
pr "#define CLEANUP_FREE_%s_LIST \\\n" (String.uppercase name);
pr " __attribute__((cleanup(guestfs___cleanup_free_%s_list)))\n" name
pr " __attribute__((cleanup(guestfs_int_cleanup_free_%s_list)))\n" name
) structs;
pr "#else /* !HAVE_ATTRIBUTE_CLEANUP */\n";
@@ -843,9 +843,9 @@ and generate_internal_frontend_cleanups_h () =
List.iter (
fun { s_name = name } ->
pr "extern void guestfs___cleanup_free_%s (void *ptr);\n"
pr "extern void guestfs_int_cleanup_free_%s (void *ptr);\n"
name;
pr "extern void guestfs___cleanup_free_%s_list (void *ptr);\n"
pr "extern void guestfs_int_cleanup_free_%s_list (void *ptr);\n"
name
) structs;
@@ -1192,14 +1192,14 @@ and generate_client_structs_cleanup () =
List.iter (
fun { s_name = typ } ->
pr "void\n";
pr "guestfs___cleanup_free_%s (void *ptr)\n" typ;
pr "guestfs_int_cleanup_free_%s (void *ptr)\n" typ;
pr "{\n";
pr " guestfs_free_%s (* (struct guestfs_%s **) ptr);\n" typ typ;
pr "}\n";
pr "\n";
pr "void\n";
pr "guestfs___cleanup_free_%s_list (void *ptr)\n" typ;
pr "guestfs_int_cleanup_free_%s_list (void *ptr)\n" typ;
pr "{\n";
pr " guestfs_free_%s_list (* (struct guestfs_%s_list **) ptr);\n"
typ typ;
@@ -1233,7 +1233,7 @@ and generate_client_actions hash () =
(* Generate code for enter events. *)
let enter_event shortname =
pr " guestfs___call_callbacks_message (g, GUESTFS_EVENT_ENTER,\n";
pr " guestfs_int_call_callbacks_message (g, GUESTFS_EVENT_ENTER,\n";
pr " \"%s\", %d);\n"
shortname (String.length shortname)
in
@@ -1350,7 +1350,7 @@ and generate_client_actions hash () =
List.iter (
function
| GUID n ->
pr " if (!guestfs___validate_guid (%s)) {\n" n;
pr " if (!guestfs_int_validate_guid (%s)) {\n" n;
pr " error (g, \"%%s: %%s: parameter is not a valid GUID\",\n";
pr " \"%s\", \"%s\");\n" c_name n;
let errcode =
@@ -1399,7 +1399,7 @@ and generate_client_actions hash () =
pr "\n"
);
pr " guestfs___trace_open (&trace_buffer);\n";
pr " guestfs_int_trace_open (&trace_buffer);\n";
pr " fprintf (trace_buffer.fp, \"%%s\", \"%s\");\n" name;
@@ -1441,7 +1441,7 @@ and generate_client_actions hash () =
pr " fprintf (trace_buffer.fp, \" %%\" PRIi64, %s);\n" n
| BufferIn n -> (* RHBZ#646822 *)
pr " fputc (' ', trace_buffer.fp);\n";
pr " guestfs___print_BufferIn (trace_buffer.fp, %s, %s_size);\n" n n
pr " guestfs_int_print_BufferIn (trace_buffer.fp, %s, %s_size);\n" n n
| Pointer (t, n) ->
pr " fprintf (trace_buffer.fp, \" (%s)%%p\", %s);\n" t n
) args;
@@ -1472,7 +1472,7 @@ and generate_client_actions hash () =
pr " }\n"
) optargs;
pr " guestfs___trace_send_line (g, &trace_buffer);\n";
pr " guestfs_int_trace_send_line (g, &trace_buffer);\n";
pr " }\n";
pr "\n";
in
@@ -1491,7 +1491,7 @@ and generate_client_actions hash () =
pr "\n"
);
pr "%s guestfs___trace_open (&trace_buffer);\n" indent;
pr "%s guestfs_int_trace_open (&trace_buffer);\n" indent;
pr "%s fprintf (trace_buffer.fp, \"%%s = \", \"%s\");\n" indent name;
@@ -1506,7 +1506,7 @@ and generate_client_actions hash () =
pr "%s fprintf (trace_buffer.fp, \"\\\"%%s\\\"\", %s != NULL ? %s : \"NULL\");\n"
indent rv rv
| RBufferOut _ ->
pr "%s guestfs___print_BufferOut (trace_buffer.fp, %s, *size_r);\n" indent rv
pr "%s guestfs_int_print_BufferOut (trace_buffer.fp, %s, *size_r);\n" indent rv
| RStringList _ | RHashtable _ ->
pr "%s fputs (\"[\", trace_buffer.fp);\n" indent;
pr "%s for (i = 0; %s[i]; ++i) {\n" indent rv;
@@ -1527,7 +1527,7 @@ and generate_client_actions hash () =
pr "%s fprintf (trace_buffer.fp, \"<struct guestfs_%s_list *>\");\n"
indent typ (* XXX *)
);
pr "%s guestfs___trace_send_line (g, &trace_buffer);\n" indent;
pr "%s guestfs_int_trace_send_line (g, &trace_buffer);\n" indent;
pr "%s}\n" indent;
pr "\n";
in
@@ -1537,8 +1537,8 @@ and generate_client_actions hash () =
pr "%sif (trace_flag)\n" indent;
pr "%s guestfs___trace (g, \"%%s = %%s (error)\",\n" indent;
pr "%s \"%s\", \"%s\");\n"
pr "%s guestfs_int_trace (g, \"%%s = %%s (error)\",\n" indent;
pr "%s \"%s\", \"%s\");\n"
indent name (string_of_errcode errcode)
in
@@ -1603,7 +1603,7 @@ and generate_client_actions hash () =
reject_unknown_optargs c_name style;
check_args_validity c_name style;
trace_call name c_name style;
pr " r = guestfs__%s " c_name;
pr " r = guestfs_impl_%s " c_name;
generate_c_call_args ~handle:"g" ~implicit_size_ptr:"size_r" style;
pr ";\n";
pr "\n";
@@ -1721,7 +1721,7 @@ and generate_client_actions hash () =
) args;
(* This is a daemon_function so check the appliance is up. *)
pr " if (guestfs___check_appliance_up (g, \"%s\") == -1) {\n" name;
pr " if (guestfs_int_check_appliance_up (g, \"%s\") == -1) {\n" name;
trace_return_error ~indent:4 name style errcode;
pr " return %s;\n" (string_of_errcode errcode);
pr " }\n";
@@ -1729,9 +1729,9 @@ and generate_client_actions hash () =
(* Send the main header and arguments. *)
if args_passed_to_daemon = [] && optargs = [] then (
pr " serial = guestfs___send (g, GUESTFS_PROC_%s, progress_hint, 0,\n"
pr " serial = guestfs_int_send (g, GUESTFS_PROC_%s, progress_hint, 0,\n"
(String.uppercase name);
pr " NULL, NULL);\n"
pr " NULL, NULL);\n"
) else (
List.iter (
function
@@ -1791,11 +1791,11 @@ and generate_client_actions hash () =
)
) optargs;
pr " serial = guestfs___send (g, GUESTFS_PROC_%s,\n"
pr " serial = guestfs_int_send (g, GUESTFS_PROC_%s,\n"
(String.uppercase name);
pr " progress_hint, %s,\n"
pr " progress_hint, %s,\n"
(if optargs <> [] then "optargs->bitmask" else "0");
pr " (xdrproc_t) xdr_guestfs_%s_args, (char *) &args);\n"
pr " (xdrproc_t) xdr_guestfs_%s_args, (char *) &args);\n"
name;
);
pr " if (serial == -1) {\n";
@@ -1809,11 +1809,11 @@ and generate_client_actions hash () =
List.iter (
function
| FileIn n ->
pr " r = guestfs___send_file (g, %s);\n" n;
pr " r = guestfs_int_send_file (g, %s);\n" n;
pr " if (r == -1) {\n";
trace_return_error ~indent:4 name style errcode;
pr " /* daemon will send an error reply which we discard */\n";
pr " guestfs___recv_discard (g, \"%s\");\n" name;
pr " guestfs_int_recv_discard (g, \"%s\");\n" name;
pr " return %s;\n" (string_of_errcode errcode);
pr " }\n";
pr " if (r == -2) /* daemon cancelled */\n";
@@ -1829,7 +1829,7 @@ and generate_client_actions hash () =
pr " memset (&err, 0, sizeof err);\n";
if has_ret then pr " memset (&ret, 0, sizeof ret);\n";
pr "\n";
pr " r = guestfs___recv (g, \"%s\", &hdr, &err,\n " name;
pr " r = guestfs_int_recv (g, \"%s\", &hdr, &err,\n " name;
if not has_ret then
pr "NULL, NULL"
else
@@ -1842,7 +1842,7 @@ and generate_client_actions hash () =
pr " }\n";
pr "\n";
pr " if (guestfs___check_reply_header (g, &hdr, GUESTFS_PROC_%s, serial) == -1) {\n"
pr " if (guestfs_int_check_reply_header (g, &hdr, GUESTFS_PROC_%s, serial) == -1) {\n"
(String.uppercase name);
trace_return_error ~indent:4 name style errcode;
pr " return %s;\n" (string_of_errcode errcode);
@@ -1854,14 +1854,14 @@ and generate_client_actions hash () =
pr "\n";
trace_return_error ~indent:4 name style errcode;
pr " if (err.errno_string[0] != '\\0')\n";
pr " errnum = guestfs___string_to_errno (err.errno_string);\n";
pr " errnum = guestfs_int_string_to_errno (err.errno_string);\n";
pr " if (errnum <= 0)\n";
pr " error (g, \"%%s: %%s\", \"%s\", err.error_message);\n"
name;
pr " else\n";
pr " guestfs___error_errno (g, errnum, \"%%s: %%s\", \"%s\",\n"
pr " guestfs_int_error_errno (g, errnum, \"%%s: %%s\", \"%s\",\n"
name;
pr " err.error_message);\n";
pr " err.error_message);\n";
pr " free (err.error_message);\n";
pr " free (err.errno_string);\n";
pr " return %s;\n" (string_of_errcode errcode);
@@ -1872,7 +1872,7 @@ and generate_client_actions hash () =
List.iter (
function
| FileOut n ->
pr " if (guestfs___recv_file (g, %s) == -1) {\n" n;
pr " if (guestfs_int_recv_file (g, %s) == -1) {\n" n;
trace_return_error ~indent:4 name style errcode;
pr " return %s;\n" (string_of_errcode errcode);
pr " }\n";
@@ -2178,10 +2178,10 @@ and generate_linker_script () =
(* Unofficial parts of the API: the bindings code use these
* functions, so it is useful to export them.
*)
"guestfs___safe_calloc";
"guestfs___safe_malloc";
"guestfs___safe_strdup";
"guestfs___safe_memdup";
"guestfs_int_safe_calloc";
"guestfs_int_safe_malloc";
"guestfs_int_safe_strdup";
"guestfs_int_safe_memdup";
] in
let functions =
List.flatten (

View File

@@ -85,6 +85,27 @@ as if they were specified as I<--delete /some/file> on the command
line.";
};
{ op_name = "copy";
op_type = StringPair "SOURCE:DEST";
op_discrim = "`Copy";
op_shortdesc = "Copy files in disk image";
op_pod_longdesc = "\
Copy files or directories recursively inside the guest.
Wildcards cannot be used.";
};
{ op_name = "copy-in";
op_type = StringPair "LOCALPATH:REMOTEDIR";
op_discrim = "`CopyIn";
op_shortdesc = "Copy local files or directories into image";
op_pod_longdesc = "\
Copy local files or directories recursively into the disk image,
placing them in the directory C<REMOTEDIR> (which must exist).
Wildcards cannot be used.";
};
{ op_name = "delete";
op_type = String "PATH";
op_discrim = "`Delete";
@@ -201,6 +222,16 @@ This uses S<C<mkdir -p>> so any intermediate directories are created,
and it also works if the directory already exists.";
};
{ op_name = "move";
op_type = StringPair "SOURCE:DEST";
op_discrim = "`Move";
op_shortdesc = "Move files in disk image";
op_pod_longdesc = "\
Move files or directories inside the guest.
Wildcards cannot be used.";
};
{ op_name = "password";
op_type = UserPasswordSelector "USER:SELECTOR";
op_discrim = "`Password";
@@ -306,6 +337,23 @@ You can have multiple I<--ssh-inject> options, for different users
and also for more keys for each user."
};
{ op_name = "truncate";
op_type = String "FILE";
op_discrim = "`Truncate";
op_shortdesc = "Truncate a file to zero size";
op_pod_longdesc = "\
This command truncates \"path\" to a zero-length file. The file must exist
already.";
};
{ op_name = "truncate-recursive";
op_type = String "PATH";
op_discrim = "`TruncateRecursive";
op_shortdesc = "Recursively truncate all files in directory";
op_pod_longdesc = "\
This command recursively truncates all files under \"path\" to zero-length.";
};
{ op_name = "timezone";
op_type = String "TIMEZONE";
op_discrim = "`Timezone";
@@ -683,6 +731,7 @@ pr " ] in
(match spec with
| Arg.Unit fn -> fn ()
| Arg.String fn -> fn arg
| Arg.Set varref -> varref := true
| _ -> error \"INTERNAL error: spec not handled for %%s\" cmd
)
with Not_found ->

View File

@@ -397,7 +397,7 @@ extern int64_t get_int64 (ETERM *term);
let uc_n = String.uppercase n in
pr " if ((optargs_s.bitmask & %s_%s_BITMASK))\n"
c_optarg_prefix uc_n;
pr " guestfs___free_string_list ((char **) optargs_s.%s);\n" n
pr " guestfs_int_free_string_list ((char **) optargs_s.%s);\n" n
) optargs;
(match errcode_of_ret ret with
@@ -430,7 +430,7 @@ extern int64_t get_int64 (ETERM *term);
pr " return rt;\n"
| RStringList _ ->
pr " ETERM *rt = make_string_list (r);\n";
pr " guestfs___free_string_list (r);\n\n";
pr " guestfs_int_free_string_list (r);\n\n";
pr " return rt;\n"
| RStruct (_, typ) ->
pr " ETERM *rt = make_%s (r);\n" typ;
@@ -442,7 +442,7 @@ extern int64_t get_int64 (ETERM *term);
pr " return rt;\n"
| RHashtable _ ->
pr " ETERM *rt = make_table (r);\n";
pr " guestfs___free_string_list (r);\n";
pr " guestfs_int_free_string_list (r);\n";
pr " return rt;\n"
| RBufferOut _ ->
pr " ETERM *rt = erl_mk_estring (r, size);\n";

View File

@@ -216,7 +216,7 @@ let generate_errnostring_h () =
*
* NOTE: It is an error to call this function with errnum == 0.
*/
extern const char *guestfs___errno_to_string (int errnum);
extern const char *guestfs_int_errno_to_string (int errnum);
/* Convert string representation of an error (eg. \"EIO\") to the errno
* value (EIO). As for the function above, this only works for a
@@ -224,11 +224,11 @@ extern const char *guestfs___errno_to_string (int errnum);
* system, EINVAL is returned (all POSIX-conforming systems must
* support EINVAL).
*/
extern int guestfs___string_to_errno (const char *errnostr);
extern int guestfs_int_string_to_errno (const char *errnostr);
/* Private structure and function used by the perfect hash implementation. */
struct errnostring_entry { char *name; int errnum; };
extern const struct errnostring_entry *guestfs___string_to_errno_lookup (register const char *str, register unsigned int len);
extern const struct errnostring_entry *guestfs_int_string_to_errno_lookup (register const char *str, register unsigned int len);
#endif /* GUESTFS_ERRNOSTRING_H_ */
"
@@ -262,7 +262,7 @@ static const char *errno_to_string[] = {
(sizeof errno_to_string / sizeof errno_to_string[0])
const char *
guestfs___errno_to_string (int errnum)
guestfs_int_errno_to_string (int errnum)
{
/* See function documentation. */
if (errnum == 0)
@@ -276,10 +276,10 @@ guestfs___errno_to_string (int errnum)
}
int
guestfs___string_to_errno (const char *errnostr)
guestfs_int_string_to_errno (const char *errnostr)
{
const struct errnostring_entry *v =
guestfs___string_to_errno_lookup (errnostr, strlen (errnostr));
guestfs_int_string_to_errno_lookup (errnostr, strlen (errnostr));
if (v /* not necessary to check v->name != NULL here */)
return v->errnum;
else
@@ -292,7 +292,7 @@ let generate_errnostring_gperf () =
pr "\
%%language=ANSI-C
%%define lookup-function-name guestfs___string_to_errno_lookup
%%define lookup-function-name guestfs_int_string_to_errno_lookup
%%readonly-tables
%%null-strings
@@ -312,7 +312,7 @@ let generate_errnostring_gperf () =
* we are going to include E_ macros directly in the C output of
* gperf. To avoid this causing errors, we include macros to define
* unknown errors as EINVAL (see specification of
* guestfs___string_to_errno above). Note this only affects the
* guestfs_int_string_to_errno above). Note this only affects the
* single output file containing gperf-generated code.
*)
List.iter (

View File

@@ -472,11 +472,11 @@ Guestfish will prompt for these separately."
pr " input_lineno++;\n";
pr " if (%s == NULL) goto out_%s;\n" name name
| Bool name ->
pr " switch (guestfs___is_true (argv[i++])) {\n";
pr " switch (guestfs_int_is_true (argv[i++])) {\n";
pr " case -1:\n";
pr " fprintf (stderr,\n";
pr " _(\"%%s: '%%s': invalid boolean value, use 'true' or 'false'\\n\"),\n";
pr " program_name, argv[i-1]);\n";
pr " guestfs_int_program_name, argv[i-1]);\n";
pr " goto out_%s;\n" name;
pr " case 0: %s = 0; break;\n" name;
pr " default: %s = 1;\n" name;
@@ -515,11 +515,11 @@ Guestfish will prompt for these separately."
pr "if (STRPREFIX (argv[i], \"%s:\")) {\n" n;
(match argt with
| OBool n ->
pr " switch (guestfs___is_true (&argv[i][%d])) {\n" (len+1);
pr " switch (guestfs_int_is_true (&argv[i][%d])) {\n" (len+1);
pr " case -1:\n";
pr " fprintf (stderr,\n";
pr " _(\"%%s: '%%s': invalid boolean value, use 'true' or 'false'\\n\"),\n";
pr " program_name, &argv[i][%d]);\n" (len+1);
pr " guestfs_int_program_name, &argv[i][%d]);\n" (len+1);
pr " goto out;\n";
pr " case 0: optargs_s.%s = 0; break;\n" n;
pr " default: optargs_s.%s = 1;\n" n;
@@ -620,7 +620,7 @@ Guestfish will prompt for these separately."
pr " if (r == NULL) goto out;\n";
pr " ret = 0;\n";
pr " print_strings (r);\n";
pr " guestfs___free_string_list (r);\n"
pr " guestfs_int_free_string_list (r);\n"
| RStruct (_, typ) ->
pr " if (r == NULL) goto out;\n";
pr " ret = 0;\n";
@@ -635,7 +635,7 @@ Guestfish will prompt for these separately."
pr " if (r == NULL) goto out;\n";
pr " ret = 0;\n";
pr " print_table (r);\n";
pr " guestfs___free_string_list (r);\n"
pr " guestfs_int_free_string_list (r);\n"
| RBufferOut _ ->
pr " if (r == NULL) goto out;\n";
pr " if (full_write (1, r, size) != size) {\n";
@@ -658,7 +658,7 @@ Guestfish will prompt for these separately."
pr " if ((optargs_s.bitmask & %s_%s_BITMASK) &&\n"
c_optarg_prefix uc_n;
pr " optargs_s.%s != NULL)\n" n;
pr " guestfs___free_string_list ((char **) optargs_s.%s);\n" n
pr " guestfs_int_free_string_list ((char **) optargs_s.%s);\n" n
| OBool _ | OInt _ | OInt64 _ | OString _ -> ()
) (List.rev optargs);
List.iter (
@@ -678,7 +678,7 @@ Guestfish will prompt for these separately."
pr " free_file_in (%s);\n" name;
pr " out_%s:\n" name
| StringList name | DeviceList name ->
pr " guestfs___free_string_list (%s);\n" name;
pr " guestfs_int_free_string_list (%s);\n" name;
pr " out_%s:\n" name
| Pointer _ -> assert false
) (List.rev args);

View File

@@ -961,7 +961,8 @@ guestfs_session_close (GuestfsSession *session, GError **err)
fun ({ name = name; style = (ret, args, optargs as style);
cancellable = cancellable; c_function = c_function;
c_optarg_prefix = c_optarg_prefix;
shortdesc = shortdesc; longdesc = longdesc } as f) ->
shortdesc = shortdesc; longdesc = longdesc;
deprecated_by = deprecated_by } as f) ->
pr "\n";
let longdesc = Str.global_substitute urls (
@@ -1103,6 +1104,11 @@ guestfs_session_close (GuestfsSession *session, GError **err)
pr "(transfer full) (array zero-terminated=1) (element-type Guestfs%s): an array of %s objects, or NULL on error" name name
);
pr "\n";
(match deprecated_by with
| None -> ()
| Some alt ->
pr " * Deprecated: In new code, use guestfs_session_%s() instead\n" alt
);
pr " */\n";
(* The function body *)

View File

@@ -41,19 +41,21 @@ import java.util.HashMap;
import java.util.Map;
/**
* <p>
* Libguestfs handle.
* <p>
* </p><p>
* The <code>GuestFS</code> object corresponds to a libguestfs handle.
* <p>
* </p><p>
* Note that the main documentation for the libguestfs API is in
* the following man pages:
* <p>
* </p>
* <ol>
* <li> <a href=\"http://libguestfs.org/guestfs-java.3.html\"><code>guestfs-java(3)</code></a> and </li>
* <li> <a href=\"http://libguestfs.org/guestfs.3.html\"><code>guestfs(3)</code></a>. </li>
* </ol>
* <p>
* This javadoc is <b>not</b> a good introduction to using libguestfs.
* </p>
*
* @author rjones
*/
@@ -109,13 +111,15 @@ public class GuestFS {
private native long _create (int flags) throws LibGuestFSException;
/**
* <p>
* Close a libguestfs handle.
*
* </p><p>
* You can also leave handles to be collected by the garbage
* collector, but this method ensures that the resources used
* by the handle are freed up immediately. If you call any
* other methods after closing the handle, you will get an
* exception.
* </p>
*
* @throws LibGuestFSException
*/
@@ -152,7 +156,12 @@ public class GuestFS {
pr "\n";
pr "\
/** Utility function to turn an event number or bitmask into a string. */
/**
* Utility function to turn an event number or bitmask into a string.
*
* @param events the event number to convert
* @return text representation of event
*/
public static String eventToString (long events)
{
return _event_to_string (events);
@@ -161,15 +170,17 @@ public class GuestFS {
private static native String _event_to_string (long events);
/**
* Set an event handler.
* <p>
* Set an event handler.
* </p><p>
* Set an event handler (<code>callback</code>) which is called when any
* event from the set (<code>events</code>) is raised by the API.
* <code>events</code> is one or more <code>EVENT_*</code> constants,
* bitwise ORed together.
* <p>
* </p><p>
* When an event happens, the callback object's <code>event</code> method
* is invoked like this:
* </p>
* <pre>
* callback.event (event, // the specific event which fired (long)
* eh, // the event handle (int)
@@ -177,17 +188,20 @@ public class GuestFS {
* array // event data (long[])
* );
* </pre>
* <p>
* Note that you can pass arbitrary data from the main program to the
* callback by putting it into your {@link EventCallback callback object},
* then accessing it in the callback via <code>this</code>.
* <p>
* </p><p>
* This function returns an event handle which may be used to delete
* the event. Note that event handlers are deleted automatically when
* the libguestfs handle is closed.
* </p>
*
* @throws LibGuestFSException
* @see The section \"EVENTS\" in the guestfs(3) manual
* @see \"The section &quot;EVENTS&quot; in the guestfs(3) manual\"
* @see #delete_event_callback
* @return handle for the event
*/
public int set_event_callback (EventCallback callback, long events)
throws LibGuestFSException
@@ -203,14 +217,16 @@ public class GuestFS {
throws LibGuestFSException;
/**
* Delete an event handler.
* <p>
* Delete an event handler.
* </p><p>
* Delete a previously registered event handler. The 'eh' parameter is
* the event handle returned from a previous call to
* {@link #set_event_callback set_event_callback}.
* <p>
* </p><p>
* Note that event handlers are deleted automatically when the
* libguestfs handle is closed.
* </p>
*
* @throws LibGuestFSException
* @see #set_event_callback
@@ -243,27 +259,34 @@ public class GuestFS {
if f.protocol_limit_warning then
doc ^ "\n\n" ^ protocol_limit_warning
else doc in
let doc =
match deprecation_notice f with
| None -> doc
| Some txt -> doc ^ "\n\n" ^ txt in
let doc = pod2text ~width:60 f.name doc in
let doc = List.map ( (* RHBZ#501883 *)
function
| "" -> "<p>"
| nonempty -> nonempty
| "" -> "</p><p>"
| nonempty -> html_escape nonempty
) doc in
let doc = String.concat "\n * " doc in
pr " /**\n";
pr " * %s\n" f.shortdesc;
pr " * <p>\n";
pr " * %s\n" f.shortdesc;
pr " * </p><p>\n";
pr " * %s\n" doc;
pr " * </p>\n";
(match f with
| { deprecated_by = None } -> ()
| { deprecated_by = Some alt } ->
pr " * @deprecated In new code, use {@link #%s} instead\n" alt
);
pr " * @throws LibGuestFSException\n";
pr " */\n";
);
pr " ";
generate_java_prototype ~public:true ~semicolon:false f.name f.style;
let deprecated =
match f with
| { deprecated_by = None } -> false
| { deprecated_by = Some _ } -> true in
generate_java_prototype ~public:true ~semicolon:false ~deprecated f.name f.style;
pr "\n";
pr " {\n";
pr " if (g == 0)\n";
@@ -404,7 +427,8 @@ and generate_java_call_args ~handle (_, args, optargs) =
pr ")"
and generate_java_prototype ?(public=false) ?(privat=false) ?(native=false)
?(semicolon=true) name (ret, args, optargs) =
?(semicolon=true) ?(deprecated=false) name (ret, args, optargs) =
if deprecated then pr "@Deprecated ";
if privat then pr "private ";
if public then pr "public ";
if native then pr "native ";
@@ -689,7 +713,7 @@ Java_com_redhat_et_libguestfs_GuestFS__1set_1event_1callback
return -1;
}
data = guestfs___safe_malloc (g, sizeof *data);
data = guestfs_int_safe_malloc (g, sizeof *data);
(*env)->GetJavaVM (env, &data->jvm);
data->method = method;
@@ -768,7 +792,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
}
/* Copy them into the return array. */
r = guestfs___safe_malloc (g, sizeof (struct callback_data *) * (*len_rtn));
r = guestfs_int_safe_malloc (g, sizeof (struct callback_data *) * (*len_rtn));
i = 0;
data = guestfs_first_private (g, &key);
@@ -953,7 +977,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
pr " %s_size = (*env)->GetArrayLength (env, j%s);\n" n n
| StringList n | DeviceList n ->
pr " %s_len = (*env)->GetArrayLength (env, j%s);\n" n n;
pr " %s = guestfs___safe_malloc (g, sizeof (char *) * (%s_len+1));\n" n n;
pr " %s = guestfs_int_safe_malloc (g, sizeof (char *) * (%s_len+1));\n" n n;
pr " for (i = 0; i < %s_len; ++i) {\n" n;
pr " jobject o = (*env)->GetObjectArrayElement (env, j%s, i);\n"
n;
@@ -979,7 +1003,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
n n
| OStringList n ->
pr " %s_len = (*env)->GetArrayLength (env, j%s);\n" n n;
pr " %s = guestfs___safe_malloc (g, sizeof (char *) * (%s_len+1));\n" n n;
pr " %s = guestfs_int_safe_malloc (g, sizeof (char *) * (%s_len+1));\n" n n;
pr " for (i = 0; i < %s_len; ++i) {\n" n;
pr " jobject o = (*env)->GetObjectArrayElement (env, j%s, i);\n"
n;

View File

@@ -604,10 +604,10 @@ guestfs_lua_delete_event_callback (lua_State *L)
pr " free (r);\n"
| RStringList _ ->
pr " push_string_list (L, r);\n";
pr " guestfs___free_string_list (r);\n"
pr " guestfs_int_free_string_list (r);\n"
| RHashtable _ ->
pr " push_table (L, r);\n";
pr " guestfs___free_string_list (r);\n"
pr " guestfs_int_free_string_list (r);\n"
| RStruct (_, typ) ->
pr " push_%s (L, r);\n" typ;
pr " guestfs_free_%s (r);\n" typ

View File

@@ -160,6 +160,7 @@ Run it from the top source directory using the command
output_to "csharp/Libguestfs.cs" generate_csharp;
output_to "php/extension/php_guestfs_php.h" generate_php_h;
output_to "php/extension/guestfs_php.c" generate_php_c;
output_to "php/extension/tests/guestfs_php_bindtests.phpt" generate_php_bindtests;
output_to "erlang/guestfs.erl" generate_erlang_erl;
output_to "erlang/erl-guestfs.c" generate_erlang_c;
output_to ~perm:0o555 "erlang/bindtests.erl" generate_erlang_bindtests;

View File

@@ -133,6 +133,7 @@ val last_errno : t -> int
module Errno : sig
val errno_ENOTSUP : int
val errno_EPERM : int
val errno_ESRCH : int
end
@@ -144,9 +145,14 @@ end
fun ({ name = name; style = style; deprecated_by = deprecated_by;
non_c_aliases = non_c_aliases;
shortdesc = shortdesc } as f) ->
let need_doc = is_documented f in
if not need_doc then
pr "(**/**)\n";
generate_ocaml_prototype name style;
if is_documented f then (
if need_doc then (
pr "(** %s" shortdesc;
(match deprecated_by with
| None -> ()
@@ -155,14 +161,18 @@ end
);
pr " *)\n";
);
pr "\n";
(* Aliases. *)
List.iter (
fun alias ->
generate_ocaml_prototype alias style;
pr "\n";
generate_ocaml_prototype alias style;
) non_c_aliases;
if not need_doc then
pr "(**/**)\n";
pr "\n";
) external_functions_sorted;
pr "\
@@ -267,6 +277,8 @@ external last_errno : t -> int = \"ocaml_guestfs_last_errno\"
module Errno = struct
external enotsup : unit -> int = \"ocaml_guestfs_get_ENOTSUP\" \"noalloc\"
let errno_ENOTSUP = enotsup ()
external eperm : unit -> int = \"ocaml_guestfs_get_EPERM\" \"noalloc\"
let errno_EPERM = eperm ()
external esrch : unit -> int = \"ocaml_guestfs_get_ESRCH\" \"noalloc\"
let errno_ESRCH = esrch ()
end
@@ -522,14 +534,14 @@ copy_table (char * const * argv)
| Key n
| GUID n ->
(* Copy strings in case the GC moves them: RHBZ#604691 *)
pr " char *%s = guestfs___safe_strdup (g, String_val (%sv));\n" n n
pr " char *%s = guestfs_int_safe_strdup (g, String_val (%sv));\n" n n
| OptString n ->
pr " char *%s =\n" n;
pr " %sv != Val_int (0) ?\n" n;
pr " guestfs___safe_strdup (g, String_val (Field (%sv, 0))) : NULL;\n" n
pr " guestfs_int_safe_strdup (g, String_val (Field (%sv, 0))) : NULL;\n" n
| BufferIn n ->
pr " size_t %s_size = caml_string_length (%sv);\n" n n;
pr " char *%s = guestfs___safe_memdup (g, String_val (%sv), %s_size);\n" n n n
pr " char *%s = guestfs_int_safe_memdup (g, String_val (%sv), %s_size);\n" n n n
| StringList n | DeviceList n ->
pr " char **%s = ocaml_guestfs_strings_val (g, %sv);\n" n n
| Bool n ->
@@ -558,7 +570,7 @@ copy_table (char * const * argv)
| OInt _ -> pr "Int_val (Field (%sv, 0))" n
| OInt64 _ -> pr "Int64_val (Field (%sv, 0))" n
| OString _ ->
pr "guestfs___safe_strdup (g, String_val (Field (%sv, 0)))" n
pr "guestfs_int_safe_strdup (g, String_val (Field (%sv, 0)))" n
| OStringList n ->
pr "ocaml_guestfs_strings_val (g, Field (%sv, 0))\n" n
);
@@ -608,7 +620,7 @@ copy_table (char * const * argv)
| Key n | GUID n ->
pr " free (%s);\n" n
| StringList n | DeviceList n ->
pr " guestfs___free_string_list (%s);\n" n;
pr " guestfs_int_free_string_list (%s);\n" n;
| Bool _ | Int _ | Int64 _ | Pointer _ -> ()
) args;
List.iter (
@@ -619,7 +631,7 @@ copy_table (char * const * argv)
pr " free ((char *) optargs_s.%s);\n" n
| OStringList n ->
pr " if (%sv != Val_int (0))\n" n;
pr " guestfs___free_string_list ((char **) optargs_s.%s);\n" n;
pr " guestfs_int_free_string_list ((char **) optargs_s.%s);\n" n;
) optargs;
(match errcode_of_ret ret with

View File

@@ -176,7 +176,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
}
/* Copy them into the return array. */
r = guestfs___safe_malloc (g, sizeof (SV *) * (*len_rtn));
r = guestfs_int_safe_malloc (g, sizeof (SV *) * (*len_rtn));
i = 0;
cb = guestfs_first_private (g, &key);
@@ -476,7 +476,7 @@ PREINIT:
pr " /* Note av_len returns index of final element. */\n";
pr " len = av_len (av) + 1;\n";
pr "\n";
pr " r = guestfs___safe_malloc (g, (len+1) * sizeof (char *));\n";
pr " r = guestfs_int_safe_malloc (g, (len+1) * sizeof (char *));\n";
pr " for (i = 0; i < len; ++i) {\n";
pr " svp = av_fetch (av, i, 0);\n";
pr " r[i] = SvPV_nolen (*svp);\n";

View File

@@ -91,6 +91,46 @@ and generate_php_c () =
static int res_guestfs_h;
/* Convert array to list of strings.
* http://marc.info/?l=pecl-dev&m=112205192100631&w=2
*/
static char**
get_stringlist (zval *val)
{
char **ret;
HashTable *a;
int n;
HashPosition p;
zval **d;
size_t c = 0;
a = Z_ARRVAL_P (val);
n = zend_hash_num_elements (a);
ret = safe_emalloc (n + 1, sizeof (char *), 0);
for (zend_hash_internal_pointer_reset_ex (a, &p);
zend_hash_get_current_data_ex (a, (void **) &d, &p) == SUCCESS;
zend_hash_move_forward_ex (a, &p)) {
zval t = **d;
zval_copy_ctor (&t);
convert_to_string (&t);
ret[c] = estrndup (Z_STRVAL(t), Z_STRLEN (t));
zval_dtor (&t);
c++;
}
ret[c] = NULL;
return ret;
}
static void
guestfs_efree_stringlist (char **p)
{
size_t c = 0;
for (c = 0; p[c] != NULL; ++c)
efree (p[c]);
efree (p);
}
static void
guestfs_php_handle_dtor (zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
@@ -192,11 +232,13 @@ PHP_FUNCTION (guestfs_last_error)
| String n | Device n | Mountable n | Pathname n
| Dev_or_Path n | Mountable_or_Path n
| FileIn n | FileOut n | Key n
| OptString n
| BufferIn n
| GUID n ->
pr " char *%s;\n" n;
pr " int %s_size;\n" n
| OptString n ->
pr " char *%s = NULL;\n" n;
pr " int %s_size;\n" n
| StringList n
| DeviceList n ->
pr " zval *z_%s;\n" n;
@@ -310,7 +352,7 @@ PHP_FUNCTION (guestfs_last_error)
| String n | Device n | Mountable n | Pathname n
| Dev_or_Path n | Mountable_or_Path n
| FileIn n | FileOut n | Key n
| OptString n | GUID n ->
| GUID n ->
(* Just need to check the string doesn't contain any ASCII
* NUL characters, which won't be supported by the C API.
*)
@@ -319,33 +361,19 @@ PHP_FUNCTION (guestfs_last_error)
pr " RETURN_FALSE;\n";
pr " }\n";
pr "\n"
| OptString n ->
(* Just need to check the string doesn't contain any ASCII
* NUL characters, which won't be supported by the C API.
*)
pr " if (%s != NULL && strlen (%s) != %s_size) {\n" n n n;
pr " fprintf (stderr, \"libguestfs: %s: parameter '%s' contains embedded ASCII NUL.\\n\");\n" shortname n;
pr " RETURN_FALSE;\n";
pr " }\n";
pr "\n"
| BufferIn n -> ()
| StringList n
| DeviceList n ->
(* Convert array to list of strings.
* http://marc.info/?l=pecl-dev&m=112205192100631&w=2
*)
pr " {\n";
pr " HashTable *a;\n";
pr " int n;\n";
pr " HashPosition p;\n";
pr " zval **d;\n";
pr " size_t c = 0;\n";
pr "\n";
pr " a = Z_ARRVAL_P (z_%s);\n" n;
pr " n = zend_hash_num_elements (a);\n";
pr " %s = safe_emalloc (n + 1, sizeof (char *), 0);\n" n;
pr " for (zend_hash_internal_pointer_reset_ex (a, &p);\n";
pr " zend_hash_get_current_data_ex (a, (void **) &d, &p) == SUCCESS;\n";
pr " zend_hash_move_forward_ex (a, &p)) {\n";
pr " zval t = **d;\n";
pr " zval_copy_ctor (&t);\n";
pr " convert_to_string (&t);\n";
pr " %s[c] = Z_STRVAL (t);\n" n;
pr " c++;\n";
pr " }\n";
pr " %s[c] = NULL;\n" n;
pr " }\n";
pr " %s = get_stringlist (z_%s);\n" n n;
pr "\n"
| Bool _ | Int _ | Int64 _ -> ()
| Pointer (t, n) ->
@@ -380,28 +408,7 @@ PHP_FUNCTION (guestfs_last_error)
pr " * positively check that it gave us an array, otherwise ignore it.\n";
pr " */\n";
pr " if (optargs_t_%s != NULL && Z_TYPE_P (optargs_t_%s) == IS_ARRAY) {\n" n n;
pr " char **r;\n";
pr " HashTable *a;\n";
pr " int n;\n";
pr " HashPosition p;\n";
pr " zval **d;\n";
pr " size_t c = 0;\n";
pr "\n";
pr " a = Z_ARRVAL_P (optargs_t_%s);\n" n;
pr " n = zend_hash_num_elements (a);\n";
pr " r = safe_emalloc (n + 1, sizeof (char *), 0);\n";
pr " for (zend_hash_internal_pointer_reset_ex (a, &p);\n";
pr " zend_hash_get_current_data_ex (a, (void **) &d, &p) == SUCCESS;\n";
pr " zend_hash_move_forward_ex (a, &p)) {\n";
pr " zval t = **d;\n";
pr " zval_copy_ctor (&t);\n";
pr " convert_to_string (&t);\n";
pr " r[c] = Z_STRVAL (t);\n";
pr " c++;\n";
pr " }\n";
pr " r[c] = NULL;\n";
pr "\n";
pr " optargs_s.%s = r;\n" n;
pr " optargs_s.%s = get_stringlist (optargs_t_%s);\n" n n;
pr " optargs_s.bitmask |= %s_%s_BITMASK;\n" c_optarg_prefix uc_n;
pr " }\n";
) optargs;
@@ -447,16 +454,20 @@ PHP_FUNCTION (guestfs_last_error)
| BufferIn n -> ()
| StringList n
| DeviceList n ->
pr " {\n";
pr " size_t c = 0;\n";
pr "\n";
pr " for (c = 0; %s[c] != NULL; ++c)\n" n;
pr " efree (%s[c]);\n" n;
pr " efree (%s);\n" n;
pr " }\n";
pr " guestfs_efree_stringlist (%s);\n" n;
pr "\n"
| Bool _ | Int _ | Int64 _ | Pointer _ -> ()
) args;
List.iter (
function
| OBool n | OInt n | OInt64 n | OString n -> ()
| OStringList n ->
let uc_n = String.uppercase n in
pr " if ((optargs_s.bitmask & %s_%s_BITMASK) != 0)\n"
c_optarg_prefix uc_n;
pr " guestfs_efree_stringlist ((char **) optargs_s.%s);\n" n;
pr "\n"
) optargs;
(* Check for errors. *)
(match errcode_of_ret ret with

View File

@@ -455,7 +455,8 @@ put_table (char * const * const argv)
pr " py_r = PyString_FromString (r);\n";
pr "#else\n";
pr " py_r = PyUnicode_FromString (r);\n";
pr "#endif\n"
pr "#endif\n";
pr " if (py_r == NULL) goto out;\n";
| RConstOptString _ ->
pr " if (r) {\n";
pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
@@ -466,17 +467,19 @@ put_table (char * const * const argv)
pr " } else {\n";
pr " Py_INCREF (Py_None);\n";
pr " py_r = Py_None;\n";
pr " }\n"
pr " }\n";
pr " if (py_r == NULL) goto out;\n";
| RString _ ->
pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
pr " py_r = PyString_FromString (r);\n";
pr "#else\n";
pr " py_r = PyUnicode_FromString (r);\n";
pr "#endif\n";
pr " free (r);\n"
pr " free (r);\n";
pr " if (py_r == NULL) goto out;\n";
| RStringList _ ->
pr " py_r = put_string_list (r);\n";
pr " guestfs___free_string_list (r);\n"
pr " guestfs_int_free_string_list (r);\n"
| RStruct (_, typ) ->
pr " py_r = put_%s (r);\n" typ;
pr " guestfs_free_%s (r);\n" typ
@@ -485,17 +488,25 @@ put_table (char * const * const argv)
pr " guestfs_free_%s_list (r);\n" typ
| RHashtable n ->
pr " py_r = put_table (r);\n";
pr " guestfs___free_string_list (r);\n"
pr " guestfs_int_free_string_list (r);\n"
| RBufferOut _ ->
pr "#ifdef HAVE_PYSTRING_ASSTRING\n";
pr " py_r = PyString_FromStringAndSize (r, size);\n";
pr "#else\n";
pr " py_r = PyBytes_FromStringAndSize (r, size);\n";
pr "#endif\n";
pr " free (r);\n"
pr " free (r);\n";
pr " if (py_r == NULL) goto out;\n";
);
(* As this is the non-error path, clear the Python error
* indicator flag in case it was set accidentally somewhere in
* the function. Since we are not returning an error indication
* to the caller, having it set would risk the error popping up
* at random later in the interpreter.
*)
pr "\n";
pr " PyErr_Clear ();\n";
pr " out:\n";
List.iter (

View File

@@ -274,7 +274,7 @@ ruby_set_event_callback (VALUE gv, VALUE cbv, VALUE event_bitmaskv)
event_bitmask = NUM2ULL (event_bitmaskv);
root = guestfs___safe_malloc (g, sizeof *root);
root = guestfs_int_safe_malloc (g, sizeof *root);
*root = cbv;
eh = guestfs_set_event_callback (g, ruby_event_callback_wrapper,
@@ -445,7 +445,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
}
/* Copy them into the return array. */
r = guestfs___safe_malloc (g, sizeof (VALUE *) * (*len_rtn));
r = guestfs_int_safe_malloc (g, sizeof (VALUE *) * (*len_rtn));
i = 0;
root = guestfs_first_private (g, &key);

View File

@@ -340,6 +340,40 @@ let structs = [
];
s_camel_name = "BTRFSQgroup" };
(* btrfs balance status output *)
{ defaults with
s_name = "btrfsbalance";
s_cols = [
"btrfsbalance_status", FString;
"btrfsbalance_total", FUInt64;
"btrfsbalance_balanced", FUInt64;
"btrfsbalance_considered", FUInt64;
"btrfsbalance_left", FUInt64;
];
s_camel_name = "BTRFSBalance" };
(* btrfs scrub status output *)
{ defaults with
s_name = "btrfsscrub";
s_cols = [
"btrfsscrub_data_extents_scrubbed", FUInt64;
"btrfsscrub_tree_extents_scrubbed", FUInt64;
"btrfsscrub_data_bytes_scrubbed", FUInt64;
"btrfsscrub_tree_bytes_scrubbed", FUInt64;
"btrfsscrub_read_errors", FUInt64;
"btrfsscrub_csum_errors", FUInt64;
"btrfsscrub_verify_errors", FUInt64;
"btrfsscrub_no_csum", FUInt64;
"btrfsscrub_csum_discards", FUInt64;
"btrfsscrub_super_errors", FUInt64;
"btrfsscrub_malloc_errors", FUInt64;
"btrfsscrub_uncorrectable_errors", FUInt64;
"btrfsscrub_unverified_errors", FUInt64;
"btrfsscrub_corrected_errors", FUInt64;
"btrfsscrub_last_physical", FUInt64;
];
s_camel_name = "BTRFSScrub" };
(* XFS info descriptor. *)
{ defaults with
s_name = "xfsinfo";

Some files were not shown because too many files have changed in this diff Show More