[PATCH kvm-unit-tests 2/3] x86/desc: allow multiple initializations

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

 



There are multiple callers, so be forgiving.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 lib/x86/desc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/x86/desc.c b/lib/x86/desc.c
index 0ed8c22..c268955 100644
--- a/lib/x86/desc.c
+++ b/lib/x86/desc.c
@@ -229,6 +229,12 @@ static void *idt_handlers[32] = {
 void setup_idt(void)
 {
     int i;
+    static bool idt_initialized = false;
+
+    if (idt_initialized) {
+        return;
+    }
+    idt_initialized = true;
     for (i = 0; i < 32; i++)
 	    if (idt_handlers[i])
 		    set_idt_entry(i, idt_handlers[i], 0);
-- 
1.7.6.1

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


[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