Bug 651341
Summary: | Delete snapshot of vm from parent to children will report an error | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | weizhang <weizhan> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | berrange, clalance, crobinso, eblake, itamar, jforbes, llim, lueshizhe, veillard, virt-maint, yoyzhang |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-12-01 17:21:15 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
weizhang
2010-11-09 10:25:57 UTC
HI, I make a patch for using libvirt-0.8.1. I have tried it. It is ok. --- libvirt-0.8.1/src/qemu/qemu_driver.c 2010-11-24 10:14:11.000000000 +0800 +++ libvirt-0.8.1.new/src/qemu/qemu_driver.c 2010-11-24 11:02:59.000000000 +0800 @@ -12733,13 +12733,11 @@ static int qemuDomainSnapshotDiscard(str parentsnap = virDomainSnapshotFindByName(&vm->snapshots, snap->def->parent); if (!parentsnap) { - qemuReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, - _("no domain snapshot parent with matching name '%s'"), - snap->def->parent); - goto cleanup; + VIR_FREE(snap->def->parent); + snap->def->parent = NULL; } - /* Now we set the new current_snapshot for the domain */ + /* Now we set the new current_snapshot for the domain , may be parentsnap is null*/ vm->current_snapshot = parentsnap; } else This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This should be fixed in 0.9.5, via this commit and a few others: commit cb231b4bee882213c77d360d2d8ff96851542b64 Author: Eric Blake <eblake> Date: Fri Aug 12 07:05:50 2011 -0600 snapshot: avoid crash when deleting qemu snapshots This one's nasty. Ever since we fixed virHashForEach to prevent nested hash iterations for safety reasons (commit fba550f6), virDomainSnapshotDelete with VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN has been broken for qemu: it deletes children, while leaving grandchildren intact but pointing to a no-longer-present parent. But even before then, the code would often appear to succeed to clean up grandchildren, but risked memory corruption if you have a large and deep hierarchy of snapshots. For acting on just children, a single virHashForEach is sufficient. But for acting on an entire subtree, it requires iteration; and since we declared recursion as invalid, we have to switch to a while loop. Doing this correctly requires quite a bit of overhaul, so I added a new helper function to isolate the algorithm from the actions, so that callers do not have to reinvent the iteration. |