Skip to contentSkip to conversation

tools/xl: only use the special "--incoming" name on actual migration

PATCH In review Tim Deegan 2 participants 3 messages Nov 22, 2010 – Nov 24, 2010

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

PATCH 1/1 tools/xl: only use the special "--incoming" name on actual migration

# HG changeset patch
# User Tim Deegan <[email protected]>
# Date 1290188922 0
# Node ID 17d93860b47414fc7fbe9eb0df57baa8240019b5
# Parent d27297705f907ef709200d788747ba88e45139f3 tools/xl: only use the special "--incoming" name on actual migration and not on every susequent reboot.

tools/libxl/xl_cmdimpl.c +4 -0
diff -r d27297705f90 -r 17d93860b474 tools/libxl/xl_cmdimpl.c
@@ -1824,6 +1824,10 @@ start:
 
                         /* Some settings only make sense on first boot. */
                         paused = 0;
+                        if (common_domname 
+                            && strcmp(d_config.c_info.name, common_domname)) {
+                            d_config.c_info.name = strdup(common_domname);
+                        }
 
                         /*
                          * XXX FIXME: If this sleep is not there then domain
#1 lore raw

Tim Deegan writes ("[Xen-devel] [PATCH] tools/xl: only use the special "--incoming" name on actual migration"):

Quoted 2 lines

tools/xl: only use the special "--incoming" name on actual migration and not on every susequent reboot.

Well spotted. However, doesn't this:

Quoted 1 line

+ d_config.c_info.name = strdup(common_domname);

leak the old value of c_info.name ? I don't think we necessarily care very much so I have applied th patch anyway.

Ian.

author
#2 lore raw
Quoted 9 lines · Ian Jackson

Tim Deegan writes ("[Xen-devel] [PATCH] tools/xl: only use the special "--incoming" name on actual migration"):

Quoted 2 lines

tools/xl: only use the special "--incoming" name on actual migration and not on every susequent reboot.

Well spotted. However, doesn't this:

Quoted 1 line

+ d_config.c_info.name = strdup(common_domname);

leak the old value of c_info.name ?

In the case where this happens, the old name has been passed by reference up the stack to the calling function, but in this path (the child of a fork) we never return to the caller. So, er, maybe?

Tim.

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)