diff mbox series

[2/2] dump: Fix HMP dump-guest-memory -z without -R

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

Commit Message

Markus Armbruster Nov. 8, 2023, 5:37 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>
---
 dump/dump-hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marc-André Lureau Nov. 8, 2023, 8:07 a.m. UTC | #1
On Wed, Nov 8, 2023 at 9:38 AM Markus Armbruster <armbru@redhat.com> wrote:
>
> -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: 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 {
> --
> 2.41.0
>
>
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 {