[libvirt] [PATCH v2 0/3] use virStringParseYesNo helper

Mao Zhongyi posted 3 patches 5 years, 1 month ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1571281133.git.maozhongyi@cmss.chinamobile.com
src/conf/domain_conf.c           | 35 ++++++++++++--------------------
src/conf/network_conf.c          |  4 +---
src/qemu/qemu_migration_params.c |  7 +------
3 files changed, 15 insertions(+), 31 deletions(-)
[libvirt] [PATCH v2 0/3] use virStringParseYesNo helper
Posted by Mao Zhongyi 5 years, 1 month ago
A function virStringParseYesNo was added to convert
string 'yes' to true and 'no' to false, so use this
helper to replace 'STREQ(.*, \"yes\")' and
'STREQ(.*, \"no\")' as it allows us to drop several
repetitive if-then-else string->bool conversion blocks.

v2->v1

p1:
- ignore the return value of virStringParseYesNo.
- update the commit message.   [Michal Privoznik]

p2:
- add the Acked-by tag.

p3:
- pass return value of helper to rc directly.
                              [Michal Privoznik]

Mao Zhongyi (3):
  conf/domain_conf: use virStringParseYesNo helper
  conf/network_conf: use virStringParseYesNo helper
  qemu/qemu_migration_params: use virStringParseYesNo helper

 src/conf/domain_conf.c           | 35 ++++++++++++--------------------
 src/conf/network_conf.c          |  4 +---
 src/qemu/qemu_migration_params.c |  7 +------
 3 files changed, 15 insertions(+), 31 deletions(-)

-- 
2.17.1



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 0/3] use virStringParseYesNo helper
Posted by Cole Robinson 5 years ago
On 10/16/19 11:19 PM, Mao Zhongyi wrote:
> A function virStringParseYesNo was added to convert
> string 'yes' to true and 'no' to false, so use this
> helper to replace 'STREQ(.*, \"yes\")' and
> 'STREQ(.*, \"no\")' as it allows us to drop several
> repetitive if-then-else string->bool conversion blocks.
> 
> v2->v1
> 
> p1:
> - ignore the return value of virStringParseYesNo.
> - update the commit message.   [Michal Privoznik]
> 
> p2:
> - add the Acked-by tag.
> 
> p3:
> - pass return value of helper to rc directly.
>                               [Michal Privoznik]
> 
> Mao Zhongyi (3):
>   conf/domain_conf: use virStringParseYesNo helper
>   conf/network_conf: use virStringParseYesNo helper
>   qemu/qemu_migration_params: use virStringParseYesNo helper
> 
>  src/conf/domain_conf.c           | 35 ++++++++++++--------------------
>  src/conf/network_conf.c          |  4 +---
>  src/qemu/qemu_migration_params.c |  7 +------
>  3 files changed, 15 insertions(+), 31 deletions(-)
> 

Reviewed-by: Cole Robinson <crobinso@redhat.com>

And pushed

Thanks,
Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list