[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [RFC PATCH] snapshot: better virsh handling of missing current, parent

On 10/04/2011 12:54 PM, Laine Stump wrote:
On 09/30/2011 12:19 PM, Eric Blake wrote:
Previously, virsh 'snapshot-parent' and 'snapshot-current' were
completely silent in the case where the code conclusively proved
there was no parent or current snapshot, but differed in exit
status; this silence caused some confusion on whether the commands
worked. Furthermore, commit d1be48f introduced a regression where
snapshot-parent would leak output about an unknown function, but
only on the first attempt, when talking to an older server that
lacks virDomainSnapshotGetParent. This changes things to consistenly
report an error message and exit with status 1 when no snapshot
exists, and to avoid leaking unknown function warnings when using

Preferences? (I guess mine is approach 1, by evidence of this patch).

The code all looks fine, so ACK to that. Not being very familiar with
the snapshot stuff, I can't say that I have an valid opinion on whether
it's better to log an error or exit silently when there is no parent. I
guess I would defer to your opinion, since you're the person who's spent
the most time dealing with snapshots lately :-)

I went ahead and pushed this as-is, on the basis that a common usage pattern, virsh snapshot-revert dom $(virsh snapshot-current --name), will do the right thing when there is no stdout, whether or not stderr was supplied, but having stderr available can help understand the situation when using the command in isolation.

Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]