On 03/11/2013 05:23 AM, Wenchao Xia wrote: > This patch adds a parameter to tell whether return valid snapshots > for whole VM only. > > Signed-off-by: Wenchao Xia <xiaw...@linux.vnet.ibm.com> > --- > block/qapi.c | 42 ++++++++++++++++++++++++++++++++++++++++-- > include/block/qapi.h | 1 + > qemu-img.c | 3 ++- > 3 files changed, 43 insertions(+), 3 deletions(-)
> + /* Check logic is connected with load_vmstate(): > + Only check the devices that can snapshot, other devices that can't > + take snapshot, for example, readonly ones, will be ignored in > + load_vmstate(). */ > + while ((bs1 = bdrv_next(bs1))) { > + if (bdrv_can_snapshot(bs1) && bs1 != bs) { Minor optimization - you could rearrange the conjunct and check 'bs1 != bs' first, to avoid the overhead of bdrv_can_snapshot on bs. But that doesn't stop me from giving: Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature