From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGoPU-0006om-2u for qemu-devel@nongnu.org; Tue, 03 Sep 2013 07:04:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGoPP-0004eD-1s for qemu-devel@nongnu.org; Tue, 03 Sep 2013 07:04:36 -0400 Received: from mga09.intel.com ([134.134.136.24]:39021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGoPO-0004e5-T1 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 07:04:30 -0400 From: "Liu, Jinsong" Date: Tue, 3 Sep 2013 11:04:26 +0000 Message-ID: References: <5220B3A3.4000100@citrix.com> <5225C008.6010106@citrix.com> In-Reply-To: <5225C008.6010106@citrix.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Anthony PERARD Cc: George Dunlap , "qemu-devel@nongnu.org" , "xen-devel@lists.xen.org" , Ian Campbell , Stefano Stabellini Anthony PERARD wrote: > On 01/09/13 10:51, Liu, Jinsong wrote: >> From 86ad3bb83a984ad7bbc00b81d6a0bfc1abc543ca Mon Sep 17 00:00:00 >> 2001=20 >> 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=20 >>=20 >> 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. >>=20 >> 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. >>=20 >> 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=20 >> and a register function, and notifies the later wakeup list when >> qemu wakup by 'xl trigger' command. >>=20 >> Signed-off-by: Liu Jinsong >> --- >> sysemu.h | 1 + >> vl.c | 8 ++++++++ >> 2 files changed, 9 insertions(+), 0 deletions(-) >>=20 >> 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 =3D >> NOTIFIER_LIST_INITIALIZER(suspend_notifiers); >> static NotifierList wakeup_notifiers =3D >> NOTIFIER_LIST_INITIALIZER(wakeup_notifiers); >> +static NotifierList later_wakeup_notifiers =3D >> + NOTIFIER_LIST_INITIALIZER(later_wakeup_notifiers); >> static uint32_t wakeup_reason_mask =3D ~0; >> static RunState vmstop_requested =3D RUN_STATE_MAX; >>=20 >> @@ -1668,6 +1670,11 @@ void qemu_register_wakeup_notifier(Notifier >> *notifier) notifier_list_add(&wakeup_notifiers, notifier); } >>=20 >> +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 =3D 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()) { >>=20 >=20 > 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 >=20 > 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 q= emu-xen tree), or, qemu-xen tree? Thanks, Jinsong