Comment from Eric Blake:
> We don't have any hard-links in our source. GNU cp -d is the same as
> cp -P --preserve=links, but --preserve=links only matters for hard
> links, so losing it doesn't hurt our usage. I'm inclined to just go
> with cp -P unconditionally rather than needing the configure.ac
> logic for $(CP_D).
Fixes: https://github.com/libguestfs/libguestfs/issues/183
Reported-by: Mohamed Akram
Thanks: Eric Blake
These libraries are only needed if building the daemon (so not if
using ./configure --disable-daemon). Move the tests so we only check
for these libraries if the daemon is enabled in the build.
The daemon also requires ocaml-augeas (it uses both the augeas C
library directly and the OCaml bindings for augeas, for reasons).
However that test is already disabled if the daemon is not being
built.
Reported-by: Mohamed Akram
Fixes: commit dfa9dee775
Fixes: commit 8a723ca62e
Fixes: commit 228d49bb84
Fixes: https://github.com/libguestfs/libguestfs/issues/184
libmagic (part of the "file" command) was required in earlier versions
of libguestfs, but this requirement was effectively removed in
commit b48da89dd6 ("daemon: Reimplement ‘file_architecture’ API in
OCaml") back in 2017. Or to be more precise, we now use the "file"
command inside the daemon, which may or may not use libmagic but we
no longer link to the library directly.
Reported-by: Mohamed Akram
Fixes: commit b48da89dd6
Related: https://github.com/libguestfs/libguestfs/issues/184
Linux + LVM supports device names like /dev/disk/by-id/dm-uuid-LVM-
followed by two concatenated UUIDs, firstly for the volume group and
secondly for the logical volume. We can reverse those to get the
device name (/dev/VG/LV).
fstab entries look like:
# / was on /dev/vg0/lv-0 during curtin installation
/dev/disk/by-id/dm-uuid-LVM-OzFWT6NHkstr1hcmrWRRMDGPn9xdZj1YOOycQ533186x288FdU6UubU3OlnWJz6D / ext4 defaults 0 1
# /usr was on /dev/vg0/lv-1 during curtin installation
/dev/disk/by-id/dm-uuid-LVM-OzFWT6NHkstr1hcmrWRRMDGPn9xdZj1YZu53m4ZssZ8Jeb3I14RAJwIj5YlHIb9P /usr ext4 defaults 0 1
The upshot of this fix is that we are now able to correctly inspect
and run virt-v2v on Ubuntu 22+ guests with split /usr. In particular,
we correctly map /etc/fstab entries like the above to LV device names,
which means that /usr merging now works correctly.
Reported-by: Jaroslav Spanko
Thanks: Daniel Berrange
Fixes: https://issues.redhat.com/browse/RHEL-87493
These were previously written in very convoluted C which had to deal
with parsing the crazy output of the "lvm" command. In fact the
parsing was so complex that it was generated by the generator. It's
easier to do this in OCaml.
These are basically legacy APIs. They cannot be expanded and LVM
already supports many more fields. We should replace these with APIs
for getting single named fields from LVM.
This was implemented wrongly. In the XDR protocol, UUIDs are fixed
buffers of length 32. We can just use memcpy to copy from the OCaml
string to the UUID, but we have to ensure the string length returned
by OCaml is correct (if not we just assert, it's an internal error).
(It didn't even compile before, so we know it was never used).
Ubuntu 22= uses /dev/disk/by-uuid/ followed by a filesystem UUID in
fstab entries. Resolve these to mountables.
A typical fstab entry looks like this:
# /boot was on /dev/vda2 during curtin installation
/dev/disk/by-uuid/b4e56462-5a64-4272-b76d-f5e58bd8f128 /boot ext4 defaults 0 1
The comment is generated by the installer and appears in the fstab.
This entry would be translated to /dev/sda2.
This acts just like FString except that we do reverse device name
translation on it. The only use is in the 'pvs-full' API where we
will use it (in a subsequent commit) to reverse translate the pv_name
field (a device name) before returning it from the daemon.
Compare this to the 'pvs' API which also returns a list of device
names, but using the generator's 'RStructList (RDevice,...)' return
type, where RDevice is similarly reverse translated.
Note in the library-side bindings, because the name has already been
translated in the daemon, we just treat it exactly the same as
FString. The vast majority of this patch is this mechanical change.
Cole Robinson (2):
mltools: decouple and simplify osinfo device support checks
mlcustomize: disable `--inject-virtio-win osinfo`
Richard W.M. Jones (3):
mltools: Fix de-oUnit-ized tests
mltools: Unreference various objects
Revert "mltools: Unreference various objects"
And update customize docs to match
Signed-off-by: Cole Robinson <crobinso@redhat.com>
These are not required by libguestfs. They were used by virt-builder,
but that tool has now been moved to a separate project
(guestfs-tools).
Fixes: commit 733d2182b6
Useful for debugging problems caused by the host kernel. In
particular we were looking at a problem with passt creating a user
namespace but didn't know what exact kernel was being used.
Internal error type did not implement the necessary traits to be
treated as a proper Rust error. This would cause ergonomic issues
with manual error handling and with error handling crates like
anyhow. Implement the Display and Error trait for internal Error
type. This also fixes the build warnings.
Signed-off-by: Jacob Reger <regerjacob@gmail.com>
Fixed break in Rust bindings where callback registering expected a
*const i8, but were provided with a *const c_char. Changed to be both
*const c_char in alignment with the libguestfs documentation.
Signed-off-by: Jacob Reger <regerjacob@gmail.com>
These APIs allow you to capture output from guest commands that
generate more output than the protocol limit allows.
Thanks: Nijin Ashok
Fixes: https://issues.redhat.com/browse/RHEL-80159
There were several, large *.o files left over after 'make clean':
$ ls ruby/ext/guestfs/
actions-0.c actions-2.c actions-4.c actions-6.c handle.c
actions-0.o actions-2.o actions-4.o actions-6.o handle.o
actions-1.c actions-3.c actions-5.c actions.h module.c
actions-1.o actions-3.o actions-5.o extconf.rb.in module.o