Bug 501412

Summary: f11 kvm guest install exits after package install completes
Product: [Fedora] Fedora Reporter: Liam Li <lili>
Component: qemuAssignee: Mark McLoughlin <markmc>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 11CC: berrange, clalance, crobinso, dwmw2, ehabkost, gcosta, hbrock, itamar, jlaska, lcarreon, lookkas, markmc, notting, quintela, rmaximo, rwilliam, sergei.litvinenko, vanmeeuwen+fedora, virt-maint
Target Milestone: ---Keywords: CommonBugs
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: https://fedoraproject.org/wiki/Common_F11_bugs#501412
Fixed In Version: 0.10.5-2.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 503029 (view as bug list) Environment:
Last Closed: 2009-06-15 22:28:36 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 480594    
Description Flags
f11 log
qemu screenshot
prevent-cdrom-media-eject-while-device-is-locked.patch none

Description Liam Li 2009-05-18 22:26:39 EDT
Description of problem:
f11 installation  hangs up after all packages installed  in kvm. when all packages are installed ,the installer should go next step to reboot the system.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. create a VM in kvm to install f11
2. All select default, after all packages install finished,the installation hung up there and system did not reboot automatically.
Actual results:
when all packages are installed ,the installer should go next step to reboot the system.We need to force shut off the system and restart.We can start the system ,but mouse and keyboard do not work, it's another bug.

Expected results:

Additional info:
Comment 1 Mark McLoughlin 2009-05-25 10:31:06 EDT
What version of libvirt and qemu is this?

Please include ~/.virt-manager/virt-manager.log and the guest log from /var/log/libvirt/qemu/

What version of F11 is this? Beta?
Comment 2 Liam Li 2009-05-26 00:53:48 EDT
Created attachment 345387 [details]
Comment 3 Liam Li 2009-05-26 01:00:59 EDT
Created attachment 345388 [details]
f11 log
Comment 4 Liam Li 2009-05-26 01:02:23 EDT
[root@dhcp-66-70-91 iso]# rpm -qa |grep qemu

logs, please see attachments.
Comment 5 Mark McLoughlin 2009-05-26 10:54:03 EDT
Okay, confirmed with rc0.1

To clarify a little further:

  - x86_64 KVM guest install from DVD ISO

  - When anaconda finishes installing packages, it doesn't wait at the
    install screen

  - The guest fails to reboot

Adding to F11VirtBlocker and re-assigning to anaconda
Comment 6 Bill Nottingham 2009-05-26 15:57:40 EDT
I don't think this is an anaconda bug, at least not directly.

A text mode install shows the following happening around the time of bootloader installation (on /dev/vda):

ata2.00: exception Emask 0x0 SACt 0x0 SErr 0x0 action 0x6
ata2.00: cmd a0/00:00:00:00:00:/00:00:00:00:00/a0 tag 0
         cdb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
         res 01/60:00:00:00:00:00:/00:00:00:00:00/a0 Emask 0x3 (HSM violation)
ata2.00: status: {ERR}
ata2: soft resetting link
ata2.01: NODEV after polling detection
ata2.00: configured for MWDMA2
ata2: EH complete
VFS: busy inodes on changed media or resized disk sr0
... <large amounts of VFS and squashfs errors follow>
Comment 7 Bill Nottingham 2009-05-26 15:58:26 EDT
Created attachment 345509 [details]

tail of anaconda.log. Can't actually get it off the box due to no CD filesystem.
Comment 8 Bill Nottingham 2009-05-26 15:58:50 EDT
Created attachment 345510 [details]
Comment 9 Bill Nottingham 2009-05-26 15:59:11 EDT
Created attachment 345511 [details]
Comment 10 Bill Nottingham 2009-05-26 16:11:03 EDT
In text mode, you still get the reboot button (which may happen to work, due to the paged-in-ness of the installer).

In GUI mode, you'll see the hang because the install exits abnormally when X SIGBUSes after the CD error.
Comment 11 Bill Nottingham 2009-05-26 16:12:18 EDT
Bouncing back to KVM for now. Could also be kernel.
Comment 12 Bill Nottingham 2009-05-26 16:22:50 EDT
Of note, in the host dmesg:

