dump: Fix issues flagged by Coverity
cover dump: Fix issues flagged by Coverity
Markus Armbruster (2):
dump: Plug file descriptor leak on non-seekable file
dump: Fix HMP dump-guest-memory -z without -R
dump/dump-hmp-cmds.c | 2 +- dump/dump.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.41.0
PATCH 1/2 dump: Plug file descriptor leak on non-seekable file
--- dump/dump.c | 1 + 1 file changed, 1 insertion(+)
dump/dump.c +1 -0
@@ -2160,6 +2160,7 @@ void qmp_dump_guest_memory(bool paging, const char *protocol,return ; }if (kdump_raw &&lseek (fd,0 ,SEEK_CUR ) == (off_t) -1 ) { +close (fd);error_setg (errp,"kdump-raw formats require a seekable file" );return ; }
Signature · 1 line
2.41.0
Re: [PATCH 1/2] dump: Plug file descriptor leak on non-seekable file
Hi
Quoted 13 lines · Markus Armbruster
Fixes e6549197f7ed (dump: Add command interface for kdump-raw formats)Fixes CID 1523842Signed-off-by Markus Armbruster <[email protected]>--- dump/dump.c | 1 + 1 file changed, 1 insertion(+)dump/dump.c +0
-0
dump/dump.c void qmp_dump_guest_memory(bool paging, const char *protocol,
Quoted 8 lines
dump/dump.c +1
-1@@ -2160,6 +2160,7 @@ void qmp_dump_guest_memory(bool paging, const char *protocol,return ; }if (kdump_raw &&lseek (fd,0 ,SEEK_CUR ) == (off_t) -1 ) { +close (fd);error_setg (errp,"kdump-raw formats require a seekable file" );return ; } --
already queued for merge in:
[PULL 75/75] dump: Add close fd on error return to avoid resource leak
PATCH 2/2 dump: Fix HMP dump-guest-memory -z without -R
In reply to Markus Armbruster-z without -R has no effect: the dump format remains @elf. Fix the logic error so it becomes @kdump-zlib.
--- dump/dump-hmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
dump/dump-hmp-cmds.c +1 -1
@@ -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.41.0
Re: [PATCH 2/2] dump: Fix HMP dump-guest-memory -z without -R
Quoted 7 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 1523841Signed-off-by Markus Armbruster <[email protected]>
Quoted 21 lines
--- dump/dump-hmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)dump/dump-hmp-cmds.c +1
-2@@ -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
Signature · 1 line
Marc-André Lureau
Quoted 3 lines · Markus Armbruster
Markus Armbruster (2):
dump: Plug file descriptor leak on non-seekable file
dump: Fix HMP dump-guest-memory -z without -R
Hi Markus,
I'm a bit late on the uptake here as these are already queued, but thank you so much for finding and fixing my issues. Sorry for the extra work.
Quoted 9 lines · Stephen Brennan
Quoted 3 lines · Markus Armbruster
Markus Armbruster (2):
dump: Plug file descriptor leak on non-seekable file
dump: Fix HMP dump-guest-memory -z without -RHi Markus,
I'm a bit late on the uptake here as these are already queued, but thank you so much for finding and fixing my issues. Sorry for the extra work.
Happens :)
Quoted 1 line
Reviewed-by Stephen Brennan <[email protected]>
Thanks!