<fs> add-ro rhel55.img <fs> run <fs> inspect-os /dev/VolGroup00/LogVol00 <fs> inspect-get-type /dev/VolGroup00/LogVol00
These three patches (two were previously posted) can do simple operating system inspection in C. Example of use: linux
<fs> inspect-get-distro /dev/VolGroup00/LogVol00 rhel <fs> inspect-get-arch /dev/VolGroup00/LogVol00 x86_64 <fs> inspect-get-major-version /dev/VolGroup00/LogVol00 5 <fs> inspect-get-minor-version /dev/VolGroup00/LogVol00 5 <fs> inspect-get-product-name /dev/VolGroup00/LogVol00 Red Hat Enterprise Linux Server release 5.5 (Tikanga) <fs> inspect-get-filesystems /dev/VolGroup00/LogVol00 /dev/VolGroup00/LogVol00 /dev/vda1 /dev/VolGroup00/LogVol01 <fs> inspect-get-mountpoints /dev/VolGroup00/LogVol00 /dev/VolGroup00/LogVol00: / /dev/vda1: /boot
I've tested this with all of my available guests. The only ones it *doesn't* work on were a Fedora guest with an encrypted disk, and some FreeBSD/PCBSD guests. For the encrypted guest, you have to open the device first. We could probably get the *BSD guests working with some effort. Anyway I'm quite happy with this and I intend to push it if no one objects. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On Thu, Jul 29, 2010 at 03:03:59PM +0100, Richard W.M. Jones wrote:
+ ret[2*count] = safe_strdup (g, fs->fstab[i].device); + ret[2*count+1] = safe_strdup (g, fs->fstab[i].mountpoint);
I guess no one spotted that these are the wrong way round ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
participants (1)
-
Richard W.M. Jones