Hide Forgot
Created attachment 523541 [details] log file of conversion Description of problem: kvm winxp guest with sparse disk type can not be converted successfully the first time with virt-v2v Version-Release number of selected component (if applicable): virt-v2v-0.8.3-4.el6.x86_64 libguestfs-1.7.17-26.el6.x86_64 libvirt-0.9.4-11.el6.x86_64 How reproducible: always Steps to Reproduce: 1.Install a kvm winxp guest with sparse disk type 2.Use virt-v2v convert a guest to libvirt # LIBGUESTFS_TRACE=1 virt-v2v -ic qemu+ssh://10.66.72.122/system -os default -b rhevm kvm-winxp-i386-test 2>&1 |tee kvm-winxp-i386-test.log Actual results: The guest can not be converted successfully the first time Expected results: The guest can be converted successfully the first time. Additional info: 1.The error in log:details see the attachment. hivex: /tmp/libguestfsctCDvc: trailing garbage at end of file (at 0x8ab000, after 2150 pages) inspect_os: hivex_open: Operation not supported at /usr/share/perl5/vendor_perl/Sys/VirtConvert/GuestfsHandle.pm line 187. at /usr/bin/virt-v2v line 602 virt-v2v: Transferring storage volume kvm-winxp-i386-test.img: 6442450944 bytes 2.The error may occur several times,then it can susscss.After convert the kvm winxp guest successfully,when convert again then the error will not occur. 3.The kvm winxp guest with preallocated disk type can be converted successfully the first time. 4.Xen winxp guest can be converted successfully the first time.
Note the failure: libguestfs: trace: filesize "/WINDOWS/system32/config/software" libguestfs: trace: filesize = 9175040 libguestfs: trace: download "/WINDOWS/system32/config/software" "/dev/fd/12" libguestfs: trace: download = 0 hivex: /tmp/libguestfsctCDvc: trailing garbage at end of file (at 0x8ab000, after 2150 pages) Here is the code which is failing: http://git.annexia.org/?p=libguestfs.git;a=blob;f=src/inspect.c;h=ec1a2a0b3d753d25549ecb0f8197f077a6045605;hb=refs/heads/stable-1.8#l1120 "download_to_tmp" calls "guestfs_download". After the download returns success we try to open the file with "hivex_open" which notices corruption and prints the error above. http://git.annexia.org/?p=libguestfs.git;a=blob;f=src/proto.c;h=490dcfd7a6135d5b37d2593ec50dfac26f8e87ca;hb=refs/heads/stable-1.8#l1043 "guestfs_download" is generated, but eventually calls "guestfs___recv_file" in order to download the file. "hivex_open" just opens the file and mmap's it. The file size is 9175040 bytes == 0x8c0000. Hivex reports the trailing garbage at 0x8ab000 which is 86016 bytes before the reported end of the file.
Tingting could you please get a copy of the hive which is failing. You can use this command: virt-cat -a /var/lib/libvirt/images/kvm-winxp-i386-test.img \ /WINDOWS/system32/config/software > software and then send the file "software" to me.
Created attachment 523544 [details] file "software" produced by running virt-cat Hi,Richard I have run the following command #virt-cat -a /var/lib/libvirt/images/kvm-winxp-i386-test.img \ /WINDOWS/system32/config/software > software And the file "software" has been attached.
What we need here is a full log of virt-v2v failing, with the following two environment variables set: export HIVEX_DEBUG=1 export LIBGUESTFS_DEBUG=1 This will produce a large amount of debug output. I'm worried that the amount of debug output will disturb the results of the test, possibly making it unreproducible, but it's worth trying. - - - FWIW I cannot reproduce this problem here using the basic tools like virt-inspector2 or some custom Perl code I have written. I have not tried a full-blown virt-v2v run yet, but I will do so later.
Just FYI I cannot reproduce this using virt-v2v either.
(In reply to comment #5) > What we need here is a full log of virt-v2v failing, > with the following two environment variables set: > > export HIVEX_DEBUG=1 > export LIBGUESTFS_DEBUG=1 > > This will produce a large amount of debug output. I'm worried > that the amount of debug output will disturb the results > of the test, possibly making it unreproducible, but it's worth > trying. > > - - - > > FWIW I cannot reproduce this problem here using the basic tools > like virt-inspector2 or some custom Perl code I have written. > I have not tried a full-blown virt-v2v run yet, but I will do so > later. Hi,Richard, As you expected,I have tried to use virt-v2v with HIVEX_DEBUG=1 LIBGUESTFS_DEBUG=1,but the error can not be reproduced any more. Before to file this bug,I have tried to use virt-v2v to convert kvm-winxp-i386 guest on two hosts. On one host,the error occured 3 times,and the fourth time it is converted successfully,when convert again the error did not occur. On the other host,the error occured 2 times,and the third time it is converted successfully,when convert again the error did not occur. I also meet this error when I convert esx4.1-winxp-i386 guest,but when I convert again it can convert successfully.
Does the error still occur even without the debug environment variables? Even if it doesn't occur any more, I would like to leave this bug open for now in case it happens again for another user.
(In reply to comment #8) > Does the error still occur even without the debug > environment variables? > > Even if it doesn't occur any more, I would like to leave > this bug open for now in case it happens again for another > user. This time the error didn't occur even without the debug environment variables.
Hi,Richard The error occured when I use virt-v2v to convert esx3.5-win2003-x86_64,the debug info is attached: export HIVEX_DEBUG=1 export LIBGUESTFS_DEBUG=1 [root@tzheng-linux images]#HIVEX_DEBUG=1 LIBGUESTFS_DEBUG=1 virt-v2v -ic esx://10.66.73.244/?no_verify=1 -o rhev -n rhevm -os 10.66.90.115:/vol/v2v_manual/nfs_export esx3.5-win2003-x86_64 2>&1 | tee esx3.5-win2003-x86_64.log
Created attachment 523952 [details] debug info of virt-v2v The debug info of using virt-v2v to convert esx3.5-win2003-x86_64.
Created attachment 523970 [details] test-fd-mmap.c tzheng: please try the attached program. Follow the instructions at the top of the program.
(In reply to comment #12) > Created attachment 523970 [details] > test-fd-mmap.c > > tzheng: please try the attached program. Follow the instructions > at the top of the program. Tried the test program,there is no error in my machine.
Here is a special scratch build of libguestfs which will capture the software hive from the guest: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3650309 When run, this will print something like: SOFTWARE HIVE SAVED AS: /tmp/libguestfs123456 What you need to do is to run the debug test again (see comment 5), capture the debug output, AND capture the software hive. I'm particularly interested in the failure case still.
Try this one instead: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3650339
Setting flags for 6.2 exception, although this should possibly be a blocker.
(In reply to comment #14) > Here is a special scratch build of libguestfs which > will capture the software hive from the guest: > > http://brewweb.devel.redhat.com/brew/taskinfo?taskID=3650309 > > When run, this will print something like: > > SOFTWARE HIVE SAVED AS: /tmp/libguestfs123456 > > What you need to do is to run the debug test again > (see comment 5), capture the debug output, AND capture > the software hive. > > I'm particularly interested in the failure case still. Tried the new libguestfs build,howerver the bug can not be reproduced,I will try it when I meet the error again.
Created attachment 524400 [details] test-hivex.c I still can't reproduce this. Here is another test program which you could try. Read the instructions at the top of the file first, and you will probably need to change the first #define there too.
(In reply to comment #21) > Created attachment 524400 [details] > test-hivex.c > > I still can't reproduce this. > > Here is another test program which you could try. Read > the instructions at the top of the file first, and you > will probably need to change the first #define there too. Tried the test program with some xen,kvm windows guests,also vmware guests by copying the *-flat.vmdk file from esx servers,there is nothing goes wrong,just printing ok.
I tried about 30 times to reproduce the bug by converting different kinds of windows guests,however I can't reproduce the bug any more.
As comment 23,I can't reproduce the bug any more How do we deal with this bug? Thanks.
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux.
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development. This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.
This seems to be no longer reproducible.
(In reply to comment #30) > This seems to be no longer reproducible. Yes,I can not reproduce this issue any more after tried many times,so you can close it now.
Closing as per comment 31.