Skip to contentSkip to conversation

libxl/save: set domain_suspend_state->domid in do_domain_soft_reset()

PATCH Applied Vitaly Kuznetsov 3 participants 6 messages Apr 11, 2016 – Apr 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl/save: set domain_suspend_state->domid in do_domain_soft_reset()

c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft reset as libxl__domain_suspend_device_model() now fails when domid in not set in libxl__domain_suspend_state.

---
 tools/libxl/libxl_create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_create.c +1 -1
index f1028bc..f8d5e36 100644
@@ -1700,7 +1700,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     free(xs_console_mfn);
 
     dss->ao = ao;
-    dss->domid = domid_soft_reset;
+    dss->domid = dss->dsps.domid = domid_soft_reset;
     dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
                                       domid_soft_reset);
 
Signature · 7 lines
2.5.5


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Acked-by on v1 1/1
#1 lore raw

Sorry for breaking it!

Quoted 5 lines · Vitaly Kuznetsov

c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft reset as libxl__domain_suspend_device_model() now fails when domid in not set in libxl__domain_suspend_state.

What sort of arrangement is needed to get this tested? Any specific kernel version etc?

Quoted 20 lines
---
 tools/libxl/libxl_create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_create.c +1 -1
index f1028bc..f8d5e36 100644
@@ -1700,7 +1700,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     free(xs_console_mfn);
 
     dss->ao = ao;
-    dss->domid = domid_soft_reset;
+    dss->domid = dss->dsps.domid = domid_soft_reset;
     dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
                                       domid_soft_reset);
 
Signature · 1 line
2.5.5

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 2 lines · Wei Liu

Sorry for breaking it!

Np!

Quoted 5 lines · Vitaly Kuznetsov
Quoted 4 lines

c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft reset as libxl__domain_suspend_device_model() now fails when domid in not set in libxl__domain_suspend_state.

Quoted 7 lines
Quoted 1 line

What sort of arrangement is needed to get this tested? Any specific kernel version etc?

You need a kernel with the following:

commit 0b34a166f291d255755be46e43ed5497cdd194f2

Author: Vitaly Kuznetsov <[email protected]>
Date:   Fri Sep 25 11:59:52 2015 +0200

x86/xen: Support kexec/kdump in HVM guests by doing a soft reset

It is included in upstream kernels starting from 4.5 and a number of stable kernels.

To smoke test the feature your linux kernel should have KEXEC, in my .config I see:

CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
CONFIG_KEXEC_FILE=y
# CONFIG_KEXEC_VERIFY_SIG is not set
CONFIG_KEXEC_JUMP=y

and then you can simply do:

# kexec -f --reuse-cmdline --initrd /boot/initramfs-`uname -r`.img /boot/vmlinuz-`uname -r`

to experience 'soft reset'. You can also try to do kdump arming for your kernel and crashing it (with e.g. 'echo c > /proc/sysrq-trigger').

Quoted 20 lines
Quoted 20 lines
---
 tools/libxl/libxl_create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_create.c +1 -1
index f1028bc..f8d5e36 100644
@@ -1700,7 +1700,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
     free(xs_console_mfn);
 
     dss->ao = ao;
-    dss->domid = domid_soft_reset;
+    dss->domid = dss->dsps.domid = domid_soft_reset;
     dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
                                       domid_soft_reset);
 
Signature · 1 line
2.5.5
Signature · 6 lines
  Vitaly

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#3 lore raw
Quoted 40 lines · Vitaly Kuznetsov
Quoted 2 lines · Wei Liu

Sorry for breaking it!

Np!

Quoted 5 lines · Vitaly Kuznetsov
Quoted 4 lines

c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft reset as libxl__domain_suspend_device_model() now fails when domid in not set in libxl__domain_suspend_state.

Quoted 7 lines
Quoted 1 line

What sort of arrangement is needed to get this tested? Any specific kernel version etc?

You need a kernel with the following:

commit 0b34a166f291d255755be46e43ed5497cdd194f2

Author: Vitaly Kuznetsov <[email protected]>
Date:   Fri Sep 25 11:59:52 2015 +0200

x86/xen: Support kexec/kdump in HVM guests by doing a soft reset

It is included in upstream kernels starting from 4.5 and a number of stable kernels.

To smoke test the feature your linux kernel should have KEXEC, in my .config I see:

CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
CONFIG_KEXEC_FILE=y
# CONFIG_KEXEC_VERIFY_SIG is not set
CONFIG_KEXEC_JUMP=y

Quoted 6 lines

and then you can simply do:

# kexec -f --reuse-cmdline --initrd /boot/initramfs-`uname -r`.img /boot/vmlinuz-`uname -r`

to experience 'soft reset'. You can also try to do kdump arming for your kernel and crashing it (with e.g. 'echo c > /proc/sysrq-trigger').

Thanks for the instructions.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Wei Liu
Quoted 11 lines · Wei Liu

Sorry for breaking it!

Quoted 5 lines · Vitaly Kuznetsov

c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft reset as libxl__domain_suspend_device_model() now fails when domid in not set in libxl__domain_suspend_state.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Applied
#5 lore raw

Wei Liu writes ("Re: [PATCH for-4.7] libxl/save: set domain_suspend_state->domid in do_domain_soft_reset()"):

Quoted 8 lines · Wei Liu
Quoted 7 lines

Sorry for breaking it!

Quoted 4 lines · Vitaly Kuznetsov

c/s d5c693d "libxl/save: Refactor libxl__domain_suspend_state" broke soft reset as libxl__domain_suspend_device_model() now fails when domid in not set in libxl__domain_suspend_state.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Queued, thanks.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel