qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 11/11] savevm: remove backward compatibility fro


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 11/11] savevm: remove backward compatibility from bdrv_snapshot_find()
Date: Wed, 17 Apr 2013 12:22:25 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 04/17/2013 12:14 PM, Eric Blake wrote:

> Or, written another way, to implement the same results in only two coded
> loops:

Missed a line:

> 
>     if name is set:
>         if there is a snapshot with that name (loop 1):
>             if id is set:
>                 if id matches:
>                     end searching successfully
>                 else:
>                     fail
>             else:
>                 end searching successfully
>         else if id is not set:
>             set id to name

These two lines should instead be:

          else if id is set:
              fail
          set id to name

>     if there is a snapshot with id (loop 2):
>         end searching successfully

and of course, all of the algorithms have an implied fail if you make it
through all of the loops without a successful search end.

The tweak above is needed so that a find(id, tag) that fails a tag
lookup does not then succeed on an id lookup.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]