qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 03/17] iotests: ask qemu for supported formats


From: Roman Kagan
Subject: Re: [Qemu-block] [PATCH 03/17] iotests: ask qemu for supported formats
Date: Wed, 30 May 2018 16:07:25 +0300
User-agent: Mutt/1.9.5 (2018-04-13)

On Wed, May 30, 2018 at 02:17:55PM +0200, Max Reitz wrote:
> On 2018-04-26 18:19, Roman Kagan wrote:
> > @@ -550,13 +561,26 @@ def verify_cache_mode(supported_cache_modes=[]):
> >      if supported_cache_modes and (cachemode not in supported_cache_modes):
> >          notrun('not suitable for this cache mode: %s' % cachemode)
> >  
> > +rw_formats = None
> > +
> > +def supports_format(format_name):
> > +    format_message = qemu_pipe('-drive', 'format=?')
> > +    global rw_formats
> > +    if rw_formats is None:
> > +        rw_formats = format_message.splitlines()[0].split(':')[1].split()
> 
> Isn't it sufficient to call qemu_pipe() only if rw_formats is None?

Sure it is, and this was exactly my intention with this global, but I
managed to forget moving the most relevant part under 'if' :$

Thanks for catching,
Roman.



reply via email to

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