diff mbox series

[v2,2/2] tools/libxl: only set viridian flags on new domains

Message ID 1612382824-20232-2-git-send-email-igor.druzhinin@citrix.com (mailing list archive)
State New
Headers show
Series [v2,1/2] tools/libxl: pass libxl__domain_build_state to libxl__arch_domain_create | expand

Commit Message

Igor Druzhinin Feb. 3, 2021, 8:07 p.m. UTC
Domains migrating or restoring should have viridian HVM param key in
the migration stream already and setting that twice results in Xen
returing -EEXIST on the second attempt later (during migration stream parsing)
in case the values don't match. That causes migration/restore operation
to fail at destination side.

That issue is now resurfaced by the latest commits (983524671 and 7e5cffcd1e)
extending default viridian feature set making the values from the previous
migration streams and those set at domain construction different.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
 tools/libs/light/libxl_x86.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Ian Jackson Feb. 5, 2021, 6:46 p.m. UTC | #1
Igor Druzhinin writes ("[PATCH v2 2/2] tools/libxl: only set viridian flags on new domains"):
> Domains migrating or restoring should have viridian HVM param key in
> the migration stream already and setting that twice results in Xen
> returing -EEXIST on the second attempt later (during migration stream parsing)
> in case the values don't match. That causes migration/restore operation
> to fail at destination side.
> 
> That issue is now resurfaced by the latest commits (983524671 and 7e5cffcd1e)
> extending default viridian feature set making the values from the previous
> migration streams and those set at domain construction different.
> 
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>

Thanks for splitting this up.

Release-Acked-by: Ian Jackson <iwj@xenproject.org>

Andy, I think from irc that this meets with your approval but can I
have a formal R-b ?  If so please put my tools maintainer ack on it
too.

Thanks,
Ian.
Andrew Cooper Feb. 5, 2021, 6:59 p.m. UTC | #2
On 05/02/2021 18:46, Ian Jackson wrote:
> Igor Druzhinin writes ("[PATCH v2 2/2] tools/libxl: only set viridian flags on new domains"):
>> Domains migrating or restoring should have viridian HVM param key in
>> the migration stream already and setting that twice results in Xen
>> returing -EEXIST on the second attempt later (during migration stream parsing)
>> in case the values don't match. That causes migration/restore operation
>> to fail at destination side.
>>
>> That issue is now resurfaced by the latest commits (983524671 and 7e5cffcd1e)
>> extending default viridian feature set making the values from the previous
>> migration streams and those set at domain construction different.
>>
>> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
> Thanks for splitting this up.
>
> Release-Acked-by: Ian Jackson <iwj@xenproject.org>
>
> Andy, I think from irc that this meets with your approval but can I
> have a formal R-b ?  If so please put my tools maintainer ack on it
> too.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 91169d1..58187ed 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -468,7 +468,10 @@  int libxl__arch_domain_create(libxl__gc *gc,
         (ret = hvm_set_conf_params(gc, domid, info)) != 0)
         goto out;
 
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM &&
+    /* Viridian flags are already a part of the migration stream so set
+     * them here only for brand new domains. */
+    if (!state->restore &&
+        info->type == LIBXL_DOMAIN_TYPE_HVM &&
         (ret = hvm_set_viridian_features(gc, domid, info)) != 0)
         goto out;