From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAhCD-00029D-RT for qemu-devel@nongnu.org; Thu, 02 Jul 2015 12:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAhC8-0001li-IU for qemu-devel@nongnu.org; Thu, 02 Jul 2015 12:18:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46820 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAhC8-0001lb-8z for qemu-devel@nongnu.org; Thu, 02 Jul 2015 12:18:36 -0400 Message-ID: <5595645A.6070402@suse.de> Date: Thu, 02 Jul 2015 18:18:34 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1435853275-5440-1-git-send-email-den@openvz.org> <1435853275-5440-12-git-send-email-den@openvz.org> In-Reply-To: <1435853275-5440-12-git-send-email-den@openvz.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Andrey Smetanin , Paolo Bonzini , qemu-devel@nongnu.org, kvm@vger.kernel.org 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 >=20 > 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. >=20 > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Andreas F=C3=A4rber > --- > exec.c | 19 +++++++++++++++++++ > include/qom/cpu.h | 1 + > vl.c | 3 +++ > 3 files changed, 23 insertions(+) >=20 > 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 =3D { > } > }; > =20 > +static bool cpu_common_crash_occurred_needed(void *opaque) > +{ > + CPUState *cpu =3D opaque; > + > + return cpu->crash_occurred !=3D 0; > +} > + > +static const VMStateDescription vmstate_cpu_common_crash_occurred =3D = { > + .name =3D "cpu_common/crash_occurred", > + .version_id =3D 1, > + .minimum_version_id =3D 1, > + .needed =3D cpu_common_crash_occurred_needed, > + .fields =3D (VMStateField[]) { > + VMSTATE_UINT32(crash_occurred, CPUState), > + VMSTATE_END_OF_LIST() > + } > +}; > + > const VMStateDescription vmstate_cpu_common =3D { > .name =3D "cpu_common", > .version_id =3D 1, > @@ -478,6 +496,7 @@ const VMStateDescription vmstate_cpu_common =3D { > }, > .subsections =3D (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) > =20 > void qemu_system_guest_panicked(void) > { > + if (current_cpu) { > + current_cpu->crash_occurred =3D 1; > + } > qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_ab= ort); > vm_stop(RUN_STATE_GUEST_PANICKED); > } --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Felix Imend=C3=B6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; = HRB 21284 (AG N=C3=BCrnberg)