于 2013/10/1 22:35, Eric Blake 写道:
On 09/25/2013 06:16 PM, Wenchao Xia wrote:
Since later this function will be used so improve it. The only caller of it
now is qemu-img, and it is not impacted by introduce function
bdrv_snapshot_load_tmp_by_id_or_name() that call bdrv_snapshot_load_tmp()
twice to keep old search logic. bdrv_snapshot_load_tmp_by_id_or_name() return
int to let caller know the errno, and errno will be used later.

Signed-off-by: Wenchao Xia<xiaw...@linux.vnet.ibm.com>
---
  block/qcow2-snapshot.c    |   16 +++++++++++-
  block/qcow2.h             |    5 +++-
  block/snapshot.c          |   58 +++++++++++++++++++++++++++++++++++++++++++-
  include/block/block_int.h |    4 ++-
  include/block/snapshot.h  |    7 ++++-
  qemu-img.c                |    8 ++++-
  6 files changed, 89 insertions(+), 9 deletions(-)

+ *
+ * If both @snapshot_id and @name are specified, load the first one with
+ * id @snapshot_id and name @name.
+ * If only @snapshot_id is specified, load the first one with id
+ * @snapshot_id.
+ * If only @name is specified, load the first one with name @name.
+ * if none is specified, return -ENINVAL.
s/ENINVAL/EINVAL/

+ *
+ * Returns: 0 on success, -errno on fail. If @bs is not inserted, return
+ * -ENOMEDIUM. If @bs is not readonly, return -EINVAL. If @bs did not support
+ * internal snapshot, return -ENOTSUP. If qemu can't find one matching @id and
+ * @name, return -ENOENT. If @bs do not support parameter @snapshot_id or
s/do/does/

will fix the grammar, thanks.


Reply via email to