From: Luiz Capitulino <lcapitulino@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel <qemu-devel@nongnu.org>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] Allow silent system resets
Date: Wed, 15 Jun 2011 11:32:33 -0300 [thread overview]
Message-ID: <20110615113233.16a5e0d9@doriath> (raw)
In-Reply-To: <4DF78C77.1080901@siemens.com>
On Tue, 14 Jun 2011 18:29:43 +0200
Jan Kiszka <jan.kiszka@siemens.com> wrote:
> This allows qemu_system_reset to be issued silently for internal
> purposes, ie. without sending out a monitor event. Convert the system
> reset after startup to the silent mode.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Only this patch is monitor related, but I've applied the two in the
monitor branch.
Thanks.
> ---
> sysemu.h | 5 ++++-
> vl.c | 10 ++++++----
> xen-all.c | 2 +-
> 3 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/sysemu.h b/sysemu.h
> index 7e70daa..d3013f5 100644
> --- a/sysemu.h
> +++ b/sysemu.h
> @@ -34,6 +34,9 @@ void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
> #define VMSTOP_LOADVM 7
> #define VMSTOP_MIGRATE 8
>
> +#define VMRESET_SILENT false
> +#define VMRESET_REPORT true
> +
> void vm_start(void);
> void vm_stop(int reason);
>
> @@ -50,7 +53,7 @@ int qemu_powerdown_requested(void);
> void qemu_system_killed(int signal, pid_t pid);
> void qemu_kill_report(void);
> extern qemu_irq qemu_system_powerdown;
> -void qemu_system_reset(void);
> +void qemu_system_reset(bool report);
>
> void qemu_add_exit_notifier(Notifier *notify);
> void qemu_remove_exit_notifier(Notifier *notify);
> diff --git a/vl.c b/vl.c
> index d7f905d..91380d2 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1249,7 +1249,7 @@ void qemu_unregister_reset(QEMUResetHandler *func, void *opaque)
> }
> }
>
> -void qemu_system_reset(void)
> +void qemu_system_reset(bool report)
> {
> QEMUResetEntry *re, *nre;
>
> @@ -1257,7 +1257,9 @@ void qemu_system_reset(void)
> QTAILQ_FOREACH_SAFE(re, &reset_handlers, entry, nre) {
> re->func(re->opaque);
> }
> - monitor_protocol_event(QEVENT_RESET, NULL);
> + if (report) {
> + monitor_protocol_event(QEVENT_RESET, NULL);
> + }
> cpu_synchronize_all_post_reset();
> }
>
> @@ -1399,7 +1401,7 @@ static void main_loop(void)
> if (qemu_reset_requested()) {
> pause_all_vcpus();
> cpu_synchronize_all_states();
> - qemu_system_reset();
> + qemu_system_reset(VMRESET_REPORT);
> resume_all_vcpus();
> }
> if (qemu_powerdown_requested()) {
> @@ -3272,7 +3274,7 @@ int main(int argc, char **argv, char **envp)
> qemu_register_reset(qbus_reset_all_fn, sysbus_get_default());
> qemu_run_machine_init_done_notifiers();
>
> - qemu_system_reset();
> + qemu_system_reset(VMRESET_SILENT);
> if (loadvm) {
> if (load_vmstate(loadvm) < 0) {
> autostart = 0;
> diff --git a/xen-all.c b/xen-all.c
> index 0eac202..41fd98a 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -452,7 +452,7 @@ static void cpu_handle_ioreq(void *opaque)
> destroy_hvm_domain();
> }
> if (qemu_reset_requested_get()) {
> - qemu_system_reset();
> + qemu_system_reset(VMRESET_REPORT);
> }
> }
>
next prev parent reply other threads:[~2011-06-15 14:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 9:05 [Qemu-devel] [PATCH] Reset system before loadvm Jan Kiszka
2011-06-12 17:13 ` Avi Kivity
2011-06-14 6:19 ` Jan Kiszka
2011-06-14 10:50 ` Avi Kivity
2011-06-14 10:56 ` Jan Kiszka
2011-06-14 11:14 ` Avi Kivity
2011-06-14 15:45 ` Luiz Capitulino
2011-06-12 17:42 ` Peter Maydell
2011-06-14 6:16 ` Jan Kiszka
2011-06-14 16:29 ` [Qemu-devel] [PATCH 1/2] Allow silent system resets Jan Kiszka
2011-06-15 14:32 ` Luiz Capitulino [this message]
2011-06-14 16:29 ` [Qemu-devel] [PATCH v2 2/2] Reset system before loadvm Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110615113233.16a5e0d9@doriath \
--to=lcapitulino@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).