Skip to contentSkip to conversation

dump: Fix issues flagged by Coverity

PATCH Applied Markus Armbruster 3 participants 6 messages Dec 22, 2023 – Jan 17, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover dump: Fix issues flagged by Coverity

v2:
* PATCH 1 superseded by commit 95a40c44501 (dump: Add close fd on error return to avoid resource leak)
* PATCH 2 fell through the cracks; reposting unchanged

Markus Armbruster (1):
dump: Fix HMP dump-guest-memory -z without -R

 dump/dump-hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/1 dump: Fix HMP dump-guest-memory -z without -R

-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
---
 dump/dump-hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dump/dump-hmp-cmds.c +1 -1
index b428ec33df..d9340427c3 100644
@@ -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 {
Signature · 1 line
2.43.0
#2 lore raw

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

Any takers?

Quoted 25 lines · 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
---
 dump/dump-hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dump/dump-hmp-cmds.c +1 -1
index b428ec33df..d9340427c3 100644
@@ -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 {
#3 lore raw

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

Hi Markus

Quoted 3 lines · Markus Armbruster

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

Quoted 29 lines
Quoted 25 lines · 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
---
 dump/dump-hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dump/dump-hmp-cmds.c +1 -1
index b428ec33df..d9340427c3 100644
@@ -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 {
Signature · 1 line
Marc-André Lureau
#4 lore raw

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

Quoted 11 lines · Marc-André Lureau

Hi Markus

Quoted 3 lines · Markus Armbruster

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!

Quoted 1 line
Quoted 1 line

Markus Armbruster <[email protected]> writes:

#5 lore raw

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

In reply to Markus Armbruster

22.12.2023 12:38, Markus Armbruster :

Quoted 8 lines

-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

Applied to trivial-patches tree, thanks!

/mjt