RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 676563 - libvirtd refuses to start after an ancient qemu package is installed
Summary: libvirtd refuses to start after an ancient qemu package is installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-10 09:03 UTC by zhanghaiyan
Modified: 2011-05-19 13:26 UTC (History)
10 users (show)

Fixed In Version: libvirt-0.8.7-16.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:26:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

Description zhanghaiyan 2011-02-10 09:03:28 UTC
Description of problem:
libvirtd crashes after an ancient qemu package is installed

Version-Release number of selected component (if applicable):
- kernel-2.6.32-94.el6.x86_64
- qemu-img-0.12.1.2-2.144.el6.x86_64
- qemu-kvm-0.12.1.2-2.144.el6.x86_64
- qemu-0.6.0-2.x86_64
- libvirt-0.8.7-5.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Libvirtd is working well
# virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                shut off
# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
# virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                shut off
2. Install a qemu package
# rpm -ivh qemu-0.6.0-2.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:qemu                   ########################################### [100%]
3. # virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                shut off
4. # service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
# service libvirtd restart
Stopping libvirtd daemon:                                  [FAILED]
Starting libvirtd daemon:                                  [  OK  ]
# service libvirtd status
libvirtd dead but subsys locked
# virsh list --all
error: unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No such file or directory
error: failed to connect to the hypervisor
5. After remove qemu package and restart libvirtd service, it works well as before  
Actual results:
Libvirtd crashes after qemu package is installed

Expected results:
Libvirtd should not crash after qemu package is installed

Additional info:

Comment 2 Osier Yang 2011-02-10 09:35:53 UTC
It's caused by the ancient qemu doesn't support "qemu -M ?", which is used to probe the machine types to construct guest capabilities, and the failure to contruct the guest capabilities then cause qemu state driver initialization failed.

Comment 3 Dave Allan 2011-02-11 21:54:20 UTC
Is libvirt crashing or just exiting normally?

Comment 4 Osier Yang 2011-02-12 07:50:44 UTC
not crashing(no coredump), but exit alnormally, it didn't release subsys lock on shutdown event, useful logs pasted following:


Feb 10 00:33:38 dhcp-65-132 libvirtd: 00:33:38.733: 5342: error : virStateInitialize:1022 : Initialization of QEMU state driver failed
Feb 10 00:33:38 dhcp-65-132 kernel: lo: Disabled Privacy Extensions
Feb 10 00:33:38 dhcp-65-132 libvirtd: 00:33:38.749: 5342: info : virDomainLoadAllConfigs:8248 : Scanning for configs in /etc/libvirt/lxc
Feb 10 00:33:38 dhcp-65-132 libvirtd: 00:33:38.755: 5342: error : main:3305 : Driver state initialization failed
Feb 10 00:33:38 dhcp-65-132 libvirtd: 00:33:38.756: 5343: warning : qemudDispatchSignalEvent:403 : Shutting down on signal 3

Comment 5 Dave Allan 2011-02-14 19:44:40 UTC
Sounds like we should simply be disabling the qemu driver.  What do you think?

Comment 6 Daniel Berrangé 2011-02-14 19:53:03 UTC
No, the QEMU driver is expected to successfully start regardless of what QEMU version is installed, or indeed even if no QEMU is installed yet.  We need to fix the code which deals with 'qemu -M ?' since libvirt in general needs to support QEMUs without this feature.

Comment 7 Eric Blake 2011-02-14 19:56:55 UTC
Looks like this is a regression in commit 2211518:
2011-01-12 16:26 Eric Blake         * qemu: convert capabilities to use virCommand

Prior to that point, qemuCapsProbeMachineTypes silently ignored failure of 'qemu -M ?'; therefore, the obvious fix would be to pass a dummy status instead of NULL to virCommandRun.

Comment 8 Eric Blake 2011-02-14 20:03:05 UTC
Proposed upstream patch:
https://www.redhat.com/archives/libvir-list/2011-February/msg00468.html

Comment 12 zhanghaiyan 2011-02-18 06:36:34 UTC
The bug is reproduced with libvirt-0.8.7-7.el6.x86_64
- kernel-2.6.32-113.el6.x86_64
- qemu-kvm-0.12.1.2-2.145.el6.x86_64

The same test step and actual result with Description

Comment 13 Jiri Denemark 2011-04-05 13:03:24 UTC
Additional patch needed to fix this issue was sent for review: http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-April/msg00082.html

Comment 15 zhanghaiyan 2011-04-08 02:23:48 UTC
Verified this bug pass with libvirt-0.8.7-16.el6.x86_64
1. # virsh list --all
 Id Name                 State
----------------------------------
  - a10                  shut off
  - a11                  shut off
  - a12                  shut off
2. # rpm -ivh qemu-0.6.0-2.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:qemu                   ########################################### [100%]
3. # virsh list --all
 Id Name                 State
----------------------------------
  - a10                  shut off
  - a11                  shut off
  - a12                  shut off
4. # for i in {1..10}; do service libvirtd restart; done
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
Stopping libvirtd daemon:                                  [  OK  ]
...
5. # virsh list --all
 Id Name                 State
----------------------------------
  - a10                  shut off
  - a11                  shut off
  - a12                  shut off
6. # service libvirtd status
libvirtd (pid  8332) is running...

Comment 18 errata-xmlrpc 2011-05-19 13:26:59 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-0596.html


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