[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 1/6] xl: remus/colo: only initialise ha variable when necessary
The original code is bogus because the common case is no HA enabled. Setting ha variable at the beginning is not very useful. Move ha to the scope where it is used. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/xl_cmdimpl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index d8530f0..c33691c 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -4752,8 +4752,6 @@ static void migrate_receive(int debug, int daemonize, int monitor, char rc_buf; char *migration_domname; struct domain_create dom_info; - const char *ha = checkpointed == LIBXL_CHECKPOINTED_STREAM_COLO ? - "COLO" : "Remus"; signal(SIGPIPE, SIG_IGN); /* if we get SIGPIPE we'd rather just have it as an error */ @@ -4788,6 +4786,9 @@ static void migrate_receive(int debug, int daemonize, int monitor, switch (checkpointed) { case LIBXL_CHECKPOINTED_STREAM_REMUS: case LIBXL_CHECKPOINTED_STREAM_COLO: + { + const char *ha = checkpointed == LIBXL_CHECKPOINTED_STREAM_COLO ? + "COLO" : "Remus"; /* If we are here, it means that the sender (primary) has crashed. * TODO: Split-Brain Check. */ @@ -4824,6 +4825,7 @@ static void migrate_receive(int debug, int daemonize, int monitor, ha, common_domname, domid, rc); exit(rc ? EXIT_FAILURE : EXIT_SUCCESS); + } default: /* do nothing */ break; -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |