ia64/xen-unstable

changeset 14818:d56692b16296

[ioemu] Consistently extend all block device operations to include scsi disks.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Wed Apr 11 23:05:07 2007 +0100 (2007-04-11)
parents 27eaa7fe92d2
children 423c4a7b82e6
files tools/ioemu/monitor.c tools/ioemu/vl.c tools/ioemu/vl.h tools/ioemu/xenstore.c
line diff
     1.1 --- a/tools/ioemu/monitor.c	Wed Apr 11 19:04:10 2007 +0100
     1.2 +++ b/tools/ioemu/monitor.c	Wed Apr 11 23:05:07 2007 +0100
     1.3 @@ -180,7 +180,7 @@ static void do_commit(void)
     1.4  {
     1.5      int i;
     1.6  
     1.7 -    for (i = 0; i < MAX_DISKS; i++) {
     1.8 +    for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) {
     1.9          if (bs_table[i]) {
    1.10              bdrv_commit(bs_table[i]);
    1.11          }
     2.1 --- a/tools/ioemu/vl.c	Wed Apr 11 19:04:10 2007 +0100
     2.2 +++ b/tools/ioemu/vl.c	Wed Apr 11 23:05:07 2007 +0100
     2.3 @@ -116,7 +116,7 @@ char phys_ram_file[1024];
     2.4  void *ioport_opaque[MAX_IOPORTS];
     2.5  IOPortReadFunc *ioport_read_table[3][MAX_IOPORTS];
     2.6  IOPortWriteFunc *ioport_write_table[3][MAX_IOPORTS];
     2.7 -BlockDriverState *bs_table[MAX_DISKS+MAX_SCSI_DISKS], *fd_table[MAX_FD];
     2.8 +BlockDriverState *bs_table[MAX_DISKS + MAX_SCSI_DISKS], *fd_table[MAX_FD];
     2.9  int vga_ram_size;
    2.10  int bios_size;
    2.11  static DisplayState display_state;
    2.12 @@ -1396,7 +1396,7 @@ static void stdio_received_byte(int ch)
    2.13          case 's': 
    2.14              {
    2.15                  int i;
    2.16 -                for (i = 0; i < MAX_DISKS; i++) {
    2.17 +                for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) {
    2.18                      if (bs_table[i])
    2.19                          bdrv_commit(bs_table[i]);
    2.20                  }
    2.21 @@ -6057,7 +6057,7 @@ int main(int argc, char **argv)
    2.22      int snapshot, linux_boot;
    2.23      const char *initrd_filename;
    2.24  #ifndef CONFIG_DM
    2.25 -    const char *hd_filename[MAX_DISKS];
    2.26 +    const char *hd_filename[MAX_DISKS + MAX_SCSI_DISKS];
    2.27  #endif /* !CONFIG_DM */
    2.28      const char *fd_filename[MAX_FD];
    2.29      const char *kernel_filename, *kernel_cmdline;
    2.30 @@ -6126,7 +6126,7 @@ int main(int argc, char **argv)
    2.31      for(i = 0; i < MAX_FD; i++)
    2.32          fd_filename[i] = NULL;
    2.33  #ifndef CONFIG_DM
    2.34 -    for(i = 0; i < MAX_DISKS; i++)
    2.35 +    for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++)
    2.36          hd_filename[i] = NULL;
    2.37  #endif /* !CONFIG_DM */
    2.38      ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
    2.39 @@ -6724,7 +6724,7 @@ int main(int argc, char **argv)
    2.40      }
    2.41  
    2.42      /* open the virtual block devices */
    2.43 -    for(i = 0; i < MAX_DISKS; i++) {
    2.44 +    for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) {
    2.45          if (hd_filename[i]) {
    2.46              if (!bs_table[i]) {
    2.47                  char buf[64];
     3.1 --- a/tools/ioemu/vl.h	Wed Apr 11 19:04:10 2007 +0100
     3.2 +++ b/tools/ioemu/vl.h	Wed Apr 11 23:05:07 2007 +0100
     3.3 @@ -820,7 +820,7 @@ int vnc_start_viewer(int port);
     3.4  #define MAX_DISKS 4
     3.5  #define MAX_SCSI_DISKS 7
     3.6  
     3.7 -extern BlockDriverState *bs_table[MAX_DISKS+MAX_SCSI_DISKS];
     3.8 +extern BlockDriverState *bs_table[MAX_DISKS + MAX_SCSI_DISKS];
     3.9  
    3.10  void isa_ide_init(int iobase, int iobase2, int irq,
    3.11                    BlockDriverState *hd0, BlockDriverState *hd1);
     4.1 --- a/tools/ioemu/xenstore.c	Wed Apr 11 19:04:10 2007 +0100
     4.2 +++ b/tools/ioemu/xenstore.c	Wed Apr 11 23:05:07 2007 +0100
     4.3 @@ -18,7 +18,7 @@
     4.4  #include <fcntl.h>
     4.5  
     4.6  static struct xs_handle *xsh = NULL;
     4.7 -static char *media_filename[MAX_DISKS];
     4.8 +static char *media_filename[MAX_DISKS + MAX_SCSI_DISKS];
     4.9  static QEMUTimer *insert_timer = NULL;
    4.10  
    4.11  #define UWAIT_MAX (30*1000000) /* thirty seconds */
    4.12 @@ -44,7 +44,7 @@ static void insert_media(void *opaque)
    4.13  {
    4.14      int i;
    4.15  
    4.16 -    for (i = 0; i < MAX_DISKS; i++) {
    4.17 +    for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) {
    4.18          if (media_filename[i] && bs_table[i]) {
    4.19              do_change(bs_table[i]->device_name, media_filename[i]);
    4.20              free(media_filename[i]);
    4.21 @@ -86,7 +86,7 @@ void xenstore_parse_domain_config(int do
    4.22      int i, is_scsi;
    4.23      unsigned int len, num, hd_index;
    4.24  
    4.25 -    for(i = 0; i < MAX_DISKS; i++)
    4.26 +    for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++)
    4.27          media_filename[i] = NULL;
    4.28  
    4.29      xsh = xs_daemon_open();