Patchwork [39/40] xenner: integrate into xen pv machine

login
register
mail settings
Submitter Alexander Graf
Date Nov. 2, 2010, 4:26 p.m.
Message ID <1288715185-28657-1-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/69910/
State New
Headers show

Comments

Alexander Graf - Nov. 2, 2010, 4:26 p.m.
For native Xen support, we already have a xen machine description. This one
doesn't really know too much about xenner yet though, so we need to teach it.

This patch adds support for xenner in the xen pv machine description.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/xen_backend.h    |    1 +
 hw/xen_machine_pv.c |   16 ++++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index f53a742..f6fc5f3 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -2,6 +2,7 @@ 
 #define QEMU_HW_XEN_BACKEND_H 1
 
 #include "xen_common.h"
+#include "xen_redirect.h"
 #include "sysemu.h"
 #include "net.h"
 #include "qdev.h"
diff --git a/hw/xen_machine_pv.c b/hw/xen_machine_pv.c
index 6f2666d..6611011 100644
--- a/hw/xen_machine_pv.c
+++ b/hw/xen_machine_pv.c
@@ -29,6 +29,7 @@ 
 #include "xen_backend.h"
 #include "xen_domainbuild.h"
 #include "blockdev.h"
+#include "xenner.h"
 
 static void create_dummy_env(const char *cpu_model)
 {
@@ -57,12 +58,14 @@  static void xen_init_pv(ram_addr_t ram_size,
     int i;
 
     /* Initialize backend core & drivers */
+    xen_interfaces_init();
     if (xen_be_init() != 0) {
         fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
         exit(1);
     }
 
     switch (xen_mode) {
+#ifdef CONFIG_XEN
     case XEN_ATTACH:
         create_dummy_env(cpu_model);
         /* nothing to do, xend handles everything */
@@ -75,9 +78,18 @@  static void xen_init_pv(ram_addr_t ram_size,
             exit(1);
         }
         break;
+#endif
+#ifdef CONFIG_XENNER
     case XEN_EMULATE:
-        fprintf(stderr, "xen emulation not implemented (yet)\n");
-        exit(1);
+        if (xenner_init_pv(kernel_filename, kernel_cmdline,
+                           initrd_filename) < 0) {
+            fprintf(stderr, "xenner pv domain creation failed\n");
+            exit(1);
+        }
+        break;
+#endif
+    default:
+        /* not reached, xen_interfaces_init() catches this already */
         break;
     }