From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: Re: [Bug 1612] Can't start VM when vif set and udev version is greater than 151 Date: Wed, 07 Jul 2010 08:30:19 +0100 Message-ID: <4C34492B0200007800009EC0@vpn.id2.novell.com> References: <201007051720.o65HKsI6030388@bugzilla.xensource.com> <20100706151023.GA25263@phenom.dumpdata.com> <4C3369970200007800009C71@vpn.id2.novell.com> <20100706164642.GA31742@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part260B531B.2__=" Return-path: In-Reply-To: <20100706164642.GA31742@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Konrad Rzeszutek Wilk Cc: Jeremy Fitzhardinge , james.harper@bendigoit.com.au, xen-devel@lists.xensource.com, bastian@waldi.eu.org List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part260B531B.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >>> On 06.07.10 at 18:46, Konrad Rzeszutek Wilk = wrote: >> For reference, below is the diff for what we're now using. >=20 > Ah nice..=20 >=20 > I get this: > patch -p1 --dry-run < ~/p.patch=20 > patching file drivers/xen/netback/xenbus.c > Hunk #1 succeeded at 19 with fuzz 1. > Hunk #2 FAILED at 29. > Hunk #3 FAILED at 40. > patch: **** malformed patch at line 120: nv *env) >=20 > If it would not be too much trouble, can you attach it as an attachment? Sure, here you go. Jan --=__Part260B531B.2__= Content-Type: text/plain; name="netback-xenbus.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="netback-xenbus.diff" --- cpp/kernel/head-2010-05-12/drivers/xen/netback/xenbus.c 2010-03-02 = 10:23:37.000000000 +0100=0A+++ cpp/kernel/head-2010-06-22/drivers/xen/netba= ck/xenbus.c 2010-07-05 12:03:12.000000000 +0200=0A@@ -19,6 +19,7 @@=0A = =0A #include =0A #include =0A+#include =0A #include =0A #include "common.h"=0A =0A@@ -28,6 = +29,7 @@=0A printk("netback/xenbus (%s:%d) " fmt ".\n", __FUNCTION__, = __LINE__, ##args)=0A #endif=0A =0A+static DECLARE_RWSEM(teardown_sem);=0A = =0A static int connect_rings(struct backend_info *);=0A static void = connect(struct backend_info *);=0A@@ -39,13 +41,18 @@ static int netback_re= move(struct xenbus_=0A =0A netback_remove_accelerators(be, dev);=0A = =0A- if (be->netif) {=0A+ if (be->netif)=0A kobject_uev= ent(&dev->dev.kobj, KOBJ_OFFLINE);=0A+=0A+ down_write(&teardown_sem);= =0A+ if (be->netif) {=0A netif_disconnect(be->netif);=0A = be->netif =3D NULL;=0A }=0A- kfree(be);=0A dev_set_drvdata(&de= v->dev, NULL);=0A+ up_write(&teardown_sem);=0A+ kfree(be);=0A+=0A = return 0;=0A }=0A =0A@@ -151,8 +158,7 @@ fail:=0A */=0A static int = netback_uevent(struct xenbus_device *xdev, struct kobj_uevent_env *env)=0A = {=0A- struct backend_info *be =3D dev_get_drvdata(&xdev->dev);=0A- = netif_t *netif =3D be->netif;=0A+ struct backend_info *be;=0A = char *val;=0A =0A DPRINTK("netback_uevent");=0A@@ -163,12 +169,15 @@ = static int netback_uevent(struct xenbus_=0A xenbus_dev_fatal(xd= ev, err, "reading script");=0A return err;=0A }=0A- else {=0A- = add_uevent_var(env, "script=3D%s", val);=0A- kfree(val);= =0A- }=0A =0A- add_uevent_var(env, "vif=3D%s", netif->dev->name);= =0A+ add_uevent_var(env, "script=3D%s", val);=0A+ kfree(val);=0A+=0A+= down_read(&teardown_sem);=0A+ be =3D dev_get_drvdata(&xdev->dev);= =0A+ if (be && be->netif)=0A+ add_uevent_var(env, = "vif=3D%s", be->netif->dev->name);=0A+ up_read(&teardown_sem);=0A =0A = return 0;=0A }=0A@@ -179,6 +188,7 @@ static void backend_create_netif(struc= t =0A int err;=0A long handle;=0A struct xenbus_device *dev = =3D be->dev;=0A+ netif_t *netif;=0A =0A if (be->netif !=3D = NULL)=0A return;=0A@@ -189,13 +199,13 @@ static void = backend_create_netif(struct =0A return;=0A }=0A =0A- = be->netif =3D netif_alloc(&dev->dev, dev->otherend_id, handle);=0A- if = (IS_ERR(be->netif)) {=0A- err =3D PTR_ERR(be->netif);=0A- = be->netif =3D NULL;=0A+ netif =3D netif_alloc(&dev->dev, dev->otherend_id, = handle);=0A+ if (IS_ERR(netif)) {=0A+ err =3D PTR_ERR(net= if);=0A xenbus_dev_fatal(dev, err, "creating interface");= =0A return;=0A }=0A+ be->netif =3D netif;=0A =0A = kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);=0A }=0A --=__Part260B531B.2__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part260B531B.2__=--