diff mbox series

[PATCH-for-4.15] tools/libs/light: fix xl save -c handling

Message ID 20210219141337.6934-1-jgross@suse.com (mailing list archive)
State New
Headers show
Series [PATCH-for-4.15] tools/libs/light: fix xl save -c handling | expand

Commit Message

Juergen Gross Feb. 19, 2021, 2:13 p.m. UTC
libxl_domain_resume() won't work correctly for the case it was called
due to a "xl save -c" command, i.e. to continue the suspended domain.

The information to do that is not saved in libxl__dm_resume_state for
non-HVM domains.

Fixes: 6298f0eb8f443 ("libxl: Re-introduce libxl__domain_resume")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libs/light/libxl_dom_suspend.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jan Beulich Feb. 19, 2021, 2:15 p.m. UTC | #1
On 19.02.2021 15:13, Juergen Gross wrote:
> libxl_domain_resume() won't work correctly for the case it was called
> due to a "xl save -c" command, i.e. to continue the suspended domain.
> 
> The information to do that is not saved in libxl__dm_resume_state for
> non-HVM domains.
> 
> Fixes: 6298f0eb8f443 ("libxl: Re-introduce libxl__domain_resume")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Marek Marczykowski-Górecki Feb. 19, 2021, 3:01 p.m. UTC | #2
On Fri, Feb 19, 2021 at 03:15:52PM +0100, Jan Beulich wrote:
> On 19.02.2021 15:13, Juergen Gross wrote:
> > libxl_domain_resume() won't work correctly for the case it was called
> > due to a "xl save -c" command, i.e. to continue the suspended domain.
> > 
> > The information to do that is not saved in libxl__dm_resume_state for
> > non-HVM domains.
> > 
> > Fixes: 6298f0eb8f443 ("libxl: Re-introduce libxl__domain_resume")
> > Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> > Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Works with both xl save and libvirt now.

Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Thanks!
Wei Liu Feb. 19, 2021, 5:26 p.m. UTC | #3
On Fri, Feb 19, 2021 at 03:13:37PM +0100, Juergen Gross wrote:
> libxl_domain_resume() won't work correctly for the case it was called
> due to a "xl save -c" command, i.e. to continue the suspended domain.
> 
> The information to do that is not saved in libxl__dm_resume_state for
> non-HVM domains.
> 
> Fixes: 6298f0eb8f443 ("libxl: Re-introduce libxl__domain_resume")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>

Acked-by: Wei Liu <wl@xen.org>
diff mbox series

Patch

diff --git a/tools/libs/light/libxl_dom_suspend.c b/tools/libs/light/libxl_dom_suspend.c
index 25d1571895..f7823bbc8f 100644
--- a/tools/libs/light/libxl_dom_suspend.c
+++ b/tools/libs/light/libxl_dom_suspend.c
@@ -630,12 +630,13 @@  void libxl__domain_resume(libxl__egc *egc,
         goto out;
     }
 
+    dmrs->suspend_cancel = suspend_cancel;
+
     if (type != LIBXL_DOMAIN_TYPE_HVM) {
         rc = 0;
         goto out;
     }
 
-    dmrs->suspend_cancel = suspend_cancel;
     dmrs->dm_resumed_callback = domain_resume_done;
     libxl__dm_resume(egc, dmrs); /* must be last */
     return;