diff options
author | Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> | 2013-01-29 11:00:07 +0900 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-02-04 22:00:53 -0200 |
commit | f64c0398939483eb1d8951f24fbc21e94ed54457 (patch) | |
tree | e0d3b9b109f82dbfca84f347f1848a6797a80405 /Documentation | |
parent | 0c29b2293b25527a1759cbd22b106f19258636b6 (diff) | |
download | linux-f64c0398939483eb1d8951f24fbc21e94ed54457.tar.gz linux-f64c0398939483eb1d8951f24fbc21e94ed54457.tar.bz2 linux-f64c0398939483eb1d8951f24fbc21e94ed54457.zip |
KVM: set_memory_region: Identify the requested change explicitly
KVM_SET_USER_MEMORY_REGION forces __kvm_set_memory_region() to identify
what kind of change is being requested by checking the arguments. The
current code does this checking at various points in code and each
condition being used there is not easy to understand at first glance.
This patch consolidates these checks and introduces an enum to name the
possible changes to clean up the code.
Although this does not introduce any functional changes, there is one
change which optimizes the code a bit: if we have nothing to change, the
new code returns 0 immediately.
Note that the return value for this case cannot be changed since QEMU
relies on it: we noticed this when we changed it to -EINVAL and got a
section mismatch error at the final stage of live migration.
Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions