Fedora Rawhide / libguestfs 1.23.14 now enables -cpu host, +kvmclock
by Richard W.M. Jones
Passing '-cpu host' is meant to cause qemu to pass the same CPUID
flags from the host up to the appliance. The major benefit of this is
that the appliance can use all CPU features available to optimize eg.
checksumming, crypto, RAID XOR operations, zero fill.
However in practice this can cause strange problems on some hardware:
https://bugzilla.redhat.com/show_bug.cgi?id=870071
This manifests itself as particular operations failing randomly,
especially if RAID or crypto is involved. If you enable debugging you
would see a kernel stack trace similar to the one shown in the bug
above (and possibly many other variations).
If you see anything like this, please file a bug.
Adding +kvmclock should cause the appliance to use kvm-clock instead
of the default (probably tsc). This should improve clock stability on
heavily loaded machines, and as far as I know has no downside.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
11 years, 3 months
Re: [Libguestfs] Supermin on mageia
by Richard W.M. Jones
On Thu, Aug 15, 2013 at 11:36:38AM +0800, Joseph Wang wrote:
> Hello,
>
> I'm trying to get supermin to work on mageia and I've run into the
> following glitch. Mageia has /etc/init.d as a symlink that is pointing to
> /etc/rc.d/init.d and after I generate the appliance and run supermin-helper
> I get
>
> supermin helper [00033ms] finished creating kernel
> supermin helper [01415ms] finished mke2fs
> supermin helper [01415ms] visiting /usr/lib64/guestfs/supermin.d
> supermin helper [01416ms] visiting /usr/lib64/guestfs/supermin.d/base.img
> supermin helper [01548ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
> supermin helper [01555ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
> supermin-helper: ext2: parent directory not found: rc.d/init.d: File not
> found by ext2_lookup
>
> What appears to be happening is that supermin-helper is trying to set up
> the symlink from init.d to rc.d/init.d before rc.d has been created.
>
> Do you have any suggestions as to how to handle this?
This is a bug in supermin. But as a simple workaround you could
create a file which creates the required directory /etc/rc.d/init.d
before hostfiles is loaded. Something like this:
mkdir -p /tmp/etc/rc.d/init.d
cd /tmp
find etc | cpio --quiet -o -H newc > /tmp/00-rc.img
cp /tmp/00-rc.img /usr/lib64/guestfs/supermin.d/
Note files in supermin.d are visited in lexicographic order.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
11 years, 3 months
[PATCH 0/4] Not quite working User-Mode Linux backend.
by Richard W.M. Jones
This is a User-Mode Linux backend for libguestfs. You can select it
by doing:
export LIBGUESTFS_BACKEND=uml
export LIBGUESTFS_QEMU=/path/to/vmlinux
Note we're reusing the 'qemu' variable in the handle for convenience.
QEmu is not involved when using the UML backend.
This almost works. UML itself crashes when the daemon tries to
connect to the serial port. I suspect it's because I'm using the
'ssl3=fd:<N>' option.
Rich.
11 years, 3 months
[PATCH] Fix parsing of boot flag in do_part_get_bootable()
by Paul Mackerras
The code in do_part_get_bootable() assumes that if a partition has the
bootable flag set, then that is the only flag. It compares the entire
flags field with the string "boot". However, the boot flag isn't
always the only flag. For instance, POWER systems typically have a
bootable partition of type 0x41 (PPC PReP boot), which parted -m
displays as:
# parted -m -- f18.img unit b print
BYT;
/root/f18.img:16106127360B:file:512:512:msdos::;
1:1048576B:5242879B:4194304B:::boot, prep;
That is, the flags field contains "boot, prep", and thus libguestfs
fails to see that this partition is bootable. Ultimately this causes
virt-resize to fail to set the bootable flag on the boot partition of
the destination image, resulting in an image that won't boot.
This patch fixes the problem by searching for the string "boot" within
the flags field, instead of comparing the whole flags field.
---
--- libguestfs-1.22.5/daemon/parted.c~ 2013-02-03 00:47:53.000000000 +1100
+++ libguestfs-1.22.5/daemon/parted.c 2013-08-02 11:16:49.921790245 +1000
@@ -628,7 +628,7 @@
if (boot == NULL)
return -1;
- return STREQ (boot, "boot");
+ return strstr (boot, "boot") != NULL;
}
else {
/* Old-style: First look for the line matching "^Number". */
11 years, 3 months
Re: [Libguestfs] hivex from python
by Richard W.M. Jones
On Wed, Jul 31, 2013 at 09:13:46PM -0500, Edward wrote:
> I plan to do the development in Python and I just can't seem to find enough
> documentation or sample code to really get started. If you could send me
> some sample code to perform common task or point me in the right direction
> it would be most appreciated.
Please send questions to the mailing list:
https://www.redhat.com/mailman/listinfo/libguestfs
You don't need to subscribe.
---
It's not clear if your intended program will run in the Windows
machine itself, or if you want to edit the registry outside a Windows
guest using libguestfs.
Anyway, there is one example of using hivex from Python here:
https://rwmj.wordpress.com/2010/11/28/use-hivex-from-python-to-read-and-w...
This example is a little bit obsolete (but will still work), because
you can now use the hivex API directly via libguestfs which is more
efficient.
There are also some test programs here written in Python:
https://github.com/libguestfs/hivex/tree/master/python/t
Using hivex from Python is no different from using it from C, so just
follow any C examples and mentally map them into Python, eg:
hivex_root(h) ===> h.root
Here is the C API documentation:
http://libguestfs.org/hivex.3.html
Rich.
--
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://people.redhat.com/~rjones/virt-df/
11 years, 3 months