Skip to contentSkip to conversation

tools/libxc: Set HVM_PARAM_CONSOLE_EVTCHN during restore

PATCH Applied Boris Ostrovsky 5 participants 5 messages Apr 23, 2015 – May 5, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/libxc: Set HVM_PARAM_CONSOLE_EVTCHN during restore

When resuming, the guest needs to check whether the port has changed. HVM guests use this parameter to get the port number.

(We can't always use xenstore where this value is also written: for example on Linux the console is resumed very early, before the store is up).

---
 tools/libxc/xc_domain_restore.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
tools/libxc/xc_domain_restore.c +4 -1
index 2ab9f46..f9dfd2d 100644
@@ -2328,7 +2328,10 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                                     HVM_PARAM_PAE_ENABLED, pae))
          || (frc = xc_hvm_param_set(xch, dom,
                                     HVM_PARAM_STORE_EVTCHN,
-                                    store_evtchn)) )
+                                    store_evtchn))
+         || (frc = xc_hvm_param_set(xch, dom,
+                                    HVM_PARAM_CONSOLE_EVTCHN,
+                                    console_evtchn)) )
     {
         PERROR("error setting HVM params: %i", frc);
         goto out;
Signature · 1 line
1.7.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Boris Ostrovsky

When resuming, the guest needs to check whether the port has changed. HVM guests use this parameter to get the port number.

(We can't always use xenstore where this value is also written: for example on Linux the console is resumed very early, before the store is up).

This bug is also present in migration v2 but mitigated in our case because of the binary we use to call xc_domain_restore() which also sets the evtchn up.

I believe libxl is also fine for the same reason, but I will fix it nevertheless.

~Andrew

Quoted 20 lines
---
 tools/libxc/xc_domain_restore.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
tools/libxc/xc_domain_restore.c +4 -1
index 2ab9f46..f9dfd2d 100644
@@ -2328,7 +2328,10 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                                     HVM_PARAM_PAE_ENABLED, pae))
          || (frc = xc_hvm_param_set(xch, dom,
                                     HVM_PARAM_STORE_EVTCHN,
-                                    store_evtchn)) )
+                                    store_evtchn))
+         || (frc = xc_hvm_param_set(xch, dom,
+                                    HVM_PARAM_CONSOLE_EVTCHN,
+                                    console_evtchn)) )
     {
         PERROR("error setting HVM params: %i", frc);
         goto out;
#2 lore raw
Quoted 10 lines · Andrew Cooper
Quoted 7 lines · Boris Ostrovsky

When resuming, the guest needs to check whether the port has changed. HVM guests use this parameter to get the port number.

(We can't always use xenstore where this value is also written: for example on Linux the console is resumed very early, before the store is up).

And this should be backported to older Xen versions if possible.

Quoted 36 lines

This bug is also present in migration v2 but mitigated in our case because of the binary we use to call xc_domain_restore() which also sets the evtchn up.

I believe libxl is also fine for the same reason, but I will fix it nevertheless.

~Andrew

Quoted 10 lines
---
 tools/libxc/xc_domain_restore.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
tools/libxc/xc_domain_restore.c +0 -0
index 2ab9f46..f9dfd2d 100644
@@ -2328,7 +2328,10 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                                     HVM_PARAM_PAE_ENABLED, pae))

tools/libxc/xc_domain_restore.c int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, · line 2337

Quoted 10 lines
tools/libxc/xc_domain_restore.c +4 -1
          || (frc = xc_hvm_param_set(xch, dom,
                                     HVM_PARAM_STORE_EVTCHN,
-                                    store_evtchn)) )
+                                    store_evtchn))
+         || (frc = xc_hvm_param_set(xch, dom,
+                                    HVM_PARAM_CONSOLE_EVTCHN,
+                                    console_evtchn)) )
     {
         PERROR("error setting HVM params: %i", frc);
         goto out;

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

Applied
#3 lore raw
Quoted 11 lines · Konrad Rzeszutek Wilk
Quoted 10 lines · Andrew Cooper
Quoted 7 lines · Boris Ostrovsky

When resuming, the guest needs to check whether the port has changed. HVM guests use this parameter to get the port number.

(We can't always use xenstore where this value is also written: for example on Linux the console is resumed very early, before the store is up).

Applied.

Quoted 1 line

And this should be backported to older Xen versions if possible.

Ian: ^

Acked-by on v1 1/1
#4 lore raw
In reply to Boris Ostrovsky
Quoted 7 lines · Boris Ostrovsky

When resuming, the guest needs to check whether the port has changed. HVM guests use this parameter to get the port number.

(We can't always use xenstore where this value is also written: for example on Linux the console is resumed very early, before the store is up).

Quoted 22 lines
---
 tools/libxc/xc_domain_restore.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
tools/libxc/xc_domain_restore.c +4 -1
index 2ab9f46..f9dfd2d 100644
@@ -2328,7 +2328,10 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                                     HVM_PARAM_PAE_ENABLED, pae))
          || (frc = xc_hvm_param_set(xch, dom,
                                     HVM_PARAM_STORE_EVTCHN,
-                                    store_evtchn)) )
+                                    store_evtchn))
+         || (frc = xc_hvm_param_set(xch, dom,
+                                    HVM_PARAM_CONSOLE_EVTCHN,
+                                    console_evtchn)) )
     {
         PERROR("error setting HVM params: %i", frc);
         goto out;
Signature · 1 line
1.7.1