ia64/xen-unstable

changeset 16949:32b898768217

ioemu: Stop PV guest from parsing xenstore and opening block devices.

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>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 31 09:11:21 2008 +0000 (2008-01-31)
parents 5c30a9dec02d
children a6c037d8cba3
files tools/ioemu/hw/xen_machine_fv.c tools/ioemu/vl.c tools/ioemu/vl.h tools/ioemu/xenstore.c
line diff
     1.1 --- a/tools/ioemu/hw/xen_machine_fv.c	Wed Jan 30 18:39:04 2008 +0000
     1.2 +++ b/tools/ioemu/hw/xen_machine_fv.c	Thu Jan 31 09:11:21 2008 +0000
     1.3 @@ -205,6 +205,8 @@ static void xen_init_fv(uint64_t ram_siz
     1.4      }
     1.5  #endif
     1.6  
     1.7 +    xenstore_parse_domain_config(domid);
     1.8 +
     1.9      xc_get_hvm_param(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
    1.10      fprintf(logfile, "shared page at pfn %lx\n", ioreq_pfn);
    1.11      shared_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE,
     2.1 --- a/tools/ioemu/vl.c	Wed Jan 30 18:39:04 2008 +0000
     2.2 +++ b/tools/ioemu/vl.c	Thu Jan 31 09:11:21 2008 +0000
     2.3 @@ -7593,7 +7593,7 @@ int main(int argc, char **argv)
     2.4  #ifdef CONFIG_DM
     2.5      bdrv_init();
     2.6      xc_handle = xc_interface_open();
     2.7 -    xenstore_parse_domain_config(domid);
     2.8 +    xenstore_daemon_open();
     2.9  #endif /* CONFIG_DM */
    2.10  
    2.11  #ifdef USE_KQEMU
     3.1 --- a/tools/ioemu/vl.h	Wed Jan 30 18:39:04 2008 +0000
     3.2 +++ b/tools/ioemu/vl.h	Thu Jan 31 09:11:21 2008 +0000
     3.3 @@ -1457,6 +1457,7 @@ void readline_start(const char *prompt, 
     3.4                      ReadLineFunc *readline_func, void *opaque);
     3.5  
     3.6  /* xenstore.c */
     3.7 +void xenstore_daemon_open(void);
     3.8  void xenstore_parse_domain_config(int domid);
     3.9  int xenstore_fd(void);
    3.10  void xenstore_process_event(void *opaque);
     4.1 --- a/tools/ioemu/xenstore.c	Wed Jan 30 18:39:04 2008 +0000
     4.2 +++ b/tools/ioemu/xenstore.c	Thu Jan 31 09:11:21 2008 +0000
     4.3 @@ -77,6 +77,13 @@ static void waitForDevice(char *fn)
     4.4      return;
     4.5  }
     4.6  
     4.7 +void xenstore_daemon_open(void)
     4.8 +{
     4.9 +    xsh = xs_daemon_open();
    4.10 +    if (xsh == NULL)
    4.11 +        fprintf(logfile, "Could not contact xenstore for domain config\n");
    4.12 +}
    4.13 +
    4.14  void xenstore_parse_domain_config(int domid)
    4.15  {
    4.16      char **e = NULL;
    4.17 @@ -90,12 +97,6 @@ void xenstore_parse_domain_config(int do
    4.18      for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++)
    4.19          media_filename[i] = NULL;
    4.20  
    4.21 -    xsh = xs_daemon_open();
    4.22 -    if (xsh == NULL) {
    4.23 -        fprintf(logfile, "Could not contact xenstore for domain config\n");
    4.24 -        return;
    4.25 -    }
    4.26 -
    4.27      path = xs_get_domain_path(xsh, domid);
    4.28      if (path == NULL) {
    4.29          fprintf(logfile, "xs_get_domain_path() error\n");