[SeaBIOS] [PATCH 14/16] always specify virtio-blk rather than virtio

Paolo Bonzini pbonzini at redhat.com
Wed Nov 16 13:02:55 CET 2011


Avoid ambiguity when virtio-scsi will be introduced.

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 src/Kconfig      |    4 ++--
 src/block.c      |    6 +++---
 src/disk.c       |    4 ++--
 src/disk.h       |   18 +++++++++---------
 src/virtio-blk.c |    4 ++--
 src/virtio-blk.h |    2 +-
 6 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/Kconfig b/src/Kconfig
index 338f51a..f8d245a 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -109,10 +109,10 @@ menu "Hardware support"
             Support for AHCI disk code.
     config VIRTIO_BLK
         depends on DRIVES && !COREBOOT
-        bool "VirtIO controllers"
+        bool "virtio-blk controllers"
         default y
         help
-            Support boot from virtio storage.
+            Support boot from virtio-blk storage.
     config FLOPPY
         depends on DRIVES
         bool "Floppy controller"
diff --git a/src/block.c b/src/block.c
index ac9eb26..eeebd83 100644
--- a/src/block.c
+++ b/src/block.c
@@ -11,7 +11,7 @@
 #include "util.h" // dprintf
 #include "ata.h" // process_ata_op
 #include "ahci.h" // process_ahci_op
-#include "virtio-blk.h" // process_virtio_op
+#include "virtio-blk.h" // process_virtio_blk_op
 #include "blockcmd.h" // cdb_*
 
 u8 FloppyCount VAR16VISIBLE;
@@ -315,8 +315,8 @@ process_op(struct disk_op_s *op)
         return process_ramdisk_op(op);
     case DTYPE_CDEMU:
         return process_cdemu_op(op);
-    case DTYPE_VIRTIO:
-	return process_virtio_op(op);
+    case DTYPE_VIRTIO_BLK:
+        return process_virtio_blk_op(op);
     case DTYPE_AHCI:
 	return process_ahci_op(op);
     case DTYPE_USB:
diff --git a/src/disk.c b/src/disk.c
index 8f7c61f..f2c6621 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -546,7 +546,7 @@ disk_1348(struct bregs *regs, struct drive_s *drive_g)
     SET_INT13DPT(regs, blksize, blksize);
 
     if (size < 30 ||
-        (type != DTYPE_ATA && type != DTYPE_ATAPI && type != DTYPE_VIRTIO)) {
+        (type != DTYPE_ATA && type != DTYPE_ATAPI && type != DTYPE_VIRTIO_BLK)) {
         disk_ret(regs, DISK_RET_SUCCESS);
         return;
     }
@@ -651,7 +651,7 @@ disk_1348(struct bregs *regs, struct drive_s *drive_g)
         SET_INT13DPT(regs, iface_path, iobase1);
     }
 
-    if (type != DTYPE_VIRTIO) {
+    if (type != DTYPE_VIRTIO_BLK) {
         SET_INT13DPT(regs, iface_type[0], 'A');
         SET_INT13DPT(regs, iface_type[1], 'T');
         SET_INT13DPT(regs, iface_type[2], 'A');
diff --git a/src/disk.h b/src/disk.h
index ac33518..dd7c46a 100644
--- a/src/disk.h
+++ b/src/disk.h
@@ -198,15 +198,15 @@ struct drive_s {
 #define DISK_SECTOR_SIZE  512
 #define CDROM_SECTOR_SIZE 2048
 
-#define DTYPE_NONE     0x00
-#define DTYPE_FLOPPY   0x01
-#define DTYPE_ATA      0x02
-#define DTYPE_ATAPI    0x03
-#define DTYPE_RAMDISK  0x04
-#define DTYPE_CDEMU    0x05
-#define DTYPE_USB      0x06
-#define DTYPE_VIRTIO   0x07
-#define DTYPE_AHCI     0x08
+#define DTYPE_NONE         0x00
+#define DTYPE_FLOPPY       0x01
+#define DTYPE_ATA          0x02
+#define DTYPE_ATAPI        0x03
+#define DTYPE_RAMDISK      0x04
+#define DTYPE_CDEMU        0x05
+#define DTYPE_USB          0x06
+#define DTYPE_VIRTIO_BLK   0x07
+#define DTYPE_AHCI         0x08
 
 #define MAXDESCSIZE 80
 
diff --git a/src/virtio-blk.c b/src/virtio-blk.c
index b1274fc..a81a873 100644
--- a/src/virtio-blk.c
+++ b/src/virtio-blk.c
@@ -75,7 +75,7 @@ virtio_blk_op(struct disk_op_s *op, int write)
 }
 
 int
-process_virtio_op(struct disk_op_s *op)
+process_virtio_blk_op(struct disk_op_s *op)
 {
     if (! CONFIG_VIRTIO_BLK || CONFIG_COREBOOT)
         return 0;
@@ -110,7 +110,7 @@ init_virtio_blk(struct pci_device *pci)
     }
     memset(vdrive_g, 0, sizeof(*vdrive_g));
     memset(vq, 0, sizeof(*vq));
-    vdrive_g->drive.type = DTYPE_VIRTIO;
+    vdrive_g->drive.type = DTYPE_VIRTIO_BLK;
     vdrive_g->drive.cntl_id = bdf;
     vdrive_g->vq = vq;
 
diff --git a/src/virtio-blk.h b/src/virtio-blk.h
index 7243704..0825f09 100644
--- a/src/virtio-blk.h
+++ b/src/virtio-blk.h
@@ -37,7 +37,7 @@ struct virtio_blk_outhdr {
 #define VIRTIO_BLK_S_UNSUPP	2
 
 struct disk_op_s;
-int process_virtio_op(struct disk_op_s *op);
+int process_virtio_blk_op(struct disk_op_s *op);
 void virtio_blk_setup(void);
 
 #endif /* _VIRTIO_BLK_H */
-- 
1.7.7.1





More information about the SeaBIOS mailing list