kvm: 2788: cpu0 unhandled wrmsr: 0xc0010117 data 0
kvm: 2788: cpu0 unhandled rdmsr: 0xc0010117
kvm: 2788: cpu0 unhandled rdmsr: 0xc0010117
Comment 13 Bill Nottingham 2009-05-26 17:04:36 EDT
While it occurs about the time the bootloader is installed, it's reproducible on installs where 'no bootloader' is selected.
Comment 14 Bill Nottingham 2009-05-26 17:09:36 EDT
Looking at the anaconda log, bad things happen around/near step 'methodcomplete':

def doMethodComplete(anaconda):
    def _ejectDevice():
        # Ejecting the CD/DVD for kickstart is handled only after %post scripts
        # have been run.
        if anaconda.isKickstart:
            return None

        if anaconda.mediaDevice:
            return anaconda.id.storage.devicetree.getDeviceByName(anaconda.mediaDevice)

        # If we booted off the boot.iso instead of disc 1, eject that as well.
        if anaconda.stage2 and anaconda.stage2.startswith("cdrom://"):
            dev = anaconda.stage2[8:].split(':')[0]
            return anaconda.id.storage.devicetree.getDeviceByName(dev)

    dev = _ejectDevice()
    if dev:

So, somewhere in the kernel, or the virtual CD emulation, we're not returning -EBUSY on eject?
Comment 15 Bill Nottingham 2009-05-26 17:11:10 EDT
Confirmed - just running 'eject /dev/sr0' from tty2 triggers it.
Comment 16 Bill Nottingham 2009-05-26 17:49:35 EDT
On a 'normal' DVD based install, the ioctl to eject returns EIO.

On a virt DVD based install, it succeeds and 'ejects' the device, causing mayhem. So it does appear qemu/kvm is at fault somehow.
Comment 17 Bill Nottingham 2009-05-26 17:56:39 EDT
Given that this also occurs when installing on a F10 host, this looks to be a longstanding qemu/kvm issue. Removing from the blocker list.
Comment 18 Chuck Ebbert 2009-05-26 22:13:03 EDT
Created attachment 345550 [details]
qemu screenshot

I played around with an F10 netinst image I had around and was able to go to the shell during install and eject the CD. Attached screenshot shows the block device info from the qemu console before and after running the eject command.
Comment 19 Daniel Berrange 2009-05-27 05:14:24 EDT
Wonder if this is a result of interactions in QEMU's IDE CDROM emulation for eject/tray locking. QEMU appears to support the IDE commands for 'eject' and 'lock tray', but the implementation of the 'eject' method doesn't appear to check if the tray is marked as locked. Perhaps anaconda is relying on the eject command failing if the tray is locked ?
Comment 20 Mark McLoughlin 2009-05-27 05:37:05 EDT
Created attachment 345586 [details]

Thanks for tracking this down Bill

danpb: yeah, that's it - I've already posted a patch to qemu-devel and it fixes the problem
Comment 22 Bill Nottingham 2009-05-28 23:51:44 EDT
*** Bug 499740 has been marked as a duplicate of this bug. ***
Comment 23 Mark McLoughlin 2009-06-03 11:06:55 EDT
No response from upstream yet, going ahead and build this with the fix:

* Wed Jun  3 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.10.5-2
- Prevent locked cdrom eject - fixes hang at end of anaconda installs (#501412)
- Fix crash with '-net socket,listen=...' (#501264)
- Avoid harmless 'unhandled wrmsr' warnings (#499712)
Comment 24 Fedora Update System 2009-06-03 12:21:02 EDT
qemu-0.10.5-2.fc11 has been submitted as an update for Fedora 11.
Comment 25 Bug Zapper 2009-06-09 12:05:18 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
Comment 26 Bill Nottingham 2009-06-12 16:11:51 EDT
*** Bug 505577 has been marked as a duplicate of this bug. ***
Comment 27 Fedora Update System 2009-06-15 22:27:59 EDT
qemu-0.10.5-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 28 Mark McLoughlin 2009-06-19 06:48:13 EDT
For reference, this patch did get applied upstream:

Comment 29 Mark McLoughlin 2009-06-19 06:59:58 EDT
*** Bug 505840 has been marked as a duplicate of this bug. ***
Comment 30 Leo Carreon 2009-09-02 05:48:05 EDT
I am experiencing the same problem installing Fedora 11 64-bit onto VMware Workstation 6.5.  I am using Fedora 11 obtained using Fedora-11-x86_64-DVD.torrent dated 2009-06-09.  Does this version have the fix or is another version going to be released?  When will the fixed version be available?