Re: [RFC PATCH 7/9] kvm_main.c: duplicate invalid memslot also in inactive list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/9/22 12:45, Emanuele Giuseppe Esposito wrote:
  	/*
-	 * if change is DELETE or MOVE, invalid is in active memslots
-	 * and old in inactive, so replace old with new.
+	 * if change is DELETE or MOVE, invalid is in both active and inactive
+	 * memslot list. This means that we don't need old anymore, and
+	 * we should replace invalid with new.
  	 */
-	kvm_replace_memslot(kvm, batch->old, batch->new);
+	if (batch->change == KVM_MR_DELETE || batch->change == KVM_MR_MOVE)
+		kvm_replace_memslot(kvm, batch->invalid, batch->new);
+	else
+		kvm_replace_memslot(kvm, batch->old, batch->new);

This is also

	kvm_replace_memslot(kvm, batch->invalid ?: batch->old,
			    batch->new);

with no need to look at batch->change.

Paolo




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux