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

[Xen-devel] [PATCH V11 02/15] xen: Make Xen build once.



From: Anthony PERARD <anthony.perard@xxxxxxxxxx>

xen_domainbuild is now build in libhw. And xen_machine_pv is build only
for i386 targets.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 Makefile.objs        |    3 +++
 Makefile.target      |    2 +-
 hw/xen_domainbuild.c |   10 +++++-----
 hw/xen_domainbuild.h |    5 +++--
 hw/xen_machine_pv.c  |    2 +-
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 9e98a66..8034115 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -269,6 +269,9 @@ hw-obj-$(CONFIG_DP8393X) += dp8393x.o
 hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
 hw-obj-$(CONFIG_MIPSNET) += mipsnet.o
 
+# Xen
+hw-obj-$(CONFIG_XEN) += xen_domainbuild.o
+
 # Sound
 sound-obj-y =
 sound-obj-$(CONFIG_SB16) += sb16.o
diff --git a/Makefile.target b/Makefile.target
index 220589e..ab0a570 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -206,7 +206,7 @@ QEMU_CFLAGS += $(VNC_JPEG_CFLAGS)
 QEMU_CFLAGS += $(VNC_PNG_CFLAGS)
 
 # xen backend driver support
-obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
+obj-i386-$(CONFIG_XEN) += xen_machine_pv.o
 
 # Inter-VM PCI shared memory
 obj-$(CONFIG_KVM) += ivshmem.o
diff --git a/hw/xen_domainbuild.c b/hw/xen_domainbuild.c
index 7f1fd66..b73d47f 100644
--- a/hw/xen_domainbuild.c
+++ b/hw/xen_domainbuild.c
@@ -1,9 +1,9 @@
 #include <signal.h>
-#include "xen_backend.h"
-#include "xen_domainbuild.h"
 #include "sysemu.h"
 #include "qemu-timer.h"
 #include "qemu-log.h"
+#include "xen_backend.h"
+#include "xen_domainbuild.h"
 
 #include <xenguest.h>
 
@@ -49,7 +49,7 @@ static int xenstore_domain_mkdir(char *path)
 }
 
 int xenstore_domain_init1(const char *kernel, const char *ramdisk,
-                          const char *cmdline)
+                          const char *cmdline, ram_addr_t ram_size)
 {
     char *dom, uuid_string[42], vm[256], path[256];
     int i;
@@ -225,7 +225,7 @@ static void xen_domain_cleanup(void)
 }
 
 int xen_domain_build_pv(const char *kernel, const char *ramdisk,
-                        const char *cmdline)
+                        const char *cmdline, ram_addr_t ram_size)
 {
     uint32_t ssidref = 0;
     uint32_t flags = 0;
@@ -246,7 +246,7 @@ int xen_domain_build_pv(const char *kernel, const char 
*ramdisk,
         goto err;
     }
 
-    xenstore_domain_init1(kernel, ramdisk, cmdline);
+    xenstore_domain_init1(kernel, ramdisk, cmdline, ram_size);
 
     rc = xc_domain_max_vcpus(xen_xc, xen_domid, smp_cpus);
     if (rc < 0) {
diff --git a/hw/xen_domainbuild.h b/hw/xen_domainbuild.h
index dea0121..49683f8 100644
--- a/hw/xen_domainbuild.h
+++ b/hw/xen_domainbuild.h
@@ -1,13 +1,14 @@
 #ifndef QEMU_HW_XEN_DOMAINBUILD_H
 #define QEMU_HW_XEN_DOMAINBUILD_H 1
 
+#include "cpu-common.h"
 #include "xen_common.h"
 
 int xenstore_domain_init1(const char *kernel, const char *ramdisk,
-                          const char *cmdline);
+                          const char *cmdline, ram_addr_t ram_size);
 int xenstore_domain_init2(int xenstore_port, int xenstore_mfn,
                           int console_port, int console_mfn);
 int xen_domain_build_pv(const char *kernel, const char *ramdisk,
-                        const char *cmdline);
+                        const char *cmdline, ram_addr_t ram_size);
 
 #endif /* QEMU_HW_XEN_DOMAINBUILD_H */
diff --git a/hw/xen_machine_pv.c b/hw/xen_machine_pv.c
index 77a34bf..d0e6e8f 100644
--- a/hw/xen_machine_pv.c
+++ b/hw/xen_machine_pv.c
@@ -64,7 +64,7 @@ static void xen_init_pv(ram_addr_t ram_size,
         break;
     case XEN_CREATE:
         if (xen_domain_build_pv(kernel_filename, initrd_filename,
-                                kernel_cmdline) < 0) {
+                                kernel_cmdline, ram_size) < 0) {
             fprintf(stderr, "xen pv domain creation failed\n");
             exit(1);
         }
-- 
1.7.2.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.