public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm-userspace: fix memslot assignment
@ 2008-07-25 15:38 Christian Borntraeger
  2008-07-27  8:18 ` Avi Kivity
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Borntraeger @ 2008-07-25 15:38 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Carsten Otte, Olaf Schnapper, Christian Ehrhardt

Hello Avi,

seems that I mixed up the slot initialization, instead of making the first 
slot always 0 I made it always 1. Lets go back to Carstens variant, since I 
dont like nested ifdefs. The compiler will remove the dead code anyway.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

---
 libkvm.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: libkvm/libkvm.c
===================================================================
--- libkvm.orig/libkvm.c
+++ libkvm/libkvm.c
@@ -78,7 +78,7 @@ int get_free_slot(kvm_context_t kvm)
 	int i;
 	int tss_ext;
 
-#if defined(KVM_CAP_SET_TSS_ADDR) && !defined(__s390__)
+#if defined(KVM_CAP_SET_TSS_ADDR)
 	tss_ext = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR);
 #else
 	tss_ext = 0;
@@ -92,8 +92,11 @@ int get_free_slot(kvm_context_t kvm)
 	if (tss_ext > 0)
 		i = 0;
 	else
+#if !defined(__s390__)
 		i = 1;
-
+#else
+		i = 0;
+#endif
 	for (; i < KVM_MAX_NUM_MEM_REGIONS; ++i)
 		if (!slots[i].len)
 			return i;

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-07-31 14:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-25 15:38 [PATCH] kvm-userspace: fix memslot assignment Christian Borntraeger
2008-07-27  8:18 ` Avi Kivity
2008-07-28 16:55   ` Christian Borntraeger
2008-07-29 13:18     ` Avi Kivity
2008-07-31  8:01       ` Christian Borntraeger
2008-07-31 11:24         ` Avi Kivity
2008-07-31 12:03           ` Izik Eidos
2008-07-31 12:53           ` Christian Borntraeger
2008-07-31 13:00             ` Avi Kivity
2008-07-31 14:57               ` Christian Borntraeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox