libs/light: Propagate libxl__arch_domain_create() return code
PATCH 1/1 libs/light: Propagate libxl__arch_domain_create() return code
Commit 34990446ca91 started to overwrite the rc value from libxl__arch_domain_create(), thus error aren't propagated anymore.
Check rc value before doing the next thing.
--- tools/libs/light/libxl_dom.c | 2 ++ 1 file changed, 2 insertions(+)
tools/libs/light/libxl_dom.c +2 -0
@@ -377,6 +377,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, state->console_port =xc_evtchn_alloc_unbound (ctx->xch, domid, state->console_domid); rc =libxl__arch_domain_create (gc, d_config, state, domid); +if (rc) goto out;/* Construct a CPUID policy, but only for brand new domains. Domains * being migrated-in/restored have CPUID handled during the
@@ -384,6 +385,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,if (!state->restore) rc =libxl__cpuid_legacy (ctx, domid, false, info); +out:return rc; }
Signature · 1 line
Anthony PERARD
Hi Anthony,
Quoted 8 lines
-----Original Message-----
From: Anthony PERARD <[email protected]>
Subject: [XEN PATCH for-4.17] libs/light: Propagatelibxl__arch_domain_create()return codeCommit
34990446ca91started to overwrite thercvalue fromlibxl__arch_domain_create(), thus error aren't propagated anymore.
Quoted 6 lines
Check
rcvalue before doing the next thing.Fixes 34990446ca91 ("libxl: don't ignore the return value from
xc_cpuid_apply_policy")Reported-by Andrew Cooper <[email protected]>Signed-off-by Anthony PERARD <[email protected]>
Kind regards,
Henry
Quoted 9 lines · Anthony PERARD
Commit
34990446ca91started to overwrite thercvalue fromlibxl__arch_domain_create(), thus error aren't propagated anymore.Check
rcvalue before doing the next thing.Fixes 34990446ca91 ("libxl: don't ignore the return value from xc_cpuid_apply_policy")Reported-by Andrew Cooper <[email protected]>Signed-off-by Anthony PERARD <[email protected]>
Was the issue that libxl__arch_domain_create() failed, but then libxl__cpuid_legacy() succeeded. rc was overwritten, so libxl__build_pre() returns success?
Thanks,
Jason