Bug 489283
Summary: | virsh save $shutted-off-domain will get invalid domain pointer in no domain with matching id -1 | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Vivian Bian <vbian> |
Component: | libvirt | Assignee: | Daniel Veillard <veillard> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 5.4 | CC: | berrange, cpelland, llim, nzhang, ovirt-maint, virt-maint, xen-maint |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-09-02 09:23:33 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Vivian Bian
2009-03-09 10:33:59 UTC
This is merely a mis-leading error message. The 'save' operation is intended to fail for inactive domains, since there is no VM to save. We should give a better error message though. The problem is in the QEMU driver which does qemuDriverLock(driver); vm = virDomainFindByID(&driver->domains, dom->id); if (!vm) { qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN, _("no domain with matching id %d"), dom->id); goto cleanup; } if (!virDomainIsActive(vm)) { qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, "%s", _("domain is not running")); goto cleanup; } It never gets to the 'IsActive' check because the lookup-by-ID fails first. We should really never do a lookup-by-ID in the driver. If we switched this code to use virDomainFindByUUID, then the second more useful error message would be returned. Moving to RHEL since libvirt is not supported in RHEV1.0 production builds and this problem will need to be addressed in RHEL5.4 release Note that with Xen as the hypervisor the output is correct: [root@test2 ~]# virsh save test /tmp/test.mem error: Failed to save domain test to /tmp/test.mem error: invalid argument in Domain test isn't running. [root@test2 ~]# Once rebooted to use KVM instead the error shows up: [root@test2 ~]# virsh save kvmtest /tmp/kvmtest.mem error: Failed to save domain kvmtest to /tmp/kvmtest.mem error: invalid domain pointer in no domain with matching id -1 [root@test2 ~]# but the ID -> UUID lookup has been implemented upstream so in the final version with libvirt-0.6.3 this should be fixed: [root@test2 ~]# virsh save kvmtest /tmp/kvmtest.mem error: Failed to save domain kvmtest to /tmp/kvmtest.mem error: operation failed: domain is not running [root@test2 ~]# This will be modified as soon as 0.6.3 is pushed, Daniel Modified with push of libvirt-0.6.3-1.el5 in dist-5E-qu-candidate Daniel This has been verified in libvirt 0.6.3-3 on rhel-5.4. Already fixed. Verified steps: # virsh list --all Id Name State ---------------------------------- - demo shut off # virsh save demo test123 error: Failed to save domain demo to test123 error: operation failed: domain is not running 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/RHEA-2009-1269.html |