[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/35] vl.c: Fix Coverity complaining for vmstate_dum
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 18/35] vl.c: Fix Coverity complaining for vmstate_dump_file |
Date: |
Fri, 31 Oct 2014 18:25:56 +0100 |
From: Gonglei <address@hidden>
commit abfd9ce3(migration: dump vmstate info as a json
file for static analysis) introduce a new command,
'-dump-vmstate', that takes a filename
as an argument. When executed, QEMU will dump the vmstate information
for the machine type it's invoked with to the file, and quit.
However, only one instance of the -dump-vmstate option is supported.
If more were given, the vmstate_dump_file variable would be overwritten.
This fix also helps silence a Coverity error.
Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
vl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/vl.c b/vl.c
index f5721d1..f070c90 100644
--- a/vl.c
+++ b/vl.c
@@ -3750,6 +3750,11 @@ int main(int argc, char **argv, char **envp)
configure_msg(opts);
break;
case QEMU_OPTION_dump_vmstate:
+ if (vmstate_dump_file) {
+ fprintf(stderr, "qemu: only one '-dump-vmstate' "
+ "option may be given\n");
+ exit(1);
+ }
vmstate_dump_file = fopen(optarg, "w");
if (vmstate_dump_file == NULL) {
fprintf(stderr, "open %s: %s\n", optarg, strerror(errno));
--
1.8.3.1
- [Qemu-devel] [PULL 08/35] megasas: Fix typo in megasas_dcmd_ld_get_list(), (continued)
- [Qemu-devel] [PULL 08/35] megasas: Fix typo in megasas_dcmd_ld_get_list(), Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 09/35] megasas: Decode register names, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 10/35] megasas: Clear unit attention on initial reset, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 11/35] megasas: Ignore duplicate init_firmware commands, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 12/35] megasas: Implement DCMD_CLUSTER_RESET_LD, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 13/35] megasas: Update queue logging, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 14/35] megasas: Rework frame queueing algorithm, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 15/35] megasas: Fixup MSI-X handling, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 16/35] -machine vmport=off: Allow disabling of VMWare ioport emulation, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 17/35] Add skip_dump flag to ignore memory region during dump, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 18/35] vl.c: Fix Coverity complaining for vmstate_dump_file,
Paolo Bonzini <=
- [Qemu-devel] [PULL 19/35] kvmvapic: patch_instruction fix, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 20/35] iscsi: Refuse to open as writable if the LUN is write protected, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 21/35] virtio-scsi: Fix memory leak when realize failed, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 22/35] scsi: devirtualize unrealize of SCSI devices, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 23/35] virtio-scsi: Fix num_queue input validation, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 24/35] kvm_stat: Only consider online cpus, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 25/35] kvm_stat: Fix the non-x86 exit reasons, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 26/35] kvm_stat: Rework platform detection, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 27/35] kvm_stat: Abstract ioctl numbers, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 28/35] kvm_stat: Add powerpc support, Paolo Bonzini, 2014/10/31