]> xenbits.xensource.com Git - xen.git/commit
tools/libxc: Prevent erroneous success from xc_domain_restore
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 4 Feb 2014 18:01:10 +0000 (18:01 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 6 Feb 2014 11:58:51 +0000 (11:58 +0000)
commitf25599c0c1b8ab4caa062bcdb6acde9f4d0ca09e
tree957509c7e69bd4ee0f2aaa638a54fbd53c22d9ef
parentaf82a77f3abc600c735e12e14874d64c80fa986f
tools/libxc: Prevent erroneous success from xc_domain_restore

The variable 'rc' is set to 1 at the top of xc_domain_restore, and for the
most part is left alone until success, at which point it is set to 0.

There is a separate 'frc' which for the most part is used to check function
calls, keeping errors separate from 'rc'.

For a toolstack which sets callbacks->toolstack_restore(), and the function
returns 0, any subsequent error will end up with code flow going to "out;",
resulting in the migration being declared a success.

For consistency, update the callsites of xc_dom_gnttab{,_hvm}_seed() to use
'frc', even though their use of 'rc' is currently safe.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>
tools/libxc/xc_domain_restore.c