From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGoGO-0002sd-Q6 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 06:55:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGoGJ-0002CQ-Bj for qemu-devel@nongnu.org; Tue, 03 Sep 2013 06:55:12 -0400 Received: from smtp.citrix.com ([66.165.176.89]:63564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGoGJ-0002Bo-70 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 06:55:07 -0400 Message-ID: <5225C008.6010106@citrix.com> Date: Tue, 3 Sep 2013 11:55:04 +0100 From: Anthony PERARD MIME-Version: 1.0 References: <5220B3A3.4000100@citrix.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] qem-xen: add later wakeup logic when qemu wakeup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Liu, Jinsong" Cc: George Dunlap , "qemu-devel@nongnu.org" , "xen-devel@lists.xen.org" , Ian Campbell , Stefano Stabellini On 01/09/13 10:51, Liu, Jinsong wrote: > From 86ad3bb83a984ad7bbc00b81d6a0bfc1abc543ca Mon Sep 17 00:00:00 2001 > From: Liu Jinsong > Date: Sun, 1 Sep 2013 23:39:14 +0800 > Subject: [PATCH 1/2] qemu-xen: add later wakeup logic when qemu wakeup > > Currently HVM S3 has a bug coming from the difference between > qemu-traditioanl and qemu-xen. For qemu-traditional, the way > to resume from hvm s3 is via 'xl trigger' command. However, > for qemu-xen, the way to resume from hvm s3 inherited from > standard qemu, i.e. via QMP, and it doesn't work under Xen. > > The root cause is, for qemu-xen, 'xl trigger' command didn't reset > devices, while QMP didn't unpause hvm domain though they did qemu > system reset. > > We have two qemu-xen patches and one xl patch to fix the HVM S3 bug. > This patch is the qemu-xen patch 1. It provides a later wakeup notifier > and a register function, and notifies the later wakeup list when > qemu wakup by 'xl trigger' command. > > Signed-off-by: Liu Jinsong > --- > sysemu.h | 1 + > vl.c | 8 ++++++++ > 2 files changed, 9 insertions(+), 0 deletions(-) > > diff --git a/sysemu.h b/sysemu.h > index b71f244..4dbcab7 100644 > --- a/sysemu.h > +++ b/sysemu.h > @@ -49,6 +49,7 @@ void qemu_register_suspend_notifier(Notifier *notifier); > void qemu_system_wakeup_request(WakeupReason reason); > void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); > void qemu_register_wakeup_notifier(Notifier *notifier); > +void qemu_register_later_wakeup_notifier(Notifier *notifier); > void qemu_system_shutdown_request(void); > void qemu_system_powerdown_request(void); > void qemu_register_powerdown_notifier(Notifier *notifier); > diff --git a/vl.c b/vl.c > index 5314f55..1c4842d 100644 > --- a/vl.c > +++ b/vl.c > @@ -1478,6 +1478,8 @@ static NotifierList suspend_notifiers = > NOTIFIER_LIST_INITIALIZER(suspend_notifiers); > static NotifierList wakeup_notifiers = > NOTIFIER_LIST_INITIALIZER(wakeup_notifiers); > +static NotifierList later_wakeup_notifiers = > + NOTIFIER_LIST_INITIALIZER(later_wakeup_notifiers); > static uint32_t wakeup_reason_mask = ~0; > static RunState vmstop_requested = RUN_STATE_MAX; > > @@ -1668,6 +1670,11 @@ void qemu_register_wakeup_notifier(Notifier *notifier) > notifier_list_add(&wakeup_notifiers, notifier); > } > > +void qemu_register_later_wakeup_notifier(Notifier *notifier) > +{ > + notifier_list_add(&later_wakeup_notifiers, notifier); > +} > + > void qemu_system_killed(int signal, pid_t pid) > { > shutdown_signal = signal; > @@ -1744,6 +1751,7 @@ static bool main_loop_should_exit(void) > cpu_synchronize_all_states(); > qemu_system_reset(VMRESET_SILENT); > resume_all_vcpus(); > + notifier_list_notify(&later_wakeup_notifiers, NULL); > monitor_protocol_event(QEVENT_WAKEUP, NULL); > } > if (qemu_powerdown_requested()) { > The patch those not apply properly to QEMU (upstream) but it just because the file sysemu.h have been moved to include/sysemu/sysemu.h Once this is fix: Acked-by: Anthony PERARD -- Anthony PERARD