x86/dmop: Properly fail for PV guests
PATCH 1/1 x86/dmop: Properly fail for PV guests
The current code has an early exit for PV guests, but it returns 0 having done nothing.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Paul Durrant <[email protected]>
For 4.15. Found while testing XEN_DMOP_nr_vcpus. Needs backporting to all stable releases.
--- xen/arch/x86/hvm/dm.c | 1 + 1 file changed, 1 insertion(+)
xen/arch/x86/hvm/dm.c +1 -0
@@ -365,6 +365,7 @@ int dm_op(const struct dmop_args *op_args)if ( rc )return rc; + rc = -EINVAL ;if ( !is_hvm_domain (d) ) goto out;
Signature · 1 line
2.11.0
Andrew Cooper writes ("[PATCH for-4.15] x86/dmop: Properly fail for PV guests"):
Quoted 2 lines
The current code has an early exit for PV guests, but it returns 0 having done nothing.
xen/arch/x86/hvm/dm.c int dm_op(const struct dmop_args *op_args) · line 370
Quoted 11 lines
xen/arch/x86/hvm/dm.c +1
-0@@ -365,6 +365,7 @@ int dm_op(const struct dmop_args *op_args)if ( rc )return rc; + rc = -EINVAL ;if ( !is_hvm_domain (d) ) goto out;
Is this style, of setting rc outside the if, the standard hypervisor style ?
Ian.
Quoted 4 lines · Ian Jackson
Andrew Cooper writes ("[PATCH for-4.15] x86/dmop: Properly fail for PV guests"):
Quoted 2 lines
The current code has an early exit for PV guests, but it returns 0 having done nothing.
Reviewed-by Ian Jackson <[email protected]>
Thanks.
Quoted 9 lines
Quoted 9 lines
xen/arch/x86/hvm/dm.c +0
-0@@ -365,6 +365,7 @@ int dm_op(const struct dmop_args *op_args)if ( rc )return rc;
Quoted 5 lines
xen/arch/x86/hvm/dm.c int dm_op(const struct dmop_args *op_args) · line 370
Quoted 3 lines
xen/arch/x86/hvm/dm.c +1
-0+ rc = -EINVAL ;if ( !is_hvm_domain (d) ) goto out;Is this style, of setting rc outside the if, the standard hypervisor style ?
If you think the cyclomatic complexity is bad in libxl...
This is the prevailing style in this function. Its common, but not universal style.
~Andrew
Andrew Cooper writes ("Re: [PATCH for-4.15] x86/dmop: Properly fail for PV guests"):
Quoted 7 lines · Ian Jackson
Quoted 4 lines
Andrew Cooper writes ("[PATCH for-4.15] x86/dmop: Properly fail for PV guests"):
Quoted 2 lines
The current code has an early exit for PV guests, but it returns 0 having done nothing.
Reviewed-by Ian Jackson <[email protected]>Thanks.
Quoted 5 lines · Andrew Cooper
The current code has an early exit for PV guests, but it returns 0 having done nothing.
Fixes 524a98c2ac5 ("public / x86: introduce __HYPERCALL_dm_op...")Signed-off-by Andrew Cooper <[email protected]>