• E
    snapshot: don't leak resources on qemu snapshot failure · 861dc84b
    Eric Blake 提交于
    https://bugzilla.redhat.com/show_bug.cgi?id=727709
    mentions that if qemu fails to create the snapshot (such as what
    happens on Fedora 15 qemu, which has qmp but where savevm is only
    in hmp, and where libvirt is old enough to not try the hmp fallback),
    then 'virsh snapshot-list dom' will show a garbage snapshot entry,
    and the libvirt internal directory for storing snapshot metadata
    will have a bogus file.
    
    This fixes the fallout bug of polluting the snapshot-list with
    garbage on failure (the root cause of the F15 bug of not having
    fallback to hmp has already been fixed in newer libvirt releases).
    
    * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Allocate
    memory before making snapshot, and cleanup on failure.  Don't
    dereference NULL if transient domain exited during snapshot creation.
    861dc84b
qemu_driver.c 291.3 KB