[PATCH] storage: pool: Allow more intricate nfs protocol versions

Michal Prívozník mprivozn at redhat.com
Fri Jun 24 12:07:09 UTC 2022


On 6/24/22 13:11, Ján Tomko wrote:
> On a Thursday in 2022, Peter Krempa wrote:
>> Treat the 'protocolVer' field as a string so that e.g. '4.1' can be
>> used.
>>
>> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>> ---
>> src/conf/schemas/storagepool.rng                   |  4 +---
>> src/conf/storage_conf.c                            | 14 +++-----------
>> src/conf/storage_conf.h                            |  2 +-
>> src/storage/storage_util.c                         |  4 ++--
>> .../pool-netfs-protocol-ver-linux.argv             |  2 +-
>> .../pool-netfs-protocol-ver.xml                    |  2 +-
>> .../pool-netfs-protocol-ver.xml                    |  2 +-
>> 7 files changed, 10 insertions(+), 20 deletions(-)
>>
>> @@ -643,12 +643,6 @@ virStoragePoolDefParseSource(xmlXPathContextPtr
>> ctxt,
>>                           
>> virStoragePoolFormatFileSystemNetTypeToString(source->format));
>>             return -1;
>>         }
>> -        if (virStrToLong_uip(ver, NULL, 0, &source->protocolVer) < 0) {
>> -            virReportError(VIR_ERR_XML_ERROR,
>> -                           _("storage pool protocol ver '%s' is
>> malformed"),
>> -                           ver);
>> -            return -1;
>> -        }
> 
> This removes any validation of the field...

Coincidentally, we have virStringParseVersion(). Just my 2 eurocents.

Michal



More information about the libvir-list mailing list