From: Joe Jin Subject: Re: Re: [patch] netfront: unregister net device at backend_changed() if network_connect() failed Date: Thu, 20 Nov 2008 10:53:10 +0800 Message-ID: <20081120025310.GA28166@joejin-pc.cn.oracle.com> References: <20081119021337.GA16531@joejin-pc.cn.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen-Devel , Joe Jin List-Id: xen-devel@lists.xenproject.org On 2008-11-19 08:54, Keir Fraser wrote: > On 19/11/08 02:13, "Joe Jin" wrote: >=20 > >> Have you actually seen this problem occur, in stress tests or elsewher= e? Or > >> is this just a 'nice to have'? If the former I'd rather fix the bug! > >>=20 > >=20 > > At vm config file set vif type to ioemu and booting guest with pv drive= r, > > always saw the interface, unregister the device when network_connect(), > > I just saw one nic with 8139 driver. >=20 > I think failure to connect in frontend should always be a bug condition. >=20 > In this case, xend shouldn't be creating front and back directories at al= l. > What happens if you make netif's getDeviceDetails() return None for devid= if > type =3D=3D 'ioemu'? This should cause DevController.py not to set up the > front/back details and netfront.c will never get triggered. >=20 The change could not stoped kernel insert xen_vnif driver. =46rom xend.log I did not saw xend have tried to create vnif device at all, I'm not sure whether virtual device platform "Xen Platform Device" have preallocated the interface, then kernel try to load the driver? Below are some xend logs: [2008-11-20 10:43:01 16111] DEBUG (XendDomainInfo:85) XendDomainInfo.create= (['vm', ['name', 'hvm'], ['memory', '1024'], ['on_reboot', 'restart'], ['on= _crash', 'preserve'], ['vcpus', 1], ['on_xend_start', 'ignore'], ['on_xend_= stop', 'ignore'], ['image', ['hvm', ['kernel', '/usr/lib/xen/boot/hvmloader= '], ['device_model', '/usr/lib/xen/bin/qemu-dm'], ['pae', 1], ['vcpus', 1],= ['boot', 'c'], ['fda', ''], ['fdb', ''], ['timer_mode', 0], ['localtime', = 0], ['serial', 'pty'], ['stdvga', 0], ['isa', 0], ['nographic', 0], ['sound= hw', ''], ['vnc', 1], ['vncunused', 1], ['vncconsole', 1], ['vnclisten', '0= 0.0.0'], ['display', 'localhost:11.0'], ['xauthority', '/root/.Xauthority'= ], ['rtc_timeoffset', '0'], ['monitor', 0], ['acpi', 1], ['apic', 1], ['usb= ', 0], ['usbdevice', ''], ['keymap', ''], ['hpet', 0]]], ['device', ['vbd',= ['uname', 'file:/root/OVM_EL5U1_X86_HVM_4GB/system.img'], ['dev', 'hda'], = ['mode', 'w']]], ['device', ['vif', ['bridge', 'xenbr0'], ['mac', '00:16:3E= :40:F6:58'], ['type', 'ioemu']]]]) [2008-11-20 10:43:01 16111] DEBUG (XendDomainInfo:1534) XendDomainInfo.cons= tructDomain [2008-11-20 10:43:01 16111] DEBUG (balloon:116) Balloon: 1487380 KiB free; = need 2048; done. [2008-11-20 10:43:01 16111] DEBUG (XendDomain:434) Adding Domain: 50 [2008-11-20 10:43:01 16111] DEBUG (XendDomainInfo:1600) XendDomainInfo.init= Domain: 50 256 [2008-11-20 10:43:01 16111] DEBUG (image:337) args: boot, val: c [2008-11-20 10:43:02 16111] DEBUG (image:337) args: fda, val: None [2008-11-20 10:43:02 16111] DEBUG (image:337) args: fdb, val: None [2008-11-20 10:43:02 16111] DEBUG (image:337) args: soundhw, val: None [2008-11-20 10:43:02 16111] DEBUG (image:337) args: localtime, val: 0 [2008-11-20 10:43:02 16111] DEBUG (image:337) args: serial, val: pty [2008-11-20 10:43:02 16111] DEBUG (image:337) args: std-vga, val: 0 [2008-11-20 10:43:02 16111] DEBUG (image:337) args: isa, val: 0 [2008-11-20 10:43:02 16111] DEBUG (image:337) args: acpi, val: 1 [2008-11-20 10:43:02 16111] DEBUG (image:337) args: usb, val: 0 [2008-11-20 10:43:02 16111] DEBUG (image:337) args: usbdevice, val: None [2008-11-20 10:43:02 16111] DEBUG (image:337) args: k, val: None [2008-11-20 10:43:02 16111] DEBUG (XendDomainInfo:1634) _initDomain:shadow_= memory=3D0x0, memory_static_max=3D0x40000000, memory_static_min=3D0x0. [2008-11-20 10:43:02 16111] DEBUG (balloon:116) Balloon: 1486344 KiB free; = need 1065984; done. [2008-11-20 10:43:02 16111] INFO (image:128) buildDomain os=3Dhvm dom=3D50 = vcpus=3D1 [2008-11-20 10:43:02 16111] DEBUG (image:281) domid =3D 50 [2008-11-20 10:43:02 16111] DEBUG (image:282) image =3D /usr/lib/x= en/boot/hvmloader [2008-11-20 10:43:02 16111] DEBUG (image:283) store_evtchn =3D 2 [2008-11-20 10:43:02 16111] DEBUG (image:284) memsize =3D 1024 [2008-11-20 10:43:02 16111] DEBUG (image:285) vcpus =3D 1 [2008-11-20 10:43:02 16111] DEBUG (image:286) acpi =3D 1 [2008-11-20 10:43:02 16111] DEBUG (image:287) apic =3D 1 [2008-11-20 10:43:02 16111] INFO (XendDomainInfo:1433) createDevice: vfb : = {'vncunused': 1, 'vnclisten': '0.0.0.0', 'uuid': 'ae2833f3-19eb-8db8-edbf-2= c7a4c654ffa', 'other_config': {'vncunused': 1, 'vnclisten': '0.0.0.0'}} [2008-11-20 10:43:02 16111] DEBUG (DevController:118) DevController: writin= g {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vfb= /50/0'} to /local/domain/50/device/vfb/0. [2008-11-20 10:43:02 16111] DEBUG (DevController:120) DevController: writin= g {'vncunused': '1', 'domain': 'hvm', 'frontend': '/local/domain/50/device/= vfb/0', 'uuid': 'ae2833f3-19eb-8db8-edbf-2c7a4c654ffa', 'vnclisten': '0.0.0= 0', 'state': '1', 'online': '1', 'frontend-id': '50'} to /local/domain/0/b= ackend/vfb/50/0. [2008-11-20 10:43:02 16111] INFO (XendDomainInfo:1433) createDevice: vbd : = {'uuid': '4c32c5b6-def4-d808-46fd-259083eaa2e0', 'bootable': 1, 'driver': '= paravirtualised', 'dev': 'hda', 'uname': 'file:/root/OVM_EL5U1_X86_HVM_4GB/= system.img', 'mode': 'w'} [2008-11-20 10:43:02 16111] DEBUG (DevController:118) DevController: writin= g {'backend-id': '0', 'virtual-device': '768', 'device-type': 'disk', 'stat= e': '1', 'backend': '/local/domain/0/backend/vbd/50/768'} to /local/domain/= 50/device/vbd/768. [2008-11-20 10:43:02 16111] DEBUG (DevController:120) DevController: writin= g {'domain': 'hvm', 'frontend': '/local/domain/50/device/vbd/768', 'uuid': = '4c32c5b6-def4-d808-46fd-259083eaa2e0', 'format': 'raw', 'dev': 'hda', 'sta= te': '1', 'params': '/root/OVM_EL5U1_X86_HVM_4GB/system.img', 'mode': 'w', = 'online': '1', 'frontend-id': '50', 'type': 'file'} to /local/domain/0/back= end/vbd/50/768. [2008-11-20 10:43:02 16111] INFO (XendDomainInfo:1433) createDevice: vif : = {'bridge': 'xenbr0', 'mac': '00:16:3E:40:F6:58', 'type': 'ioemu', 'uuid': '= 33f63ceb-c077-d4f8-8f56-d4ffb9395436'} [2008-11-20 10:43:02 16111] DEBUG (DevController:118) DevController: writin= g {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vif= /50/0'} to /local/domain/50/device/vif/0. [2008-11-20 10:43:02 16111] DEBUG (DevController:120) DevController: writin= g {'bridge': 'xenbr0', 'domain': 'hvm', 'handle': '0', 'uuid': '33f63ceb-c0= 77-d4f8-8f56-d4ffb9395436', 'script': '/etc/xen/scripts/vif-bridge', 'mac':= '00:16:3E:40:F6:58', 'frontend-id': '50', 'state': '1', 'online': '1', 'fr= ontend': '/local/domain/50/device/vif/0', 'type': 'ioemu'} to /local/domain= /0/backend/vif/50/0. [2008-11-20 10:43:02 16111] INFO (image:453) spawning device models: /usr/l= ib/xen/bin/qemu-dm ['/usr/lib/xen/bin/qemu-dm', '-d', '50', '-vcpus', '1', = '-boot', 'c', '-serial', 'pty', '-acpi', '-domain-name', 'hvm', '-net', 'ni= c,vlan=3D1,macaddr=3D00:16:3E:40:F6:58,model=3Drtl8139', '-net', 'tap,vlan= =3D1,ifname=3Dtap50.0,bridge=3Dxenbr0', '-vncunused', '-vnclisten', '0.0.0.= 0', '-vncviewer'] [2008-11-20 10:43:02 16111] INFO (image:457) device model pid: 17913 [2008-11-20 10:43:02 16111] DEBUG (XendDomainInfo:2119) Storing VM details:= {'on_xend_stop': 'ignore', 'shadow_memory': '9', 'uuid': '0cb51839-52ae-d4= aa-8216-9bf0a1565801', 'on_reboot': 'restart', 'start_time': '1227148982.39= ', 'on_poweroff': 'destroy', 'on_xend_start': 'ignore', 'on_crash': 'preser= ve', 'xend/restart_count': '0', 'vcpus': '1', 'vcpu_avail': '1', 'image': '= (hvm (kernel /usr/lib/xen/boot/hvmloader) (acpi 1) (apic 1) (boot c) (devic= e_model /usr/lib/xen/bin/qemu-dm) (display localhost:11.0) (isa 0) (localti= me 0) (monitor 0) (nographic 0) (pae 1) (rtc_timeoffset 0) (serial pty) (st= dvga 0) (usb 0) (hpet 0) (vnc 1) (vncconsole 1) (vnclisten 0.0.0.0) (timer_= mode 0) (vncunused 1) (xauthority /root/.Xauthority) (notes (SUSPEND_CANCEL= 1)))', 'name': 'hvm'} [2008-11-20 10:43:02 16111] DEBUG (XendDomainInfo:923) Storing domain detai= ls: {'console/port': '3', 'name': 'hvm', 'console/limit': '1048576', 'vm': = '/vm/0cb51839-52ae-d4aa-8216-9bf0a1565801', 'domid': '50', 'image/suspend-c= ancel': '1', 'cpu/0/availability': 'online', 'memory/target': '1048576', 'c= ontrol/platform-feature-multiprocessor-suspend': '1', 'store/ring-ref': '26= 2142', 'store/port': '2'} [2008-11-20 10:43:02 16111] DEBUG (DevController:118) DevController: writin= g {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/con= sole/50/0'} to /local/domain/50/device/console/0. [2008-11-20 10:43:02 16111] DEBUG (DevController:120) DevController: writin= g {'domain': 'hvm', 'frontend': '/local/domain/50/device/console/0', 'uuid'= : 'b5cbb9a8-20ea-3123-4146-664c8cde5b54', 'frontend-id': '50', 'state': '1'= , 'location': '3', 'online': '1', 'protocol': 'vt100'} to /local/domain/0/b= ackend/console/50/0. [2008-11-20 10:43:02 16111] DEBUG (XendDomainInfo:1007) XendDomainInfo.hand= leShutdownWatch [2008-11-20 10:43:02 16111] DEBUG (DevController:151) Waiting for devices v= if. [2008-11-20 10:43:02 16111] DEBUG (DevController:156) Waiting for 0. [2008-11-20 10:43:02 16111] DEBUG (DevController:590) hotplugStatusCallback= /local/domain/0/backend/vif/50/0/hotplug-status. [2008-11-20 10:43:02 16111] DEBUG (DevController:590) hotplugStatusCallback= /local/domain/0/backend/vif/50/0/hotplug-status. [2008-11-20 10:43:02 16111] DEBUG (DevController:604) hotplugStatusCallback= 1. [2008-11-20 10:43:02 16111] DEBUG (DevController:151) Waiting for devices u= sb. [2008-11-20 10:43:02 16111] DEBUG (DevController:151) Waiting for devices v= bd. [2008-11-20 10:43:02 16111] DEBUG (DevController:156) Waiting for 768. [2008-11-20 10:43:02 16111] DEBUG (DevController:590) hotplugStatusCallback= /local/domain/0/backend/vbd/50/768/hotplug-status. [2008-11-20 10:43:03 16111] DEBUG (DevController:590) hotplugStatusCallback= /local/domain/0/backend/vbd/50/768/hotplug-status. [2008-11-20 10:43:03 16111] DEBUG (DevController:604) hotplugStatusCallback= 1. [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices i= rq. [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices v= kbd. [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices v= fb. [2008-11-20 10:43:03 16111] DEBUG (vfbif:109) skip waiting for HVM vfb [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices c= onsole. [2008-11-20 10:43:03 16111] DEBUG (DevController:156) Waiting for 0. [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices p= ci. [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices i= oports. [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices t= ap. [2008-11-20 10:43:03 16111] DEBUG (DevController:151) Waiting for devices v= tpm. [2008-11-20 10:43:03 16111] INFO (XendDomain:1121) Domain hvm (50) unpaused.