qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v9 07/13] iotests: prepare 124 and 257 bitmap qu


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v9 07/13] iotests: prepare 124 and 257 bitmap querying for backup-top filter
Date: Mon, 2 Sep 2019 18:10:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 29.08.19 15:22, Vladimir Sementsov-Ogievskiy wrote:
> 28.08.2019 19:40, Max Reitz wrote:
>> On 26.08.19 18:13, Vladimir Sementsov-Ogievskiy wrote:

[...]

>>> +
>>> +    def get_bitmap(self, bitmaps, node_name, name, recording=None):
>>> +        """
>>> +        get a specific bitmap from the object returned by query_bitmaps.
>>> +        :param recording: If specified, filter results by the specified 
>>> value.
>>> +        """
>>> +        if bitmaps is None:
>>> +            bitmaps = self.query_bitmaps()
>>> +
>>> +        for bitmap in bitmaps['bitmaps'][node_name]:
>>> +            if bitmap.get('name', '') == name:
>>> +                if recording is None:
>>> +                    return bitmap
>>> +                elif bitmap.get('recording') == recording:
>>> +                    return bitmap
>>
>> Maybe add a “break” or “return None” here?
>>
>> (Yes, yes, you just moved existing code.  Still.)
>>
> 
> No, as we may have several unnamed bitmaps, which should be selected by 
> "recording"..

Ah.  OK.  Now it all makes sense...

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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