Can I use qemu-dm instead of qemu?
by Kirby Zhou
XEN of RHEL5.x DOM0 provides a qemu-dm command at
/usr/lib64/xen/bin/qemu-dm, Can I run libguestfs with it?
I have tried run libguestfs with kqemu, but it always cause system hang.
Regards
Kirby Zhou
14 years, 6 months
[PATCH] Rely on new augeas lens for modules.conf and conf.modules
by Matthew Booth
We were previously forcing the augeas Modprobe lens to match modules.conf and
conf.modules. It turns out that the contents of these files are quite different
to modprobe.conf, requiring a new lens.
This change keeps the logic which looks for where modules should go, but doesn't
update the augeas configuration. If there is no augeas lens for
/etc/modules.conf, any attempt to parse or modify it will fail.
---
lib/Sys/VirtV2V/GuestOS/RedHat.pm | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
index 77f0f3a..1a7afbd 100644
--- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm
+++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
@@ -87,6 +87,7 @@ sub new
bless($self, $class);
$self->_init_selinux();
+ $self->_init_modules();
$self->_init_augeas();
return $self;
@@ -168,10 +169,9 @@ sub _init_selinux
$g->touch('/.autorelabel');
}
-sub _init_augeas
+sub _init_modules
{
my $self = shift;
-
my $g = $self->{g};
# Check how new modules should be configured. Possibilities, in descending
@@ -185,10 +185,8 @@ sub _init_augeas
# discovered method will be chosen
# Files which the augeas Modprobe lens doesn't look for by default
- my @modprobe_add = ();
foreach my $file qw(/etc/conf.modules /etc/modules.conf) {
if($g->exists($file)) {
- push(@modprobe_add, $file);
$self->{modules} = $file;
}
}
@@ -205,20 +203,18 @@ sub _init_augeas
die(user_message(__"Unable to find any valid modprobe configuration"))
unless(defined($self->{modules}));
+}
+
+sub _init_augeas
+{
+ my $self = shift;
+ my $g = $self->{g};
# Initialise augeas
eval {
$g->aug_close();
$g->aug_init("/", 1);
- # Add files which exist, but the augeas Modprobe lens doesn't look for
- # by default
- if(scalar(@modprobe_add) > 0) {
- foreach (@modprobe_add) {
- $g->aug_set("/augeas/load/Modprobe/incl[last()+1]", $_);
- }
- }
-
# Check if /boot/grub/menu.lst is included by the Grub lens
my $found = 0;
foreach my $incl ($g->aug_match("/augeas/load/Grub/incl")) {
--
1.6.6.1
14 years, 6 months
FW: Emailing: 0002-use-single-registry-change-for-all-supported-windows.patch
by Amos Benari
Attached is a fixed version of the patch.
> -----Original Message-----
> From: Richard W.M. Jones [mailto:rjones@redhat.com]
> Sent: Friday, May 14, 2010 10:23 AM
> To: Amos Benari
> Cc: libguestfs(a)redhat.com
> Subject: Re: [Libguestfs] Emailing: 0002-use-single-registry-change-
> for-all-supported-windows.patch
>
> > From: unknown <Amos@.(none)>
>
> In ~/.gitconfig set:
>
> [user]
> name = Your Name
> email = your(a)email.example.com
>
> > [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\viostor\Enum]
> > -
> "0"="PCI\\\\VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00\\\\3&13c0b0c5&0&2
> 0
> "
> > +"0"="PCI\\VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00\\3&13c0b0c5&0&20"
>
> This change won't do what you expect. Because of the vaguaries of
> Perl backslash escaping in single quotes, you need to use four
> backslashes to get a single backslash in the hive, but only in value
> strings.
>
> See:
>
> http://en.wikibooks.org/wiki/Perl_Programming/Strings#Single_Quoted_St
> r
> ings
Fixed.
>
> As Matt noted on IRC it would be much better to change this to use a
> heredoc.
>
> > -[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\RHSrvAny]
> > +[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\rhev-apt]
>
> This depends on some change (or not) to RHSrvAny. I made this change
> to the service name:
>
> http://github.com/rwmjones/rhsrvany/commit/2de2f11dc0c97aab0f8778aa1ee
> 2
> dc35f4034a69
>
> Anyway, we can discuss the issue of open sourcing RHSrvAny separately.
This is the system I have tested.
Will be happy to change and repeat the tests once it will be decided.
>
> > - <app os='linux' distro='rhel' major='5' arch='i686'
> > name='kernel'>
> > + <app distro='rhel' major='5' arch='i686' name='kernel'>
>
> You seem to be reverting another patch, or was this really
> intentional?
Fixed.
This is an error in my patch I haven't changed this line intentionally.
>
> > <!-- Windows -->
> > - <app os='windows' major='5' arch='i386' name='viostor'>
> > + <app os='windows' major='5' minor='1' arch='i386' name='viostor'>
> > + <path>windows/xp/i386/viostor.sys</path>
> > + </app>
> > + <app os='windows' major='5' minor='2' arch='i386' name='viostor'>
> > <path>windows/2003/i386/viostor.sys</path>
> > </app>
> > - <app os='windows' major='5' arch='x86_64' name='viostor'>
> > + <app os='windows' major='5' minor='2' arch='x86_64'
> name='viostor'>
> > <path>windows/2003/x86_64/viostor.sys</path>
> > </app>
> > <app os='windows' major='6' arch='i386' name='viostor'> @@ -86,6
> > +89,12 @@
> > <app os='windows' major='6' arch='x86_64' name='viostor'>
> > <path>windows/2008/x86_64/viostor.sys</path>
> > </app>
> > + <app os='windows' major='6' minor='1' arch='i386' name='viostor'>
> > + <path>windows/7/i386/viostor.sys</path>
> > + </app>
> > + <app os='windows' major='6' minor='1' arch='x86_64'
> name='viostor'>
> > + <path>windows/7/x86_64/viostor.sys</path>
> > + </app>
> > <!-- RHSrvAny is compiled as a 32 bit app even on 64 bit Windows
> > -
> ->
> > <app os='windows' name='rhsrvany'>
> > <path>windows/rhsrvany.exe</path> @@ -94,8 +103,8 @@
> > <app os='windows' name='firstboot'>
> > <path>windows/firstboot.bat</path>
> > </app>
> > - <app os='windows' name='firstbootzip'>
> > - <path>windows/firstboot.zip</path>
> > + <app os='windows' name='firstbootapp'>
> > + <path>windows/rhev-apt.exe</path>
> > </app>
>
> This seems fine. Do we have separate versions of viostor for all the
> versions of Windows, or are all those just the same file?
In the build system we have separate viostore for each, I have taken them
from rhev-m build.
>
> To what extent have you tested and proven this works?
I did test from first boot to complete tools installation on windows
xp-sp3, 2k3-r2 32bit, 2k8-r2 64bit and 7.
>
> 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
14 years, 6 months
[PATCH] Use RHN to retrieve replacement packages
by Milan Zazrivec
For guests registered with Red Hat Network, this patch allows for
the conversion process to use RHN to download appropriate kernel
package and its dependencies.
We use yum on RHEL-5, up2date libraries on RHEL-4.
We install matching kernel version whenever possible, latest available
kernel version otherwise.
_discover_kernel routine has been extended to return version-release
of the default kernel found.
---
lib/Sys/VirtV2V/GuestOS/RedHat.pm | 166 ++++++++++++++++++++++++++++--------
1 files changed, 129 insertions(+), 37 deletions(-)
diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
index 77f0f3a..38a485c 100644
--- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm
+++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
@@ -475,7 +475,7 @@ sub add_kernel
{
my $self = shift;
- my ($kernel_pkg, $kernel_arch) = $self->_discover_kernel();
+ my ($kernel_pkg, $kernel_ver, $kernel_arch) = $self->_discover_kernel();
# If the guest is using a Xen PV kernel, choose an appropriate normal kernel
# replacement
@@ -547,56 +547,142 @@ sub add_kernel
}
}
- my ($app, $depnames);
- eval {
+ my $version;
+
+ # systemid exists, assume the system is registered w/ RHN
+ if ($self->{g}->exists('/etc/sysconfig/rhn/systemid')) {
my $desc = $self->{desc};
- ($app, $depnames) =
- $self->{config}->match_app($desc, $kernel_pkg, $kernel_arch);
- };
- # Return undef if we didn't find a kernel
- if ($@) {
- print STDERR $@;
- return undef;
- }
+ my ($min_virtio_ver, @kern_vr, @preinst_cmd, @inst_cmd, $inst_fmt);
- my @missing;
- if (!$self->{g}->exists($self->_transfer_path($app))) {
- push(@missing, $app);
+ # filter out xen/xenU from release field
+ if ($kernel_ver =~ /^(\S+)-(\S+?)(xen)?(U)?$/) {
+ @kern_vr = ($1, $2);
+ $kernel_ver = join('-', @kern_vr);
+ }
+
+ # RHEL-5
+ if ($desc->{distro} eq 'rhel' && $desc->{major_version} eq '5') {
+ if (_rpmvercmp($kernel_ver, '2.6.18-128.el5') >= 0) {
+ # Install matching kernel version
+ @inst_cmd = ('/usr/bin/yum', '-y', 'install',
+ "$kernel_pkg-$kernel_ver");
+ } else {
+ # Install latest available kernel version
+ @inst_cmd = ('/usr/bin/yum', '-y', 'install', $kernel_pkg);
+
+ # We need to upgrade kernel deps. first to avoid possible conflicts
+ my @deps;
+ my $deps = ($self->{config}->match_app($desc, $kernel_pkg, $kernel_arch))[1];
+
+ if ($deps) {
+ @preinst_cmd = (('/usr/bin/yum', '-y', 'upgrade'), @$deps);
+ }
+ }
+ }
+ # RHEL-4
+ elsif ($desc->{distro} eq 'rhel' && $desc->{major_version} eq '4') {
+ if (_rpmvercmp($kernel_ver, '2.6.9-89.EL') >= 0) {
+ # Install matching kernel version
+ @inst_cmd = ('/usr/bin/python', '-c',
+ "import sys; sys.path.append('/usr/share/rhn');" .
+ "import actions.packages;" .
+ "actions.packages.cfg['forceInstall'] = 1;" .
+ "actions.packages.update([['$kernel_pkg', " .
+ "'$kern_vr[0]', '$kern_vr[1]', '']])");
+ } else {
+ # Install latest available kernel version
+ @inst_cmd = ('/usr/sbin/up2date', '-fi', $kernel_pkg);
+
+ # We need to upgrade kernel deps. first to avoid possible conflicts
+ my $deps = ($self->{config}->match_app($desc, $kernel_pkg, $kernel_arch))[1];
+
+ if ($deps) {
+ @preinst_cmd = (('/usr/sbin/up2date', '-fu'), @$deps);
+ }
+ }
+ }
+ else {
+ @inst_cmd = ('/usr/sbin/up2date', '-fi', $kernel_pkg);
+ }
+
+ my (@k_before, @k_new);
+
+ # List of kernels before the new kernel installation
+ @k_before = $self->{g}->glob_expand('/boot/vmlinuz-*');
+
+ eval {
+ # Upgrade dependencies if needed
+ if (@preinst_cmd) {
+ $self->{g}->command(\@preinst_cmd);
+ }
+ # Install new kernel
+ $self->{g}->command(\@inst_cmd);
+ };
+
+ $self->_augeas_error($@) if ($@);
+
+ # Figure out which kernel has just been installed
+ foreach my $k ($self->{g}->glob_expand('/boot/vmlinuz-*')) {
+ grep(/^$k$/, @k_before) or push(@k_new, $k);
+ }
+
+ # version-release of the new kernel package
+ $version = ($self->{g}->command_lines(
+ ['rpm', '-qf', '--qf=%{VERSION}-%{RELEASE}', $k_new[0]]))[0];
} else {
- return undef if ($self->_newer_installed($app));
- }
- my $user_arch = $kernel_arch eq 'i686' ? 'i386' : $kernel_arch;
+ my ($app, $depnames);
+ eval {
+ my $desc = $self->{desc};
- my @deps = $self->_get_deppaths(\@missing, $user_arch, @$depnames);
+ ($app, $depnames) =
+ $self->{config}->match_app($desc, $kernel_pkg, $kernel_arch);
+ };
+ # Return undef if we didn't find a kernel
+ if ($@) {
+ print STDERR $@;
+ return undef;
+ }
- # We can't proceed if there are any files missing
- _die_missing(@missing) if (@missing > 0);
+ my @missing;
+ if (!$self->{g}->exists($self->_transfer_path($app))) {
+ push(@missing, $app);
+ } else {
+ return undef if ($self->_newer_installed($app));
+ }
- # Install any required kernel dependencies
- $self->_install_rpms(1, @deps);
+ my $user_arch = $kernel_arch eq 'i686' ? 'i386' : $kernel_arch;
- # Inspect the rpm to work out what kernel version it contains
- my $version;
- my $g = $self->{g};
- foreach my $file ($g->command_lines
- (["rpm", "-qlp", $self->_transfer_path($app)]))
- {
- if($file =~ m{^/boot/vmlinuz-(.*)$}) {
- $version = $1;
- last;
+ my @deps = $self->_get_deppaths(\@missing, $user_arch, @$depnames);
+
+ # We can't proceed if there are any files missing
+ _die_missing(@missing) if (@missing > 0);
+
+ # Install any required kernel dependencies
+ $self->_install_rpms(1, @deps);
+
+ # Inspect the rpm to work out what kernel version it contains
+ my $g = $self->{g};
+ foreach my $file ($g->command_lines
+ (["rpm", "-qlp", $self->_transfer_path($app)]))
+ {
+ if($file =~ m{^/boot/vmlinuz-(.*)$}) {
+ $version = $1;
+ last;
+ }
}
- }
- die(user_message(__x("{path} doesn't contain a valid kernel",
- path => $app))) if(!defined($version));
+ die(user_message(__x("{path} doesn't contain a valid kernel",
+ path => $app))) if(!defined($version));
- $self->_install_rpms(0, ($app));
+ $self->_install_rpms(0, ($app));
+
+ }
# Make augeas reload so it'll find the new kernel
eval {
- $g->aug_load();
+ $self->{g}->aug_load();
};
$self->_augeas_error($@) if ($@);
@@ -632,6 +718,7 @@ sub _discover_kernel
# Get a current bootable kernel, preferrably the default
my $kernel_pkg;
+ my $kernel_ver;
my $kernel_arch;
foreach my $i (@configs) {
@@ -647,6 +734,11 @@ sub _discover_kernel
# Get the kernel package name
$kernel_pkg = $kernel->{package};
+
+ # Get the kernel package version
+ $kernel_ver = $kernel->{version};
+
+ last;
}
# Default to 'kernel' if package name wasn't discovered
@@ -664,7 +756,7 @@ sub _discover_kernel
# a very long time.
$kernel_arch = 'i686' if('i386' eq $kernel_arch);
- return ($kernel_pkg, $kernel_arch);
+ return ($kernel_pkg, $kernel_ver, $kernel_arch);
}
=item remove_kernel(version)
--
1.7.1
14 years, 6 months
Re: [Libguestfs] febootstrap failure
by Richard W.M. Jones
On Fri, May 14, 2010 at 11:02:36PM -0400, Aron Griffis wrote:
> Hi again Rich,
>
> I'm trying to use febootstrap to install either rawhide or f13,
> but my attempts are failing.
>
> $ sudo febootstrap fedora-13 /mnt/jubjub-f
> ...
> Running rpm_check_debug
> ERROR with rpm_check_debug vs depsolve:
> libc.so.6()(64bit) is needed by procmail-3.22-25.fc12.x86_64
> libc.so.6(GLIBC_2.2.5)(64bit) is needed by procmail-3.22-25.fc12.x86_64
> libc.so.6(GLIBC_2.3)(64bit) is needed by procmail-3.22-25.fc12.x86_64
> libc.so.6(GLIBC_2.4)(64bit) is needed by procmail-3.22-25.fc12.x86_64
> libm.so.6()(64bit) is needed by procmail-3.22-25.fc12.x86_64
> libm.so.6(GLIBC_2.2.5)(64bit) is needed by procmail-3.22-25.fc12.x86_64
> libc.so.6()(64bit) is needed by gawk-3.1.7-3.fc13.x86_64
> libc.so.6(GLIBC_2.11)(64bit) is needed by gawk-3.1.7-3.fc13.x86_64
> libc.so.6(GLIBC_2.2.5)(64bit) is needed by gawk-3.1.7-3.fc13.x86_64
> libc.so.6(GLIBC_2.3)(64bit) is needed by gawk-3.1.7-3.fc13.x86_64
> libc.so.6(GLIBC_2.3.4)(64bit) is needed by gawk-3.1.7-3.fc13.x86_64
> libc.so.6(GLIBC_2.4)(64bit) is needed by gawk-3.1.7-3.fc13.x86_64
> ...
Don't run febootstrap as root.
You don't say what version of febootstrap you are using or what host
you're using it from.
Rich.
--
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
14 years, 6 months