From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHdLw-00082v-9C for qemu-devel@nongnu.org; Thu, 05 Sep 2013 13:28:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHdLq-00046c-Jo for qemu-devel@nongnu.org; Thu, 05 Sep 2013 13:28:20 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:29677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHdLq-00046P-7p for qemu-devel@nongnu.org; Thu, 05 Sep 2013 13:28:14 -0400 Date: Thu, 5 Sep 2013 18:27:54 +0100 From: Stefano Stabellini In-Reply-To: Message-ID: References: <5220B3A3.4000100@citrix.com> <5225C008.6010106@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" 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: Ian Campbell , Stefano Stabellini , George Dunlap , "qemu-devel@nongnu.org" , "xen-devel@lists.xen.org" , Anthony PERARD On Tue, 3 Sep 2013, Liu, Jinsong wrote: > Anthony PERARD wrote: > > 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 > > Yes. The patches are for qemu-xen tree, to fix xen hvm s3 issue. > > Where should the 2 patches be checked in? qemu upstream (then backport to qemu-xen tree), or, qemu-xen tree? In general patches should go to qemu upstream first and then be backported to qemu-xen.