ioemu: Stop PV guest from parsing xenstore and opening block devices.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 31 Jan 2008 09:11:21 +0000 (09:11 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 31 Jan 2008 09:11:21 +0000 (09:11 +0000)
PV guests are now using QEMU for a vncserver.  During initialization
of QEMU xenstore_parse_config() is being called causing PV guests to
open block devices.  This patch makes a new function,
xenstore_daemon_open(), so that the vnc password functions have an
open xenstore handle and moves xenstore_parse_config() into the FV
machine specific init function.

Signed-off-by: Pat Campbell <plc@novell.com>
tools/ioemu/hw/xen_machine_fv.c
tools/ioemu/vl.c
tools/ioemu/vl.h
tools/ioemu/xenstore.c

index 22ba1dbc3f81cb360ff5a1e869b6ced4871ad4a6..794afeb236a02d8a70a244f4b3fecebf31afd92e 100644 (file)
@@ -205,6 +205,8 @@ static void xen_init_fv(uint64_t ram_size, int vga_ram_size, char *boot_device,
     }
 #endif
 
+    xenstore_parse_domain_config(domid);
+
     xc_get_hvm_param(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
     fprintf(logfile, "shared page at pfn %lx\n", ioreq_pfn);
     shared_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE,
index 939149c46f11ea7db4a3336fff6a194a065a45a5..ce0b26c3e5c4241e172b3cee2ab7e0d1eed7e05c 100644 (file)
@@ -7593,7 +7593,7 @@ int main(int argc, char **argv)
 #ifdef CONFIG_DM
     bdrv_init();
     xc_handle = xc_interface_open();
-    xenstore_parse_domain_config(domid);
+    xenstore_daemon_open();
 #endif /* CONFIG_DM */
 
 #ifdef USE_KQEMU
index 9d78cd25d9f59e91d5b3b3fdcc76b4b282d4bb65..e73ef3b6e9231cf7c8b67d044efd7f941f566ba6 100644 (file)
@@ -1457,6 +1457,7 @@ void readline_start(const char *prompt, int is_password,
                     ReadLineFunc *readline_func, void *opaque);
 
 /* xenstore.c */
+void xenstore_daemon_open(void);
 void xenstore_parse_domain_config(int domid);
 int xenstore_fd(void);
 void xenstore_process_event(void *opaque);
index 9d33237cb367ba4dbaaba35608c5709d1f1e5dd4..0063a2eba99ccb318ba0101f9c290468bd46925c 100644 (file)
@@ -77,6 +77,13 @@ static void waitForDevice(char *fn)
     return;
 }
 
+void xenstore_daemon_open(void)
+{
+    xsh = xs_daemon_open();
+    if (xsh == NULL)
+        fprintf(logfile, "Could not contact xenstore for domain config\n");
+}
+
 void xenstore_parse_domain_config(int domid)
 {
     char **e = NULL;
@@ -90,12 +97,6 @@ void xenstore_parse_domain_config(int domid)
     for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++)
         media_filename[i] = NULL;
 
-    xsh = xs_daemon_open();
-    if (xsh == NULL) {
-        fprintf(logfile, "Could not contact xenstore for domain config\n");
-        return;
-    }
-
     path = xs_get_domain_path(xsh, domid);
     if (path == NULL) {
         fprintf(logfile, "xs_get_domain_path() error\n");