kvm: kvm_init_vcpu take Error pointer
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 23 Jul 2020 16:09:15 +0000 (17:09 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 5 Oct 2020 14:41:22 +0000 (16:41 +0200)
commitd0a92b353efa2ca3c2847ad38f088b16d1278290
tree4462865ab7152fa62114783cd6702ae30ddcd5f6
parente0715f6abce0c04f68d35c4f6df2976ac57379c9
kvm: kvm_init_vcpu take Error pointer

Clean up the error handling in kvm_init_vcpu so we can see what went
wrong more easily.

Make it take an Error ** and fill it out with what failed, including
the cpu id, so you can tell if it only fails at a given ID.

Replace the remaining DPRINTF by a trace.

This turns a:
kvm_init_vcpu failed: Invalid argument

into:
kvm_init_vcpu: kvm_get_vcpu failed (256): Invalid argument

and with the trace you then get to see:

19049@1595520414.310107:kvm_init_vcpu index: 169 id: 212
19050@1595520414.310635:kvm_init_vcpu index: 170 id: 256
qemu-system-x86_64: kvm_init_vcpu: kvm_get_vcpu failed (256): Invalid argument

which makes stuff a lot more obvious.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200723160915.129069-1-dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c
accel/kvm/kvm-cpus.c
accel/kvm/kvm-cpus.h
accel/kvm/trace-events