Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Virtio block devices may have a "scsi" device_type inste...



details:   https://anonhg.NetBSD.org/src/rev/061ab9cfb9e6
branches:  trunk
changeset: 822561:061ab9cfb9e6
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Mar 25 09:21:21 2017 +0000

description:
Virtio block devices may have a "scsi" device_type instead of "block",
so accept both.

diffstat:

 sys/arch/sparc/stand/common/promdev.c |  4 +++-
 sys/arch/sparc/stand/ofwboot/ofdev.c  |  9 +++++----
 sys/dev/ofw/ofdisk.c                  |  6 +++---
 3 files changed, 11 insertions(+), 8 deletions(-)

diffs (82 lines):

diff -r 3022de4f7500 -r 061ab9cfb9e6 sys/arch/sparc/stand/common/promdev.c
--- a/sys/arch/sparc/stand/common/promdev.c     Sat Mar 25 07:00:33 2017 +0000
+++ b/sys/arch/sparc/stand/common/promdev.c     Sat Mar 25 09:21:21 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: promdev.c,v 1.27 2013/12/30 08:43:28 martin Exp $ */
+/*     $NetBSD: promdev.c,v 1.28 2017/03/25 09:21:21 martin Exp $ */
 
 /*
  * Copyright (c) 1993 Paul Kranenburg
@@ -562,6 +562,8 @@
                cp = mygetpropstring(node, "device_type");
                if (strcmp(cp, "block") == 0)
                        return (DT_BLOCK);
+               if (strcmp(cp, "scsi") == 0)
+                       return (DT_BLOCK);
                else if (strcmp(cp, "network") == 0)
                        return (DT_NET);
                else if (strcmp(cp, "byte") == 0)
diff -r 3022de4f7500 -r 061ab9cfb9e6 sys/arch/sparc/stand/ofwboot/ofdev.c
--- a/sys/arch/sparc/stand/ofwboot/ofdev.c      Sat Mar 25 07:00:33 2017 +0000
+++ b/sys/arch/sparc/stand/ofwboot/ofdev.c      Sat Mar 25 09:21:21 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofdev.c,v 1.35 2014/02/20 15:11:36 joerg Exp $ */
+/*     $NetBSD: ofdev.c,v 1.36 2017/03/25 09:21:21 martin Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -94,7 +94,8 @@
                         * if not, lp is the delimiter between device and
                         * path.  if the last component was a block device.
                         */
-                       if (!strcmp(devtype, "block")) {
+                       if (strcmp(devtype, "block") == 0
+                           || strcmp(devtype, "scsi") == 0) {
                                /* search for arguments */
                                DPRINTF(("filename: hunting for arguments "
                                       "in %s\n", lp));
@@ -410,7 +411,7 @@
        if (_prom_getprop(handle, "device_type", b.buf, sizeof b.buf) < 0)
                return ENXIO;
        DPRINTF(("devopen: %s is a %s device\n", fname, b.buf));
-       if (!strcmp(b.buf, "block")) {
+       if (strcmp(b.buf, "block") == 0 || strcmp(b.buf, "scsi") == 0) {
                pp = strrchr(fname, ':');
                if (pp && pp[1] >= 'a' && pp[1] <= 'f' && pp[2] == 0) {
                        savedpart = pp[1];
@@ -459,7 +460,7 @@
        DPRINTF(("devopen: %s is now open\n", fname));
        memset(&ofdev, 0, sizeof ofdev);
        ofdev.handle = handle;
-       if (!strcmp(b.buf, "block")) {
+       if (strcmp(b.buf, "block") == 0 || strcmp(b.buf, "scsi") == 0) {
                ofdev.type = OFDEV_DISK;
                ofdev.bsize = DEV_BSIZE;
                /* First try to find a disklabel without MBR partitions */
diff -r 3022de4f7500 -r 061ab9cfb9e6 sys/dev/ofw/ofdisk.c
--- a/sys/dev/ofw/ofdisk.c      Sat Mar 25 07:00:33 2017 +0000
+++ b/sys/dev/ofw/ofdisk.c      Sat Mar 25 09:21:21 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofdisk.c,v 1.51 2015/04/26 15:15:20 mlelstv Exp $      */
+/*     $NetBSD: ofdisk.c,v 1.52 2017/03/25 09:21:21 martin Exp $       */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.51 2015/04/26 15:15:20 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.52 2017/03/25 09:21:21 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -131,7 +131,7 @@
        if (l >= sizeof type)
                return 0;
        type[l] = 0;
-       return !strcmp(type, "block");
+       return strcmp(type, "block") == 0 || strcmp(type, "scsi") == 0;
 }
 
 static void



Home | Main Index | Thread Index | Old Index