|
From: | Vladimir Sementsov-Ogievskiy |
Subject: | Re: [PATCH 02/14] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd' |
Date: | Mon, 19 Jul 2021 16:51:13 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 |
19.07.2021 15:58, Vladimir Sementsov-Ogievskiy wrote:
Could also be done with something like imgopts = os.environ.get('IMGOPTS')imgopts is a string after it. So you don't need to join it?opts = optstr2dict(','.join(([imgopts] if imgopts else []) + parsed.o))Build a string to be than parsed looks strange IMHO..Oh, but that's exactly what I should do anyway to cover several -o options. Now I see that what you write is correct.if parsed.f != 'qcow2' or (opts.get('compat') in ['v2', '0.10']): opts.pop('compression_type', None) (Never tested, of course) Because optstr2dict() prioritizes later options over earlier ones. (Which is good, because that’s also qemu-img’s behavior.)Ok, I'll think about this all when prepare v2, and we'll see how it goes
This way you also drop compression_type if test specify it. I think we shouldn't touch test specified options. Let it clearly fail instead. We only want to ignore compression_type in IMGOPTS when create non-qcow2 image. I think I'll drop checking for compat: the only user for this check ic 065 and it's simpler to explicitly set compression_type in it even for compat=0.10 cases. -- Best regards, Vladimir
[Prev in Thread] | Current Thread | [Next in Thread] |