[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120627165232.77a97fd0@BR9GNB5Z>
Date: Wed, 27 Jun 2012 16:52:32 +0200
From: Cornelia Huck <cornelia.huck@...ibm.com>
To: Wen Congyang <wency@...fujitsu.com>
Cc: kvm list <kvm@...r.kernel.org>, qemu-devel <qemu-devel@...gnu.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Avi Kivity <avi@...hat.com>,
"Daniel P. Berrange" <berrange@...hat.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Jan Kiszka <jan.kiszka@...mens.com>,
Gleb Natapov <gleb@...hat.com>
Subject: Re: [Qemu-devel] [PATCH 5/6 v5] deal with guest panicked event
accoring to -onpanic parameter
On Wed, 27 Jun 2012 15:02:23 +0800
Wen Congyang <wency@...fujitsu.com> wrote:
> When the guest is panicked, it will write 0x1 to the port KVM_PV_PORT.
> So if qemu reads 0x1 from this port, we can do the folloing three
> things according to the parameter -onpanic:
> 1. emit QEVENT_GUEST_PANICKED only
> 2. emit QEVENT_GUEST_PANICKED and pause the guest
> 3. emit QEVENT_GUEST_PANICKED and poweroff the guest
> 4. emit QEVENT_GUEST_PANICKED and reset the guest
Would it be useful to add some "dump the guest" actions here?
>
> Note: if we emit QEVENT_GUEST_PANICKED only, and the management
> application does not receive this event(the management may not
> run when the event is emitted), the management won't know the
> guest is panicked.
>
> Signed-off-by: Wen Congyang <wency@...fujitsu.com>
> +static void kvm_pv_port_read(IORange *iorange, uint64_t offset, unsigned width,
> + uint64_t *data)
> +{
> + *data = (1 << KVM_PV_FEATURE_PANICKED);
> +}
> +
> +static void kvm_pv_port_write(IORange *iorange, uint64_t offset, unsigned width,
> + uint64_t data)
> +{
> + if (data == KVM_PV_PANICKED) {
> + panicked_perform_action();
> + }
> +}
> +
> +static void kvm_pv_port_destructor(IORange *iorange)
> +{
> + g_free(iorange);
> +}
> +
> +static IORangeOps pv_io_range_ops = {
> + .read = kvm_pv_port_read,
> + .write = kvm_pv_port_write,
> + .destructor = kvm_pv_port_destructor,
> +};
> +
> +#if defined(KVM_PV_PORT)
> +void kvm_pv_port_init(void)
> +{
> + IORange *pv_io_range = g_malloc(sizeof(IORange));
> +
> + iorange_init(pv_io_range, &pv_io_range_ops, KVM_PV_PORT, 1);
> + ioport_register(pv_io_range);
> +}
> +#else
> +void kvm_pv_port_init(void)
> +{
> +}
> +#endif
> @@ -3641,6 +3647,10 @@ int main(int argc, char **argv, char **envp)
> }
> }
>
> + if (kvm_enabled()) {
> + kvm_pv_port_init();
> + }
> +
> if (incoming) {
> Error *errp = NULL;
> int ret = qemu_start_incoming_migration(incoming, &errp);
I/O ports won't work for s390, yet we'll likely want panic
notifications there as well. This will need some more abstraction.
Cornelia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists