diff mbox

kvm: update_memslots: clean flags for invalid memslots

Message ID 1420792154-32454-1-git-send-email-tiejun.chen@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tiejun Chen Jan. 9, 2015, 8:29 a.m. UTC
Indeed, any invalid memslots should be new->npages = 0,
new->base_gfn = 0 and new->flags = 0 at the same time.

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
Paolo,

This is just a small cleanup to follow-up commit, efbeec7098ee, "fix
sorting of memslots with base_gfn == 0".

Tiejun

 virt/kvm/kvm_main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Paolo Bonzini Jan. 27, 2015, 8:31 p.m. UTC | #1
On 09/01/2015 09:29, Tiejun Chen wrote:
> Indeed, any invalid memslots should be new->npages = 0,
> new->base_gfn = 0 and new->flags = 0 at the same time.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
> ---
> Paolo,
> 
> This is just a small cleanup to follow-up commit, efbeec7098ee, "fix
> sorting of memslots with base_gfn == 0".
> 
> Tiejun
> 
>  virt/kvm/kvm_main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 1cc6e2e..369c759 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -673,6 +673,7 @@ static void update_memslots(struct kvm_memslots *slots,
>  	if (!new->npages) {
>  		WARN_ON(!mslots[i].npages);
>  		new->base_gfn = 0;
> +		new->flags = 0;
>  		if (mslots[i].npages)
>  			slots->used_slots--;
>  	} else {
> 

Applied to kvm/queue.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 1cc6e2e..369c759 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -673,6 +673,7 @@  static void update_memslots(struct kvm_memslots *slots,
 	if (!new->npages) {
 		WARN_ON(!mslots[i].npages);
 		new->base_gfn = 0;
+		new->flags = 0;
 		if (mslots[i].npages)
 			slots->used_slots--;
 	} else {