The following reply was made to PR kern/154302; it has been noted by GNATS.

From: Janne Snabb <sn...@epipe.com>
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: kern/154302: better do-something-smart.patch
Date: Sun, 22 May 2011 09:16:19 +0000 (UTC)

 Here is a new patch which is hopefully neat enough to be committed. 
 
 Could someone with a commit bit consider this? Lots of people are
 having trouble beacuse of this bug. It can be argued that the bug
 is in Xen and not in FreeBSD, but in reality we do need a work-around
 in FreeBSD. (Or if not, the panic message should be "something
 smarter". :)
 
 --- do-something-smart.patch begins here ---
 Index: sys/dev/xen/netfront/netfront.c
 ===================================================================
 --- sys/dev/xen/netfront/netfront.c    (revision 222131)
 +++ sys/dev/xen/netfront/netfront.c    (working copy)
 @@ -408,9 +408,27 @@
  
        error = xs_read(XST_NIL, xenbus_get_node(dev), "mac", NULL,
            (void **) &macstr);
 -      if (error)
 -              return (error);
  
 +      if (error) {
 +              /*
 +               * Try to read the 'mac' node from the backend side in case
 +               * it does not exist (ENOENT) in the frontend side. This
 +               * happens with various Xen versions if 'type=ioemu' is set
 +               * in the vif configuration. See PR 154302 for more details.
 +               * Otherwise return the error to the caller.
 +               */
 +              if (error != ENOENT)
 +                      return (error);
 +
 +              if (xs_read(XST_NIL, xenbus_get_otherend_path(dev), "mac",
 +                  NULL, (void **) &macstr) != 0)
 +                      /*
 +                       * Return the error code of the frontend read (it
 +                       * is always ENOENT at this point).
 +                       */
 +                      return (error);
 +      }
 +
        s = macstr;
        for (i = 0; i < ETHER_ADDR_LEN; i++) {
                mac[i] = strtoul(s, &e, 16);
 --- do-something-smart.patch ends here ---
 
 --
 Janne Snabb / EPIPE Communications
 sn...@epipe.com - http://epipe.com/
_______________________________________________
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"

Reply via email to