Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

[Xen-devel][PATCH][ioemu] Stop pv guest from parsing xenstore opening bl

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel][PATCH][ioemu] Stop pv guest from parsing xenstore opening block devices
From: Pat Campbell <plc@xxxxxxxxxx>
Date: Wed, 30 Jan 2008 08:28:08 -0700
Delivery-date: Wed, 30 Jan 2008 07:32:19 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.6 (X11/20070801)
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.

Please apply to xen-unstable tip

Signed-off-by:  Pat Campbell <plc@xxxxxxxxxx>


diff -r 1c826ea72a80 tools/ioemu/hw/xen_machine_fv.c
--- a/tools/ioemu/hw/xen_machine_fv.c   Wed Jan 23 15:42:52 2008 +0000
+++ b/tools/ioemu/hw/xen_machine_fv.c   Wed Jan 30 07:28:43 2008 -0700
@@ -205,6 +205,8 @@ static void xen_init_fv(uint64_t ram_siz
     }
 #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,
diff -r 1c826ea72a80 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Wed Jan 23 15:42:52 2008 +0000
+++ b/tools/ioemu/vl.c  Wed Jan 30 08:06:56 2008 -0700
@@ -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
diff -r 1c826ea72a80 tools/ioemu/vl.h
--- a/tools/ioemu/vl.h  Wed Jan 23 15:42:52 2008 +0000
+++ b/tools/ioemu/vl.h  Wed Jan 30 08:06:23 2008 -0700
@@ -1457,6 +1457,7 @@ void readline_start(const char *prompt, 
                     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);
diff -r 1c826ea72a80 tools/ioemu/xenstore.c
--- a/tools/ioemu/xenstore.c    Wed Jan 23 15:42:52 2008 +0000
+++ b/tools/ioemu/xenstore.c    Wed Jan 30 08:18:55 2008 -0700
@@ -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;
@@ -88,12 +95,6 @@ void xenstore_parse_domain_config(int do
 
     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) {
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel][PATCH][ioemu] Stop pv guest from parsing xenstore opening block devices, Pat Campbell <=