Re: [PATCH 28/28] qemu-img: extend cvtnum() and use it in more places

2024-02-26 Thread Michael Tokarev
22.02.2024 00:16, Michael Tokarev wrote: -static int64_t cvtnum_full(const char *name, const char *value, int64_t min, - int64_t max) +static int64_t cvtnum_full(const char *name, const char *value, + bool issize, int64_t min, int64_t max) {

Re: [PATCH 28/28] qemu-img: extend cvtnum() and use it in more places

2024-02-26 Thread Daniel P . Berrangé
On Thu, Feb 22, 2024 at 12:16:09AM +0300, Michael Tokarev wrote: > cvtnum() expects input string to specify some sort of size > (optionally with KMG... suffix). However, there are a lot > of other number conversions in there (using qemu_strtol &Co), > also, not all conversions which use cvtnum, ac

[PATCH 28/28] qemu-img: extend cvtnum() and use it in more places

2024-02-21 Thread Michael Tokarev
cvtnum() expects input string to specify some sort of size (optionally with KMG... suffix). However, there are a lot of other number conversions in there (using qemu_strtol &Co), also, not all conversions which use cvtnum, actually expects size, - like dd count=nn. Add bool issize argument to cvt