Skip to content

Commit

Permalink
KVM: set_memory_region: Make kvm_mr_change available to arch code
Browse files Browse the repository at this point in the history
This will be used for cleaning up prepare/commit_memory_region() later.

Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
Takuya Yoshikawa authored and Marcelo Tosatti committed Mar 4, 2013
1 parent 47ae31e commit 74d0727
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 18 additions & 0 deletions include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,24 @@ id_to_memslot(struct kvm_memslots *slots, int id)
return slot;
}

/*
* KVM_SET_USER_MEMORY_REGION ioctl allows the following operations:
* - create a new memory slot
* - delete an existing memory slot
* - modify an existing memory slot
* -- move it in the guest physical memory space
* -- just change its flags
*
* Since flags can be changed by some of these operations, the following
* differentiation is the best we can do for __kvm_set_memory_region():
*/
enum kvm_mr_change {
KVM_MR_CREATE,
KVM_MR_DELETE,
KVM_MR_MOVE,
KVM_MR_FLAGS_ONLY,
};

int kvm_set_memory_region(struct kvm *kvm,
struct kvm_userspace_memory_region *mem);
int __kvm_set_memory_region(struct kvm *kvm,
Expand Down
18 changes: 0 additions & 18 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,24 +718,6 @@ static struct kvm_memslots *install_new_memslots(struct kvm *kvm,
return old_memslots;
}

/*
* KVM_SET_USER_MEMORY_REGION ioctl allows the following operations:
* - create a new memory slot
* - delete an existing memory slot
* - modify an existing memory slot
* -- move it in the guest physical memory space
* -- just change its flags
*
* Since flags can be changed by some of these operations, the following
* differentiation is the best we can do for __kvm_set_memory_region():
*/
enum kvm_mr_change {
KVM_MR_CREATE,
KVM_MR_DELETE,
KVM_MR_MOVE,
KVM_MR_FLAGS_ONLY,
};

/*
* Allocate some memory and give it an address in the guest physical address
* space.
Expand Down

0 comments on commit 74d0727

Please sign in to comment.