Bug 636200 - Rebase to fix compatibility with ESX driver and support new APIs in rebased libvirt 0.8.2
Summary: Rebase to fix compatibility with ESX driver and support new APIs in rebased l...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: perl-Sys-Virt
Version: 5.6
Hardware: All
OS: Linux
urgent
medium
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 636448
TreeView+ depends on / blocked
 
Reported: 2010-09-21 16:19 UTC by Matthew Booth
Modified: 2011-01-13 23:46 UTC (History)
6 users (show)

Fixed In Version: perl-Sys-Virt-0.2.4-1.el5
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Previously, perl-Sys-Virt was not able to authenticate with libvirt ESX driver connections. This update fixes the compatibility with ESX driver and introduces support for new APIs in the rebased libvirt package.
Clone Of:
Environment:
Last Closed: 2011-01-13 23:46:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0117 0 normal SHIPPED_LIVE perl-Sys-Virt bug fix update 2011-01-12 17:28:52 UTC

Description Matthew Booth 2010-09-21 16:19:02 UTC
Executing the following dumps core:

my $vmm = Sys::Virt->new(
    uri => 'esx://yellow.rhev.marston/?no_verify=1',
    readonly => 1,
    auth => 1,
    credlist => [
        Sys::Virt::CRED_AUTHNAME,
        Sys::Virt::CRED_PASSPHRASE
    ],
    callback => sub {
        my $creds = shift;

        foreach my $cred (@$creds) {
            if ($cred->{type} == Sys::Virt::CRED_AUTHNAME) {
                $cred->{result} = "root";
            }

            elsif ($cred->{type} == Sys::Virt::CRED_PASSPHRASE) {
                $cred->{result} = "s3cr3t";
            }

            else { die($cred->{type}, "\n"); }
        }
    }
);

Stack track:
#0  0x0000003ba6e797e0 in strlen () from /lib64/libc.so.6
#1  0x0000003ba9299330 in Perl_newSVpv (my_perl=0x171a2010, s=0x0, len=0)
    at sv.c:6908
#2  0x00002ae7745030c5 in _open_auth_callback (cred=0x7ffffc405810, ncred=1, 
    cbdata=0x17251bc0) at Virt.xs:375
#3  0x00002ae774758140 in virRequestPassword (auth=0x7ffffc406350, 
    username=0x172c59e0 "root", hostname=0x172bb190 "yellow.rhev.marston")
    at util/authhelper.c:105
#4  0x00002ae7747f850e in esxOpen (conn=0x172c0700, auth=0x7ffffc406350, 
    flags=<value optimized out>) at esx/esx_driver.c:422
#5  0x00002ae7747aa138 in do_open (
    name=0x171bb200 "esx://yellow.rhev.marston/?no_verify=1", 
    auth=0x7ffffc406350, flags=1) at libvirt.c:1243
#6  0x00002ae7747aace6 in virConnectOpenAuth (
    name=0x171bb200 "esx://yellow.rhev.marston/?no_verify=1", 
    auth=0x7ffffc406350, flags=1) at libvirt.c:1498
#7  0x00002ae77451eeb3 in XS_Sys__Virt__open_auth (
    my_perl=<value optimized out>, cv=<value optimized out>) at Virt.xs:469
#8  0x0000003ba9290a96 in Perl_pp_entersub (my_perl=0x171a2010)
    at pp_hot.c:2877
#9  0x0000003ba928a33e in Perl_runops_standard (my_perl=0x171a2010) at run.c:37
#10 0x0000003ba923808a in S_run_body (my_perl=0x171a2010) at perl.c:2372
#11 perl_run (my_perl=0x171a2010) at perl.c:2289
#12 0x00000000004017bc in main (argc=2, argv=0x7ffffc406638, 
    env=<value optimized out>) at perlmain.c:99

Interesting gdb output:
#2  0x00002ae7745030c5 in _open_auth_callback (cred=0x7ffffc405810, ncred=1, 
    cbdata=0x17251bc0) at Virt.xs:375
375	      (void)hv_store(credrec, "result", 6, newSVpv(cred[i].defresult, 0), 0);
(gdb) print cred[i]
$8 = {type = 388761808, 
  prompt = 0x172c5860 "Enter root's password for yellow.rhev.marston", 
  challenge = 0x172bb110 "p\261+\027", 
  defresult = 0x7ffffc405d70 "192.168.1.201", 
  result = 0x172c0700 "\255\336#O\001", resultlen = 4232078160}
(gdb) down
#1  0x0000003ba9299330 in Perl_newSVpv (my_perl=0x171a2010, s=0x0, len=0)
    at sv.c:6908
6908	    sv_setpvn(sv,s,len ? len : strlen(s));
(gdb) print s
$1 = 0x0

I didn't experience this issue with Sys::Virt 0.2.3, which was embedded in v2v-libvirt, so I suspect this is already fixed upstream.

Version-Release number of selected component (if applicable):
libvirt-0.8.2-4.el5
perl-Sys-Virt-0.2.0-6.el5
perl-5.8.8-32.el5_5.1
(all x86_64)

Comment 1 Matthew Booth 2010-09-22 09:19:10 UTC
I've confirmed this is fixed upstream. I built upstream Sys::Virt 0.2.4 for RHEL 5 and re-ran the above test. It works fine.

Comment 2 Matthew Booth 2010-09-22 09:47:41 UTC
Setting the exception flag on this as would block virt-v2v, which is approved.

Comment 4 Matthew Booth 2010-10-07 12:40:17 UTC
This fixes my crasher, and virt-v2v works too.

Comment 5 Matthew Booth 2010-10-07 12:41:41 UTC
(In reply to comment #4)
> This fixes my crasher, and virt-v2v works too.

By 'this', I mean perl-Sys-Virt-0.2.4-1.el5.x86_64.

Comment 7 dyuan 2010-10-25 06:59:57 UTC
Reproduce the bug with perl-Sys-Virt-0.2.0-6.el5 on Server-x86_64-KVM and Server-x86_64-Xen.

related package:
libvirt-0.8.2-8.el5
perl-5.8.8-32.el5_5.2

# cat test.pl
use Sys::Virt;
my $vmm = Sys::Virt->new(
    uri => 'esx://10.66.72.124/?no_verify=1',
    readonly => 1,
    auth => 1,
    credlist => [
        Sys::Virt::CRED_AUTHNAME,
        Sys::Virt::CRED_PASSPHRASE
    ],
    callback => sub {
        my $creds = shift;

        foreach my $cred (@$creds) {
            if ($cred->{type} == Sys::Virt::CRED_AUTHNAME) {
                $cred->{result} = "root";
            }

            elsif ($cred->{type} == Sys::Virt::CRED_PASSPHRASE) {
                $cred->{result} = "123qwe!";
            }

            else { die($cred->{type}, "\n"); }
        }
    }
);

# perl test.pl 
Segmentation fault

#################################
Verify the bug passed on Server-x86_64-KVM, Server-x86_64-Xen

# rpm -Uvh perl-Sys-Virt-0.2.4-1.el5.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:perl-Sys-Virt          ########################################### [100%]

# perl test.pl 
#

no segmentation fault after upgrade package to perl-Sys-Virt-0.2.4-1.el5

Comment 8 Florian Nadge 2011-01-03 11:17:08 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, perl-Sys-Virt was not able to authenticate with libvirt ESX driver connections. This update fixes the compatibility with ESX driver and introduces support for new APIs in the rebased libvirt package.

Comment 10 errata-xmlrpc 2011-01-13 23:46:30 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0117.html


Note You need to log in before you can comment on or make changes to this bug.