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 851452 - unexpected result of virsh save when stop libvirtd
Summary: unexpected result of virsh save when stop libvirtd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-24 08:41 UTC by yanbing du
Modified: 2013-02-21 07:21 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.10.2-0rc1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:21:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description yanbing du 2012-08-24 08:41:37 UTC
Description of problem:
When stop libvirtd service, then do virsh save domain, which get expected result.

Version-Release number of selected component (if applicable):
libvirt-0.10.0-0rc1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.#service libvird stop
2.#virsh save $domain_name
3.
  
Actual results:
# virsh save test /tmp/test.save
error: Failed to reconnect to the hypervisor
error: failed to get domain 'test'
error: invalid connection pointer in virDomainLookupByName
error: Failed to reconnect to the hypervisor


Expected results:
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

Additional info:
All other virsh commands can get the expected result. Such as:

# virsh restore /tmp/test.sav
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

# 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

# virsh start test
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

Comment 2 Peter Krempa 2012-08-31 14:29:52 UTC
Pulling back to 6.4 as it's now fixed upstream with:

commit 67f83cd497f277775d7fa519176d0e89546d668b
Author: Peter Krempa <pkrempa>
Date:   Fri Aug 24 13:57:01 2012 +0200

    virsh: remove unneeded usage of vshConnectionUsability()
    
    Now that vshCommandRun() checks for the connection automaticaly, remove
    all of the redundant checks in the code.
    
    vshConnectionUsability() no longer needs to be exported and this patch
    marks it static.

commit 70e608918ebf4251ee7124184a0512b968a80035
Author: Peter Krempa <pkrempa>
Date:   Fri Aug 24 12:39:53 2012 +0200

    virsh: Improve checking for connection when running commands
    
    Almost each virsh command uses the function vshConnectionUsability
    before doing anything, to check if the connection is "alive".  Commands
    that don't need an conection are already conveniently marked with
    VSH_CMD_FLAG_NOCONNECT. We can automaticaly check for the connection
    before calling any remote command so we don't forget to do so.
    
    This patch also upgrades the connection check to use virConnectIsAlive
    along with the current approach.

Problem described by this bug was present in 4 commands that use threads to watch progress of a job. Commands in question were: "save", "managedsave", "migrate" and "dump.

Moving to POST.

Comment 6 EricLee 2012-09-04 02:03:41 UTC
(In reply to comment #2)
> 
> Problem described by this bug was present in 4 commands that use threads to
> watch progress of a job. Commands in question were: "save", "managedsave",
> "migrate" and "dump.
> 
> Moving to POST.

Hi Peter,

Do you mean when libvirtd was disconnected, those four commands getting the info:
error: Failed to reconnect to the hypervisor
error: failed to get domain 'test'
error: invalid connection pointer in virDomainLookupByName
error: Failed to reconnect to the hypervisor
is the expected result?

Because I am verifing the bug, but get the same result with bug description using the newest package, and not sure the bug was fixed or not.

Thanks.

Comment 7 Peter Krempa 2012-09-04 08:14:03 UTC
Hi Eric,
yes it isn't fixed in the version you're testing. This bug was mistakenly marked as MODIFIED/ON_QA so I'm moving it back to POST and clearing the fixed in version field.

Comment 8 EricLee 2012-09-20 07:10:30 UTC
Verifying the bug:

Reproduction:
-------------
Reproduced this issue in env below. 
# rpm -qa libvirt qemu-kvm-rhev; uname -r
libvirt-0.9.10-21.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.295.el6.x86_64
2.6.32-279.el6.x86_64

Steps:
# virsh list 
 Id    Name                           State
----------------------------------------------------
 2     qcow2                          running

# service libvirtd stop
Stopping libvirtd daemon:                                  [  OK  ]

# virsh save qcow2 /tmp/qcow2.save
error: Failed to reconnect to the hypervisor
error: failed to get domain 'qcow2'
error: invalid connection pointer in virDomainLookupByName
error: Failed to reconnect to the hypervisor

# virsh managedsave qcow2
error: Failed to reconnect to the hypervisor
error: failed to get domain 'qcow2'
error: invalid connection pointer in virDomainLookupByName
error: Failed to reconnect to the hypervisor

# virsh dump qcow2 /tmp/qcow.dump
error: Failed to reconnect to the hypervisor
error: failed to get domain 'qcow2'
error: invalid connection pointer in virDomainLookupByName
error: Failed to reconnect to the hypervisor

# virsh migrate --live qcow2 qemu+ssh://10.66.5.143/system --verbose
error: Failed to reconnect to the hypervisor
error: failed to get domain 'qcow2'
error: invalid connection pointer in virDomainLookupByName
error: Failed to reconnect to the hypervisor

Result:
All of above four commands get unexpected error messages.

Verification:
-------------
Verified in env below with same steps as above.
# rpm -qa libvirt qemu-kvm-rhev; uname -r
qemu-kvm-rhev-0.12.1.2-2.312.el6.x86_64
libvirt-0.10.2-0rc1.el6.x86_64
2.6.32-303.el6.x86_64

Steps:
# virsh start raw
Domain raw started

# service libvirtd stop
Stopping libvirtd daemon:                                  [  OK  ]

# virsh save raw /tmp/raw.save
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

# virsh managedsave raw
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

# virsh dump raw /tmp/raw.dump
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

# virsh migrate --live raw qemu+ssh://10.66.6.38/system --verboseerror: 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


Result:
Get same expected error message as other virsh commands.


Conclusion:
-----------
As per above, this bug has been fixed.

Moving to VERIFIED.

Comment 9 errata-xmlrpc 2013-02-21 07:21:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0276.html


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