Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/x86 Sprinkle DPRINTF #ifdef DEBUG_GEOM and set ...



details:   https://anonhg.NetBSD.org/src/rev/478c90bc62af
branches:  trunk
changeset: 447942:478c90bc62af
user:      bad <bad%NetBSD.org@localhost>
date:      Mon Jan 28 21:19:09 2019 +0000

description:
Sprinkle DPRINTF #ifdef DEBUG_GEOM and set booted_method like arch/x86/x86/x86_autoconf.c

As discussed 1 week ago on port-xen.

diffstat:

 sys/arch/xen/x86/autoconf.c |  24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diffs (84 lines):

diff -r b769a0969eac -r 478c90bc62af sys/arch/xen/x86/autoconf.c
--- a/sys/arch/xen/x86/autoconf.c       Mon Jan 28 21:16:59 2019 +0000
+++ b/sys/arch/xen/x86/autoconf.c       Mon Jan 28 21:19:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.21 2018/12/22 07:45:58 cherry Exp $     */
+/*     $NetBSD: autoconf.c,v 1.22 2019/01/28 21:19:09 bad Exp $        */
 /*     NetBSD: autoconf.c,v 1.75 2003/12/30 12:33:22 pk Exp    */
 
 /*-
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.21 2018/12/22 07:45:58 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.22 2019/01/28 21:19:09 bad Exp $");
 
 #include "opt_xen.h"
 #include "opt_multiprocessor.h"
@@ -101,6 +101,12 @@
 #include <i386/pci/pcibios.h>
 #endif
 
+#ifdef DEBUG_GEOM
+#define DPRINTF(a) printf a
+#else
+#define DPRINTF(a)
+#endif
+
 /*
  * Determine i/o configuration for a machine.
  */
@@ -170,8 +176,10 @@
        union xen_cmdline_parseinfo xcp;
        static char bootspecbuf[sizeof(xcp.xcp_bootdev)];
 
-       if (booted_device)
+       if (booted_device) {
+               DPRINTF(("%s: preset booted_device: %s\n", __func__, device_xname(booted_device)));
                return;
+       }
 
        xen_parse_cmdline(XEN_PARSE_BOOTDEV, &xcp);
 
@@ -197,17 +205,22 @@
                        continue;
 
                if (is_disk && strlen(xcp.xcp_bootdev) > strlen(devname)) {
+                       /* XXX check device_cfdata as in x86_autoconf.c? */
                        booted_partition = toupper(
                                xcp.xcp_bootdev[strlen(devname)]) - 'A';
+                       DPRINTF(("%s: booted_partition: %d\n", __func__, booted_partition));
                }
 
                booted_device = dv;
+               booted_method = "bootinfo/bootdev";
                break;
        }
        deviter_release(&di);
 
-       if (booted_device)
+       if (booted_device) {
+               DPRINTF(("%s: booted_device: %s\n", __func__, device_xname(booted_device)));
                return;
+       }
 
        /*
         * not a boot device name, pass through to MI code
@@ -215,6 +228,8 @@
        if (xcp.xcp_bootdev[0] != '\0') {
                strlcpy(bootspecbuf, xcp.xcp_bootdev, sizeof(bootspecbuf));
                bootspec = bootspecbuf;
+               booted_method = "bootinfo/bootspec";
+               DPRINTF(("%s: bootspec: %s\n", __func__, bootspec));
                return;
        }
 }
@@ -359,7 +374,6 @@
 static int
 is_valid_disk(device_t dv)
 {
-
        if (device_class(dv) != DV_DISK)
                return (0);
 



Home | Main Index | Thread Index | Old Index