Bug 797835

Summary: [libvirt]libvirtd crash when downgrade libvirt from libvirt 0.9.10-2 to 0.9.4-23
Product: Red Hat Enterprise Linux 6 Reporter: zhpeng
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, cwei, dallan, dyuan, jdenemar, jyang, laine, mzhan, rwu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-27 14:13:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description zhpeng 2012-02-27 11:06:01 UTC
Description of problem:
libvirtd crash when downgrade libvirt from libvirt 0.9.10-2 to 0.9.4-23

Version-Release number of selected component (if applicable):
libvirt-python-0.9.10-2.el6.x86_64
libvirt-client-0.9.10-2.el6.x86_64
libvirt-0.9.10-2.el6.x86_64

libvirt-python-0.9.4-23.el6_2.6.x86_64
libvirt-client-0.9.4-23.el6_2.6.x86_64
libvirt-0.9.4-23.el6_2.6.x86_64

How reproducible:
always

Steps to Reproduce:
[root@zhpeng Downloads]# rpm -qa|grep libvirt
libvirt-python-0.9.10-2.el6.x86_64
libvirt-client-0.9.10-2.el6.x86_64
libvirt-0.9.10-2.el6.x86_64

[root@zhpeng Downloads]# service libvirtd status
libvirtd (pid  13458) is running...

[root@zhpeng Downloads]# rpm -Uvh --oldpackage --force  libvirt-0.9.4-23.el6_2.6.x86_64.rpm libvirt-client-0.9.4-23.el6_2.6.x86_64.rpm libvirt-python-0.9.4-23.el6_2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:libvirt-client         ########################################### [ 33%]
   2:libvirt                warning: /etc/libvirt/libvirtd.conf created as /etc/libvirt/libvirtd.conf.rpmnew
########################################### [ 67%]
warning: %post(libvirt-0.9.4-23.el6_2.6.x86_64) scriptlet failed, exit status 1
   3:libvirt-python         ########################################### [100%]

[root@zhpeng Downloads]# service libvirtd status
libvirtd is stopped

[root@zhpeng Downloads]# /etc/init.d/libvirtd start
Starting libvirtd daemon:                                  [  OK  ]

[root@zhpeng Downloads]# /etc/init.d/libvirtd status
libvirtd (pid  13939) is running...

[root@zhpeng Downloads]# rpm -qa|grep libvirt
libvirt-python-0.9.4-23.el6_2.6.x86_64
libvirt-client-0.9.4-23.el6_2.6.x86_64
libvirt-0.9.4-23.el6_2.6.x86_64


Actual results:
libvirtd stopped.

Expected results:
At least libvirtd should be still running.

Additional info:

Comment 2 Dave Allan 2012-02-27 14:13:54 UTC
If you force install an RPM you'd better know what you are doing and be prepared to fix any resulting problems.  This is NOTABUG.

Comment 4 zhpeng 2012-04-06 08:51:31 UTC
Hi,
This time i use "yum downgrade" to test this.and find more issues:

Issue 1:

Steps:
#rpm -qa|grep libvirt
libvirt-0.9.10-10.el6.x86_64
libvirt-client-0.9.10-10.el6.x86_64
libvirt-python-0.9.10-10.el6.x86_64
# yum downgrade libvirt libvirt-client libvirt-python
...
 Installing : libvirt-client-0.9.4-23.el6.x86_64                               
          1/6 
  Installing : libvirt-0.9.4-23.el6.x86_64                                     
           2/6 
Non-fatal POSTIN scriptlet failure in rpm package libvirt-0.9.4-23.el6.x86_64
warning: /etc/libvirt/libvirtd.conf created as
/etc/libvirt/libvirtd.conf.rpmnew
warning: /etc/libvirt/qemu.conf created as /etc/libvirt/qemu.conf.rpmnew
warning: /etc/sysconfig/libvirtd created as /etc/sysconfig/libvirtd.rpmnew
warning: %post(libvirt-0.9.4-23.el6.x86_64) scriptlet failed, exit status 1
  Installing : libvirt-python-0.9.4-23.el6.x86_64                              
           3/6 
  Cleanup    : libvirt-python-0.9.10-10.el6.x86_64                             
           4/6 
  Cleanup    : libvirt-0.9.10-10.el6.x86_64                                    
           5/6 
  Cleanup    : libvirt-client-0.9.10-10.el6.x86_64                             
           6/6 
...
# service libvirtd status
libvirtd is stopped           ------> should running.
# virsh list
error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such
file or directory
# /etc/init.d/libvirtd restart
Stopping libvirtd daemon:                                  [FAILED]
Starting libvirtd daemon:                                  [  OK  ]

Issue 2:
I defined several guests when i use libvirt-0.9.10-10 and guest xml include usb
controller by default like:
...
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
function='0x2'/>
    </controller>
...
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     mig13                          shut off
 -     mig14                          shut off

# yum downgrade libvirt libvirt-client libvirt-python
# service libvirtd restart 
# virsh list --all
 Id Name                 State
----------------------------------   ---->guests disappear

# rpm -Uvh libvirt*0.9.10-10*
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     mig13                          shut off
 -     mig14                          shut off   ---->guests come back

Comment 5 Jiri Denemark 2012-04-10 05:59:56 UTC
I'm not sure why downgrading libvirt stopped the deamon instead of restarting it (it probably failed to start for some reason) but AFAIK downgrading libvirt is not supported in general. If you define some domains with the new libvirt, their XML configuration may contain things that older libvirt doesn't understand (controller type='usb' in this case). Thus the older libvirt will fail to parse those XMLs and they will be ignored.

Comment 6 Jiri Denemark 2012-04-10 10:38:00 UTC
BTW, there's a related discussion on libvirt-list: https://www.redhat.com/archives/libvir-list/2012-April/msg00352.html

Comment 7 Laine Stump 2012-04-23 19:41:24 UTC
I've opened Bug 815503 to deal specifically with the problem of migrating from a RHEL6.3 host to a RHEL6.2 host - that problem has the same cause, but is more serious due to the absence of any reasonable workaround.

Comment 8 dyuan 2012-04-25 03:45:56 UTC
Can we reopen this bug to track the downgrade issue until there is an explicit solution in libvir-list@ ?

Comment 9 Dave Allan 2012-04-25 15:22:45 UTC
There isn't any guarantee that downgrading libvirt will produce defined results, so this isn't a bug even when the downgrade is done with yum.  The problem appears to be that the old vesion doesn't accept some of the XML added by the new version, and there's no way to fix that.