Port-xen archive

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

Re: NetBSD (5.1) with Xen 4-1-unstable, w/ xl. [patch included]



On Mon, Apr 11, 2011 at 02:15:14PM -0400, Konrad Rzeszutek Wilk wrote:
> > 
> > Hi Konrad,
> > 
> > Thank you for reporting and issue. I have committed the fix to
> > -current which slightly differs from your version.
> > 
> > I initialize err to 0 right after the for () loop to catch all error
> > pathes with 'continue' in it:
> > http://mail-index.netbsd.org/source-changes/2011/04/11/msg020938.html

I added a simple debug:

Index: arch/xen/xenbus/xenbus_probe.c
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/xenbus/xenbus_probe.c,v
retrieving revision 1.26.2.1
diff -u -p -r1.26.2.1 xenbus_probe.c
--- arch/xen/xenbus/xenbus_probe.c      16 Jan 2009 01:17:49 -0000      1.26.2.1
+++ arch/xen/xenbus/xenbus_probe.c      11 Apr 2011 18:51:27 -0000
@@ -31,7 +31,7 @@
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.26.2.1 2009/01/16 01:17:49 snj 
Exp $");
 
-#if 0
+#if 1
 #define DPRINTK(fmt, args...) \
     printf("xenbus_probe (%s:%d) " fmt ".\n", __func__, __LINE__, ##args)
 #else
@@ -284,6 +284,7 @@ xenbus_probe_device_type(const char *pat
                return err;
 
        for (i = 0; i < dir_n; i++) {
+               err = 0;
                /*
                 * add size of path to size of xenbus_device. xenbus_device
                 * already has room for one char in xbusd_path.
@@ -302,6 +303,7 @@ xenbus_probe_device_type(const char *pat
                }
                err = xenbus_read_ul(NULL, xbusd->xbusd_path, "state",
                    &state, 10);
+               DPRINTK("%d/%d path: %s", i, dir_n, xbusd->xbusd_path);
                if (err) {
                        printf("xenbus: can't get state "
                            "for %s (%d)\n", xbusd->xbusd_path, err);

and got this:

NetBSD 5.1 (XEN3PAE_DOMU) #7: Mon Apr 11 14:37:37 EDT 2011
        
konrad@phenom:/home/konrad/netbsd/5.1/NetBSD-domU/obj/sys/arch/i386/compile/XEN3PAE_DOMU
total memory = 512 MB
avail memory = 496 MB
mainbus0 (root)
hypervisor0 at mainbus0: Xen version 4.2
vcpu0 at hypervisor0: AMD 686-class, 3000MHz, id 0x100fa0
xenbus0 at hypervisor0: Xen Virtual Bus Interface
xencons0 at hypervisor0: Xen Virtual Console Driver
xencons0: using event channel 2
npx0 at hypervisor0: using exception 16
xenbus_probe (xenbus_probe_init:530) .
xenbus_probe (xenbus_probe_frontends:393) probe device.
xenbus_probe (xenbus_probe_frontends:395) directory err 0 dir_n 5.
xenbus_probe (xenbus_probe_device_type:280) probe device/suspend type suspend.
xenbus_probe (xenbus_probe_device_type:282) directory err 0 dir_n 1.
xenbus_probe (xenbus_probe_device_type:306) 0/1 path: 
device/suspend/event-channel.
xenbus: can't get state for device/suspend/event-channel (2)
xenbus_probe (xenbus_probe_backends:426) probe backend.
xenbus_probe (xenbus_probe_backends:428) directory err 2 dirt_n -897756272.
xenbus_probe (frontend_changed:478) frontend_changed device
.
xenbus_probe (xenbus_probe_frontends:393) probe device.
xenbus_probe (xenbus_probe_init:592) done.
raidattach: Asked for 8 units
Kernelized RAIDframe activated
Searching for RAID components...
boot device: <unknown>
root device: 

The issue is that the failure is at the end of the loop (there is only
_one_ entry in the device/suspend directory (event-channel is the entry)
 so the continue after the xenbus_read_ul exits the loop, and we exit with
the err = -2.



Home | Main Index | Thread Index | Old Index