[PATCH 00/23] virsh: various small cleanups

Peter Krempa posted 23 patches 2 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1646229193.git.pkrempa@redhat.com
Test syntax-check failed
po/POTFILES.in                 |    1 +
tools/meson.build              |    1 +
tools/virsh-completer-domain.c |   19 -
tools/virsh-completer-domain.h |    5 -
tools/virsh-domain-event.c     | 1007 ++++++++++++++++++++
tools/virsh-domain-event.h     |   23 +
tools/virsh-domain.c           | 1623 +++++++-------------------------
tools/virsh-util.c             |   19 +
tools/virsh-util.h             |    5 +
tools/virsh.c                  |    2 +
tools/virsh.h                  |    1 +
tools/vsh.c                    |   25 +-
tools/vsh.h                    |    3 +
13 files changed, 1412 insertions(+), 1322 deletions(-)
create mode 100644 tools/virsh-domain-event.c
create mode 100644 tools/virsh-domain-event.h
[PATCH 00/23] virsh: various small cleanups
Posted by Peter Krempa 2 years, 1 month ago
A collection of mostly small patches caused by the geopolitically
induced attention span shortening.

Peter Krempa (23):
  virsh: cmdBlockcopy: Use virXMLFormatElement
  virsh: cmdStart: Rewrite ternary operator use to standard if
    conditions
  virsh: doSave: Use if-else instead of ternary operator
  virsh: cmdRestore: Use if-else instead of ternary operator
  virsh: virshVcpuinfoPrintAffinity: Use if-else instead of ternary
    operator
  virsh: Use NULLSTR_EMPTY instead of ternary operator
  virshEventPrint: Use automatic memory clearing
  virsh: Move 'virshDomainBlockJobToString' to virsh-util
  virsh: Move 'cmdEvent' and all of it's machinery to
    virsh-domain-event.c
  virsh: cmdEvent: Rewrite questionable event registration
  virsh: cmdDomDisplay: Extract loop body fetching display URIs into
    'virshGetOneDisplay'
  virsh: cmdDomDisplay: Remove unneeded 'cleanup' label
  virshGetOneDisplay: Automaticaly free extracted data
  virshGetOneDisplay: Don't reuse 'xpath' variable
  virshGetOneDisplay: Refactor formatting of URI params
  virsh: cmdSchedinfo: Add separate variable for holding flags used for
    query
  virsh: cmdDesc: Use separate flags variable for getters
  vsh: Add helper for auto-removing temporary file
  virsh: cmdDesc: Use 'vshTempFile' type to simplify cleanup
  virsh: cmdDesc: Automatically free memory
  virsh: cmdDesc: Remove unneeded 'cleanup'
  virsh: domain: Don't use ternaries inside vshPrint/vshError functions
  virsh: cmdDesc: Fix logic when '-edit' is used along with 'desc'
    argument

 po/POTFILES.in                 |    1 +
 tools/meson.build              |    1 +
 tools/virsh-completer-domain.c |   19 -
 tools/virsh-completer-domain.h |    5 -
 tools/virsh-domain-event.c     | 1007 ++++++++++++++++++++
 tools/virsh-domain-event.h     |   23 +
 tools/virsh-domain.c           | 1623 +++++++-------------------------
 tools/virsh-util.c             |   19 +
 tools/virsh-util.h             |    5 +
 tools/virsh.c                  |    2 +
 tools/virsh.h                  |    1 +
 tools/vsh.c                    |   25 +-
 tools/vsh.h                    |    3 +
 13 files changed, 1412 insertions(+), 1322 deletions(-)
 create mode 100644 tools/virsh-domain-event.c
 create mode 100644 tools/virsh-domain-event.h

-- 
2.35.1
Re: [PATCH 00/23] virsh: various small cleanups
Posted by Ján Tomko 2 years, 1 month ago
On a Wednesday in 2022, Peter Krempa wrote:
>A collection of mostly small patches

[...]

>
>Peter Krempa (23):
>  virsh: cmdBlockcopy: Use virXMLFormatElement
>  virsh: cmdStart: Rewrite ternary operator use to standard if
>    conditions
>  virsh: doSave: Use if-else instead of ternary operator
>  virsh: cmdRestore: Use if-else instead of ternary operator
>  virsh: virshVcpuinfoPrintAffinity: Use if-else instead of ternary
>    operator
>  virsh: Use NULLSTR_EMPTY instead of ternary operator
>  virshEventPrint: Use automatic memory clearing
>  virsh: Move 'virshDomainBlockJobToString' to virsh-util
>  virsh: Move 'cmdEvent' and all of it's machinery to
>    virsh-domain-event.c
>  virsh: cmdEvent: Rewrite questionable event registration
>  virsh: cmdDomDisplay: Extract loop body fetching display URIs into
>    'virshGetOneDisplay'
>  virsh: cmdDomDisplay: Remove unneeded 'cleanup' label
>  virshGetOneDisplay: Automaticaly free extracted data
>  virshGetOneDisplay: Don't reuse 'xpath' variable
>  virshGetOneDisplay: Refactor formatting of URI params
>  virsh: cmdSchedinfo: Add separate variable for holding flags used for
>    query
>  virsh: cmdDesc: Use separate flags variable for getters
>  vsh: Add helper for auto-removing temporary file
>  virsh: cmdDesc: Use 'vshTempFile' type to simplify cleanup
>  virsh: cmdDesc: Automatically free memory
>  virsh: cmdDesc: Remove unneeded 'cleanup'
>  virsh: domain: Don't use ternaries inside vshPrint/vshError functions
>  virsh: cmdDesc: Fix logic when '-edit' is used along with 'desc'
>    argument
>
> po/POTFILES.in                 |    1 +
> tools/meson.build              |    1 +
> tools/virsh-completer-domain.c |   19 -
> tools/virsh-completer-domain.h |    5 -
> tools/virsh-domain-event.c     | 1007 ++++++++++++++++++++
> tools/virsh-domain-event.h     |   23 +
> tools/virsh-domain.c           | 1623 +++++++-------------------------
> tools/virsh-util.c             |   19 +
> tools/virsh-util.h             |    5 +
> tools/virsh.c                  |    2 +
> tools/virsh.h                  |    1 +
> tools/vsh.c                    |   25 +-
> tools/vsh.h                    |    3 +
> 13 files changed, 1412 insertions(+), 1322 deletions(-)
> create mode 100644 tools/virsh-domain-event.c
> create mode 100644 tools/virsh-domain-event.h

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano