[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUSta
|
From: |
Andreas Färber |
|
Subject: |
Re: [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState |
|
Date: |
Thu, 02 Jul 2015 18:18:34 +0200 |
|
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
Hi,
This patch is clearly against QEMU, please name it "cpu: Add crash_...".
(You may want to take a second look at the non-CPU patches, too.)
Am 02.07.2015 um 18:07 schrieb Denis V. Lunev:
> From: Andrey Smetanin <address@hidden>
>
> CPUState->crash_occurred value inside CPUState marks
"CPUState::crash_occurred field inside ..."
> that guest crash occurred. This value added into cpu common
"value is added"
> migration subsection.
>
> Signed-off-by: Andrey Smetanin <address@hidden>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Paolo Bonzini <address@hidden>
> CC: Andreas Färber <address@hidden>
> ---
> exec.c | 19 +++++++++++++++++++
> include/qom/cpu.h | 1 +
> vl.c | 3 +++
> 3 files changed, 23 insertions(+)
>
> diff --git a/exec.c b/exec.c
> index f7883d2..adf49e8 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -465,6 +465,24 @@ static const VMStateDescription
> vmstate_cpu_common_exception_index = {
> }
> };
>
> +static bool cpu_common_crash_occurred_needed(void *opaque)
> +{
> + CPUState *cpu = opaque;
> +
> + return cpu->crash_occurred != 0;
> +}
> +
> +static const VMStateDescription vmstate_cpu_common_crash_occurred = {
> + .name = "cpu_common/crash_occurred",
> + .version_id = 1,
> + .minimum_version_id = 1,
> + .needed = cpu_common_crash_occurred_needed,
> + .fields = (VMStateField[]) {
> + VMSTATE_UINT32(crash_occurred, CPUState),
> + VMSTATE_END_OF_LIST()
> + }
> +};
> +
> const VMStateDescription vmstate_cpu_common = {
> .name = "cpu_common",
> .version_id = 1,
> @@ -478,6 +496,7 @@ const VMStateDescription vmstate_cpu_common = {
> },
> .subsections = (const VMStateDescription*[]) {
> &vmstate_cpu_common_exception_index,
> + &vmstate_cpu_common_crash_occurred,
> NULL
> }
> };
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 39f0f19..f559a69 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -263,6 +263,7 @@ struct CPUState {
> bool created;
> bool stop;
> bool stopped;
> + uint32_t crash_occurred;
> volatile sig_atomic_t exit_request;
> uint32_t interrupt_request;
> int singlestep_enabled;
If you add this field to CPUState, you'll also need to reset it in
qom/cpu.c. Or is it intentionally persistent?
Looks good otherwise.
Regards,
Andreas
> diff --git a/vl.c b/vl.c
> index 38eee1f..9e0aee5 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1723,6 +1723,9 @@ void qemu_system_reset(bool report)
>
> void qemu_system_guest_panicked(void)
> {
> + if (current_cpu) {
> + current_cpu->crash_occurred = 1;
> + }
> qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort);
> vm_stop(RUN_STATE_GUEST_PANICKED);
> }
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)
- [Qemu-devel] [PATCH v5 0/12] HyperV equivalent of pvpanic driver, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 03/12] kvm: add hyper-v crash msrs values, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 04/12] kvm/x86: added hyper-v crash msrs into kvm hyperv context, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 02/12] kvm: introduce vcpu_debug = kvm_debug + vcpu context, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 06/12] kvm/x86: mark hyper-v crash msrs as partition wide, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 01/12] kvm/x86: move Hyper-V MSR's/hypercall code into hyperv.c file, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 10/12] qemu/kvm: added kvm system event crash handler, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 07/12] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState, Denis V. Lunev, 2015/07/02
- Re: [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState,
Andreas Färber <=
- [Qemu-devel] [PATCH 09/12] qemu: added qemu_system_guest_panicked() - generic guest panic handler, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 08/12] kvm/x86: add sending hyper-v crash notification to user space, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 05/12] kvm: added KVM_REQ_HV_CRASH value to notify qemu about hyper-v crash, Denis V. Lunev, 2015/07/02
- [Qemu-devel] [PATCH 12/12] qemu/kvm/x86: hyper-v crash msrs set/get'ers and migration, Denis V. Lunev, 2015/07/02