From owner-freebsd-xen@FreeBSD.ORG Sun May 22 09:20:14 2011 Return-Path: Delivered-To: freebsd-xen@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47091106566C for ; Sun, 22 May 2011 09:20:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 37DFA8FC0A for ; Sun, 22 May 2011 09:20:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p4M9KEWT098222 for ; Sun, 22 May 2011 09:20:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4M9KEfO098221; Sun, 22 May 2011 09:20:14 GMT (envelope-from gnats) Date: Sun, 22 May 2011 09:20:14 GMT Message-Id: <201105220920.p4M9KEfO098221@freefall.freebsd.org> To: freebsd-xen@FreeBSD.org From: Janne Snabb Cc: Subject: Re: kern/154302: better do-something-smart.patch X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Janne Snabb List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 09:20:14 -0000 The following reply was made to PR kern/154302; it has been noted by GNATS. From: Janne Snabb To: bug-followup@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 snabb@epipe.com - http://epipe.com/