]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Load kernel image to the VM
authorPekka Enberg <penberg@cs.helsinki.fi>
Tue, 23 Mar 2010 20:04:20 +0000 (22:04 +0200)
committerPekka Enberg <penberg@cs.helsinki.fi>
Tue, 23 Mar 2010 20:04:20 +0000 (22:04 +0200)
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
tools/kvm/kvm.c

index 9fd377d9e9f13a47dc7657ac250838340f4a02ad..0906ad5a088d065fe0f710bb25c37ff60d7bb4f0 100644 (file)
@@ -1,5 +1,3 @@
-#include "kvm/cpu.h"
-
 #include <linux/kvm.h>
 #include <inttypes.h>
 #include <sys/mman.h>
@@ -114,6 +112,10 @@ static void kvm__run(struct kvm *self)
                die("KVM_RUN");
 }
 
+static void kvm__load_kernel(struct kvm *kvm, const char *kernel_filename)
+{
+}
+
 static const char *exit_reasons[] = {
        [KVM_EXIT_UNKNOWN]              = "unknown",
        [KVM_EXIT_EXCEPTION]            = "exception",
@@ -135,17 +137,26 @@ static const char *exit_reasons[] = {
        [KVM_EXIT_INTERNAL_ERROR]       = "internal error",
 };
 
+static void usage(char *argv[])
+{
+       fprintf(stderr, "  usage: %s <kernel-image>\n", argv[0]);
+       exit(1);
+}
+
 int main(int argc, char *argv[])
 {
-       struct cpu *cpu;
+       const char *kernel_filename;
        struct kvm *kvm;
        int ret;
 
-       kvm = kvm__init();
+       if (argc < 2)
+               usage(argv);
 
-       cpu = cpu__new();
+       kernel_filename = argv[1];
+
+       kvm = kvm__init();
 
-       cpu__reset(cpu);
+       kvm__load_kernel(kvm, kernel_filename);
 
        kvm__run(kvm);