[PATCH] virsh: Fix the order of format arguments in doDump

Han Han posted 1 patch 2 years, 8 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210713080412.941665-1-hhan@redhat.com
tools/virsh-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] virsh: Fix the order of format arguments in doDump
Posted by Han Han 2 years, 8 months ago
According to definition of virDomainCoreDumpFormat, the "elf" should be
the first argument in VIR_ENUM_*.

Fixes: 84cc4543be

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1981625

Signed-off-by: Han Han <hhan@redhat.com>
---
 tools/virsh-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index f2a5fb03a4..29748b0257 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -5412,10 +5412,10 @@ static const vshCmdOptDef opts_dump[] = {
 
 VIR_ENUM_IMPL(virDomainCoreDumpFormat,
               VIR_DOMAIN_CORE_DUMP_FORMAT_LAST,
+              "elf",
               "kdump-zlib",
               "kdump-lzo",
               "kdump-snappy",
-              "elf",
               "win-dmp");
 
 static void
-- 
2.31.1

Re: [PATCH] virsh: Fix the order of format arguments in doDump
Posted by Peter Krempa 2 years, 8 months ago
On Tue, Jul 13, 2021 at 16:04:12 +0800, Han Han wrote:
> According to definition of virDomainCoreDumpFormat, the "elf" should be
> the first argument in VIR_ENUM_*.
> 
> Fixes: 84cc4543be
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1981625
> 
> Signed-off-by: Han Han <hhan@redhat.com>
> ---
>  tools/virsh-domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>

and will be pushed shortly.

> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index f2a5fb03a4..29748b0257 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -5412,10 +5412,10 @@ static const vshCmdOptDef opts_dump[] = {
>  
>  VIR_ENUM_IMPL(virDomainCoreDumpFormat,

Not a problem with this patch, but the virsh macro definition should
start with 'virsh' or 'vsh' prefix instead of 'vir' which is reserved
for the internal library functions.

>                VIR_DOMAIN_CORE_DUMP_FORMAT_LAST,
> +              "elf",
>                "kdump-zlib",
>                "kdump-lzo",
>                "kdump-snappy",
> -              "elf",
>                "win-dmp");
>  
>  static void
> -- 
> 2.31.1
>