diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-03-04 10:16:04 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-03-04 10:16:04 +0100 |
commit | 7ffc9779aa5120c5098d938cb88f69a1dda9a0fe (patch) | |
tree | 14fafc8697f4eccf496d2592990da17e6080ca71 /xen/common/memory.c | |
parent | 53decd322157e922cac2988e07da6d39538c8033 (diff) | |
download | xen-7ffc9779aa5120c5098d938cb88f69a1dda9a0fe.tar.gz xen-7ffc9779aa5120c5098d938cb88f69a1dda9a0fe.tar.bz2 xen-7ffc9779aa5120c5098d938cb88f69a1dda9a0fe.zip |
x86: make certain memory sub-ops return valid values
When a domain's shared info field "max_pfn" is zero,
domain_get_maximum_gpfn() so far returned ULONG_MAX, which
do_memory_op() in turn converted to -1 (i.e. -EPERM). Make the former
always return a sensible number (i.e. zero if the field was zero) and
have the latter no longer truncate return values.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/common/memory.c')
-rw-r--r-- | xen/common/memory.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/xen/common/memory.c b/xen/common/memory.c index 08550efc47..3cf9e6c92c 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -545,14 +545,13 @@ static long memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg) long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { struct domain *d; - int rc, op; + long rc; unsigned int address_bits; unsigned long start_extent; struct xen_memory_reservation reservation; struct memop_args args; domid_t domid; - - op = cmd & MEMOP_CMD_MASK; + int op = cmd & MEMOP_CMD_MASK; switch ( op ) { |