diff -r 4ef5df520e2e tools/ioemu/hw/xen_machine_pv.c --- a/tools/ioemu/hw/xen_machine_pv.c Tue Jan 08 11:11:15 2008 -0700 +++ b/tools/ioemu/hw/xen_machine_pv.c Tue Jan 08 13:02:13 2008 -0700 @@ -58,10 +58,20 @@ static void xen_init_pv(uint64_t ram_siz } } +/* + * Nothing to do here yet. Stops normal xenstore_parse_config() + * processing that causes opens of block device we don't need + */ +static void xen_parse_xenstore(int domid) +{ + return; +} + QEMUMachine xenpv_machine = { "xenpv", "Xen Para-virtualized PC", xen_init_pv, + xen_parse_xenstore, }; /* diff -r 4ef5df520e2e tools/ioemu/vl.c --- a/tools/ioemu/vl.c Tue Jan 08 11:11:15 2008 -0700 +++ b/tools/ioemu/vl.c Tue Jan 08 11:33:08 2008 -0700 @@ -7593,7 +7593,11 @@ int main(int argc, char **argv) #ifdef CONFIG_DM bdrv_init(); xc_handle = xc_interface_open(); - xenstore_parse_domain_config(domid); + xenstore_open(); + if (machine->parse) + machine->parse(domid); + else + xenstore_parse_domain_config(domid); #endif /* CONFIG_DM */ #ifdef USE_KQEMU diff -r 4ef5df520e2e tools/ioemu/vl.h --- a/tools/ioemu/vl.h Tue Jan 08 11:11:15 2008 -0700 +++ b/tools/ioemu/vl.h Tue Jan 08 11:49:47 2008 -0700 @@ -722,11 +722,13 @@ typedef void QEMUMachineInitFunc(uint64_ DisplayState *ds, const char **fd_filename, int snapshot, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *direct_pci); +typedef void QEMUMachineXenStoreParseFunc(int domid); typedef struct QEMUMachine { const char *name; const char *desc; QEMUMachineInitFunc *init; + QEMUMachineXenStoreParseFunc *parse; struct QEMUMachine *next; } QEMUMachine; @@ -1454,6 +1456,7 @@ void readline_start(const char *prompt, ReadLineFunc *readline_func, void *opaque); /* xenstore.c */ +void xenstore_open(void); void xenstore_parse_domain_config(int domid); int xenstore_fd(void); void xenstore_process_event(void *opaque); diff -r 4ef5df520e2e tools/ioemu/xenstore.c --- a/tools/ioemu/xenstore.c Tue Jan 08 11:11:15 2008 -0700 +++ b/tools/ioemu/xenstore.c Tue Jan 08 13:01:51 2008 -0700 @@ -77,6 +77,20 @@ static void waitForDevice(char *fn) return; } +void xenstore_open() +{ + int i; + + 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; + } +} + void xenstore_parse_domain_config(int domid) { char **e = NULL; @@ -86,10 +100,6 @@ void xenstore_parse_domain_config(int do int i, is_scsi, is_hdN = 0; unsigned int len, num, hd_index; - 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;