Treat iSCSI targets as block devices. yaboot-1.3.17-rc1
authorRoman Rakus <rrakus@redhat.com>
Thu, 5 Aug 2010 05:04:46 +0000 (15:04 +1000)
committerTony Breeds <tony@bakeyournoodle.com>
Thu, 5 Aug 2010 05:04:46 +0000 (15:04 +1000)
Currently iSCSI targets are treated as network devices, this doesn't always
work firmware is capable of treating them like block devices which seems more
reliable.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
second/file.c
second/fs_ext2.c
second/partition.c
second/prom.c

index 466abf238eae53c3604e32707416753642a4db31..a52b664e8900c6e789764c696f5d4e61ab9fab0d 100644 (file)
@@ -675,6 +675,9 @@ int open_file(struct boot_fspec_t* spec, struct boot_file_t* file)
      case FILE_DEVICE_BLOCK:
          DEBUG_F("device is a block device\n");
          return file_block_open(file, spec, spec->part);
      case FILE_DEVICE_BLOCK:
          DEBUG_F("device is a block device\n");
          return file_block_open(file, spec, spec->part);
+     case FILE_DEVICE_ISCSI:
+         DEBUG_F("device is a iSCSI device\n");
+         return file_block_open(file, spec, spec->part);
      case FILE_DEVICE_NET:
          DEBUG_F("device is a network device\n");
          return file_net_open(file, spec);
      case FILE_DEVICE_NET:
          DEBUG_F("device is a network device\n");
          return file_net_open(file, spec);
index c86907ebb89464681194da73c951bc56ad0981eb..a8bdf6bdf6d8de71a3bdf11275317eb9d6f234b5 100644 (file)
@@ -141,7 +141,8 @@ ext2_open(  struct boot_file_t*     file,
          DEBUG_LEAVE(FILE_ERR_FSBUSY);
          return FILE_ERR_FSBUSY;
      }
          DEBUG_LEAVE(FILE_ERR_FSBUSY);
          return FILE_ERR_FSBUSY;
      }
-     if (file->device_kind != FILE_DEVICE_BLOCK) {
+     if (file->device_kind != FILE_DEVICE_BLOCK
+         && file->device_kind != FILE_DEVICE_ISCSI) {
          DEBUG_LEAVE(FILE_ERR_BADDEV);
          return FILE_ERR_BADDEV;
      }
          DEBUG_LEAVE(FILE_ERR_BADDEV);
          return FILE_ERR_BADDEV;
      }
index d20a0ede652c08a37494cd323146c59396541b71..4381770fcca5facc0171fc52308b273478235608 100644 (file)
@@ -400,7 +400,8 @@ get_part_type(char *device, int partition)
      struct partition_t*       found;
      char *type = NULL;
 
      struct partition_t*       found;
      char *type = NULL;
 
-     if (prom_get_devtype(device) != FILE_DEVICE_BLOCK)
+     int device_kind = prom_get_devtype(device);
+     if (device_kind != FILE_DEVICE_BLOCK && device_kind != FILE_DEVICE_ISCSI)
          return NULL;
 
      parts = partitions_lookup(device);
          return NULL;
 
      parts = partitions_lookup(device);
index fbadb2ac664632a9243fbaf4d44c9a6a273c466e..784994d5bbdc938099738a31b2fc7bdb8a137dd3 100644 (file)
@@ -196,7 +196,7 @@ prom_get_devtype (char *device)
      char       tmp[64];
 
      if (strstr(device, TOK_ISCSI))
      char       tmp[64];
 
      if (strstr(device, TOK_ISCSI))
-         device = strcpy(tmp, "/vdevice/gscsi/disk");
+         return FILE_DEVICE_ISCSI;
 
      /* Find OF device phandle */
      dev = prom_finddevice(device);
 
      /* Find OF device phandle */
      dev = prom_finddevice(device);