#endif
diff --git a/dom0_driver.c b/dom0_driver.c
new file mode 100644
-index 0000000..d98a458
+index 0000000..fdd24ab
--- /dev/null
+++ b/dom0_driver.c
@@ -0,0 +1,697 @@
+ }
+}
diff --git a/qemu-xen.h b/qemu-xen.h
-index 7883718..afe8f22 100644
+index 0cc5dd8..2646ec7 100644
--- a/qemu-xen.h
+++ b/qemu-xen.h
-@@ -109,7 +109,13 @@ int xenstore_write(const char *path, const char *val);
+@@ -107,7 +107,13 @@ int xenstore_write(const char *path, const char *val);
void xenstore_dm_finished_startup(void);
* not be trusted by qemu code. For variables containing xenstore
* paths, `danger' can mean that both the path refers to a
diff --git a/vl.c b/vl.c
-index 1738aa5..45e03c1 100644
+index e519705..0ffe1ec 100644
--- a/vl.c
+++ b/vl.c
@@ -234,6 +234,7 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
/***********************************************************/
/* x86 ISA bus support */
-@@ -4289,6 +4304,7 @@ enum {
+@@ -4277,6 +4292,7 @@ enum {
QEMU_OPTION_acpi,
QEMU_OPTION_vcpus,
QEMU_OPTION_vga_passthrough,
/* Debug/Expert options: */
QEMU_OPTION_serial,
-@@ -4463,6 +4479,7 @@ static const QEMUOption qemu_options[] = {
+@@ -4451,6 +4467,7 @@ static const QEMUOption qemu_options[] = {
{ "vncunused", 0, QEMU_OPTION_vncunused },
{ "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
{ "vga-passthrough", 0, QEMU_OPTION_vga_passthrough },
#if defined(CONFIG_XEN) && !defined(CONFIG_DM)
{ "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid },
{ "xen-create", 0, QEMU_OPTION_xen_create },
-@@ -5299,6 +5316,9 @@ int main(int argc, char **argv, char **envp)
+@@ -5287,6 +5304,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_vga_passthrough:
vga_passthrough = 1;
break;
case QEMU_OPTION_direct_pci:
direct_pci = optarg;
break;
-@@ -6065,6 +6085,9 @@ int main(int argc, char **argv, char **envp)
+@@ -6053,6 +6073,9 @@ int main(int argc, char **argv, char **envp)
close(fd);
}
+
xenstore_dm_finished_startup();
- #ifndef CONFIG_STUBDOM
+ main_loop();
diff --git a/xen-hooks.mak b/xen-hooks.mak
index d171928..15ba4d1 100644
--- a/xen-hooks.mak
CONFIG_AUDIO=1
diff --git a/xenstore.c b/xenstore.c
-index 3cd2ba6..17136a3 100644
+index 01afcf0..20ca8cf 100644
--- a/xenstore.c
+++ b/xenstore.c
-@@ -1741,3 +1741,63 @@ void xenstore_dm_finished_startup(void)
+@@ -1727,3 +1727,63 @@ void xenstore_dm_finished_startup(void)
free(buf);
free(path);
}