@@ -323,6 +323,7 @@ obj-xen-y += i8259.o
obj-xen-y += pc.o
obj-xen-y += piix_pci.o
obj-xen-y += mc146818rtc.o
+obj-xen-y += xenstore.o
obj-xen-y += xen_mapcache.o
obj-xen-y += stub-functions.o
@@ -32,6 +32,8 @@
#include "ide.h"
#include "sysemu.h"
+#include "xen_backend.h"
+#include "xenstore.h"
#include "xen/hvm/hvm_info_table.h"
#define MAX_IDE_BUS 2
@@ -61,6 +63,12 @@ static void xen_init_fv(ram_addr_t ram_size,
CPUState *env;
+ /* Initialize backend core & drivers */
+ if (xen_dm_init() != 0) {
+ fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__);
+ exit(1);
+ }
+
/* Initialize a dummy CPU */
if (cpu_model == NULL) {
#ifdef TARGET_X86_64
new file mode 100644
@@ -0,0 +1,24 @@
+#include "hw/xen_backend.h"
+#include "xenstore.h"
+
+int xen_dm_init(void)
+{
+ xenstore = xs_daemon_open();
+ if (!xenstore) {
+ xen_be_printf(NULL, 0, "can't connect to xenstored\n");
+ return -1;
+ }
+
+ xen_xc = xc_interface_open(NULL, NULL, 0);
+ if (xen_xc == NULL) {
+ xen_be_printf(NULL, 0, "can't open xen interface\n");
+ goto err;
+ }
+ return 0;
+
+err:
+ xs_daemon_close(xenstore);
+ xenstore = NULL;
+
+ return -1;
+}
new file mode 100644
@@ -0,0 +1,6 @@
+#ifndef XENSTORE_H_
+#define XENSTORE_H_
+
+int xen_dm_init(void);
+
+#endif /* !XENSTORE_H_ */