diff mbox series

[v2,1/1] dump: Fix HMP dump-guest-memory -z without -R

Message ID 20231222093827.951039-2-armbru@redhat.com
State New
Headers show
Series dump: Fix issues flagged by Coverity | expand

Commit Message

Markus Armbruster Dec. 22, 2023, 9:38 a.m. UTC
-z without -R has no effect: the dump format remains @elf.  Fix the
logic error so it becomes @kdump-zlib.

Fixes: e6549197f7ed (dump: Add command interface for kdump-raw formats)
Fixes: CID 1523841
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stephen Brennan <stephen.s.brennan@oracle.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 dump/dump-hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Markus Armbruster Jan. 11, 2024, 12:34 p.m. UTC | #1
Any takers?

Markus Armbruster <armbru@redhat.com> writes:

> -z without -R has no effect: the dump format remains @elf.  Fix the
> logic error so it becomes @kdump-zlib.
>
> Fixes: e6549197f7ed (dump: Add command interface for kdump-raw formats)
> Fixes: CID 1523841
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Stephen Brennan <stephen.s.brennan@oracle.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  dump/dump-hmp-cmds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c
> index b428ec33df..d9340427c3 100644
> --- a/dump/dump-hmp-cmds.c
> +++ b/dump/dump-hmp-cmds.c
> @@ -41,7 +41,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
>          dump_format = DUMP_GUEST_MEMORY_FORMAT_WIN_DMP;
>      }
>  
> -    if (zlib && raw) {
> +    if (zlib) {
>          if (raw) {
>              dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_ZLIB;
>          } else {
Marc-André Lureau Jan. 11, 2024, 3:10 p.m. UTC | #2
Hi Markus

On Thu, Jan 11, 2024 at 4:36 PM Markus Armbruster <armbru@redhat.com> wrote:
>
> Any takers?
>

I have it in my "dump" queue, but it's the only patch I got so far (I
could have missed others).

If it can go through my other means, that's fine with me

> Markus Armbruster <armbru@redhat.com> writes:
>
> > -z without -R has no effect: the dump format remains @elf.  Fix the
> > logic error so it becomes @kdump-zlib.
> >
> > Fixes: e6549197f7ed (dump: Add command interface for kdump-raw formats)
> > Fixes: CID 1523841
> > Signed-off-by: Markus Armbruster <armbru@redhat.com>
> > Reviewed-by: Stephen Brennan <stephen.s.brennan@oracle.com>
> > Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  dump/dump-hmp-cmds.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c
> > index b428ec33df..d9340427c3 100644
> > --- a/dump/dump-hmp-cmds.c
> > +++ b/dump/dump-hmp-cmds.c
> > @@ -41,7 +41,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
> >          dump_format = DUMP_GUEST_MEMORY_FORMAT_WIN_DMP;
> >      }
> >
> > -    if (zlib && raw) {
> > +    if (zlib) {
> >          if (raw) {
> >              dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_ZLIB;
> >          } else {
>
>
Markus Armbruster Jan. 11, 2024, 4:05 p.m. UTC | #3
Marc-André Lureau <marcandre.lureau@gmail.com> writes:

> Hi Markus
>
> On Thu, Jan 11, 2024 at 4:36 PM Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Any takers?
>>
>
> I have it in my "dump" queue, but it's the only patch I got so far (I
> could have missed others).
>
> If it can go through my other means, that's fine with me

Let's try qemu-trivial (cc'ed).  Thanks!

>> Markus Armbruster <armbru@redhat.com> writes:
Michael Tokarev Jan. 17, 2024, 8:28 a.m. UTC | #4
22.12.2023 12:38, Markus Armbruster :
> -z without -R has no effect: the dump format remains @elf.  Fix the
> logic error so it becomes @kdump-zlib.
> 
> Fixes: e6549197f7ed (dump: Add command interface for kdump-raw formats)
> Fixes: CID 1523841
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Stephen Brennan <stephen.s.brennan@oracle.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Applied to trivial-patches tree, thanks!

/mjt
diff mbox series

Patch

diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c
index b428ec33df..d9340427c3 100644
--- a/dump/dump-hmp-cmds.c
+++ b/dump/dump-hmp-cmds.c
@@ -41,7 +41,7 @@  void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
         dump_format = DUMP_GUEST_MEMORY_FORMAT_WIN_DMP;
     }
 
-    if (zlib && raw) {
+    if (zlib) {
         if (raw) {
             dump_format = DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_ZLIB;
         } else {