|
From: | Wenchao Xia |
Subject: | Re: [Qemu-devel] [PATCH 4/7] block: distinguish id and name in bdrv_find_snapshot() |
Date: | Sat, 27 Apr 2013 11:34:27 +0800 |
User-agent: | Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 |
δΊ 2013-4-26 22:34, Stefan Hajnoczi ει:
On Fri, Apr 26, 2013 at 05:31:12PM +0800, Wenchao Xia wrote:To make it clear about id and name in searching, the API is changed a bit to distinguish them, and caller can choose to search by id or name. If not found, *errp will be set to tip why. Note that the caller logic is changed a bit: 1) In del_existing_snapshots() called by do_savevm(), it travers twices/travers/traverse/ Also in comments in the code.
OK.
to find the snapshot, instead once, so matching sequence may change if there are unwisely chosen, mixed id and names. 2) In do_savevm(), same with del_existing_snapshot(), when it tries to find the snapshot to overwrite, matching sequence may change for same reason. 3) In load_vmstate(), first when it tries to find the snapshot to be loaded, sequence may change for the same reason of above. Later in validation, the logic is changed to be more strict to require both id and name matching. 4) In do_info_snapshot(), in validation, the logic is changed to be more strict to require both id and name matching.It's easy to avoid changing semantics: keep the old name or id behavior around. Use the new name-and-id behavior for #3 and #4.
You mean adding a new function, instead of change bdrv_find_snapshot()?
Please include a justification for breaking the search order.
-- Best Regards Wenchao Xia
[Prev in Thread] | Current Thread | [Next in Thread] |