list user
2006-May-04 16:47 UTC
[Xen-users] BUG? domU reboot fails when using "pci =" option
Hi all, I believe I''ve found a bug. Running xen-3.0.2-2 with linux-2.6.16 built from sources. Domain-0 has one hidden PCI slot: pciback.hide=(00:0d.0) It is exposed in a domU with pci = [''00:0d.0'']. If that domU is shutdown with xm destroy, or with a shutdown -h now, all works as expected. But if instead it is rebooted, either by xm reboot or shutdown -r now, it shuts down, attempts to restart and fails silently. This is evidenced by the fact that an xm list has used up one increment on its domU counter. At that point a manual start works. Now, if the pci device is NOT enabled in the domU config file, reboot works correctly. Checking xend.log provides a clue: dev_config referenced before assignment in /usr/lib/xen/xend/server/pciif.py Not really a python coder but it looks like the invocation in question is on line 97, which indicates that whole section of code may be borked, since it now thinks it''s xen-2.0. Hope that''s helpful to someone. Mike Wright _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
list user
2006-May-04 17:53 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
list user wrote:> Hi all, > > I believe I''ve found a bug. > > Running xen-3.0.2-2 with linux-2.6.16 built from sources. > > Domain-0 has one hidden PCI slot: pciback.hide=(00:0d.0) > > It is exposed in a domU with pci = [''00:0d.0'']. > > If that domU is shutdown with xm destroy, or with a shutdown -h now, all > works as expected. But if instead it is rebooted, either by xm reboot > or shutdown -r now, it shuts down, attempts to restart and fails > silently. This is evidenced by the fact that an xm list has used up one > increment on its domU counter. At that point a manual start works. > > Now, if the pci device is NOT enabled in the domU config file, reboot > works correctly. > > Checking xend.log provides a clue: > > dev_config referenced before assignment in > /usr/lib/xen/xend/server/pciif.py > > Not really a python coder but it looks like the invocation in question > is on line 97, which indicates that whole section of code may be borked, > since it now thinks it''s xen-2.0. >Additional info. If xend and xendomains are set to run automatically at boot time via chkconfig the same error occurs, but ONLY when the pci device has been exported to a domU. An "xm list" starts at domid 2, showing that one domU has failed at startup. Again, the error is familiar, but this time displays on the domain-0 console: local variable dev_config referenced before assignment :m)> Hope that''s helpful to someone. > > Mike Wright > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ryan
2006-May-04 20:24 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
On Thu, 2006-05-04 at 10:53 -0700, list user wrote:> list user wrote: > > Additional info. > > If xend and xendomains are set to run automatically at boot time via > chkconfig the same error occurs, but ONLY when the pci device has been > exported to a domU. An "xm list" starts at domid 2, showing that one > domU has failed at startup. > > Again, the error is familiar, but this time displays on the domain-0 > console: > > local variable dev_config referenced before assignment > > :m) > > > Hope that''s helpful to someone. > > > > Mike Wright > >I''m not quite sure how this python error could be causing your reboot problem, but you did find a typo in that script. I''ll submit a patch for it to xen-unstable. If you''d like to fix it yourself, just change dev_config to config. Did you upgrade your box from xen 2.0.x to xen 3.0.2? That code path is unlikely to be followed unless you either used an SXP configuration file (which I didn''t think you had done because "pci = [''00:0d.0'']" wouldn''t work in an SXP file) or your Xen 3.0.2 installation didn''t completely overwrite all of the Xen 2.0.x files. Ryan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
list user
2006-May-04 23:04 UTC
Re: [Xen-devel] Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
Ryan wrote:> On Thu, 2006-05-04 at 10:53 -0700, list user wrote: > >>list user wrote: >> >>Additional info. >> >>If xend and xendomains are set to run automatically at boot time via >>chkconfig the same error occurs, but ONLY when the pci device has been >>exported to a domU. An "xm list" starts at domid 2, showing that one >>domU has failed at startup. >> >>Again, the error is familiar, but this time displays on the domain-0 >>console: >> >> local variable dev_config referenced before assignment >> >>:m) >> >> >>>Hope that''s helpful to someone. >>> >>>Mike Wright >>> > > > I''m not quite sure how this python error could be causing your reboot > problem, but you did find a typo in that script. I''ll submit a patch for > it to xen-unstable. If you''d like to fix it yourself, just change > dev_config to config.Thanks Ryan, I tried the fix but it just gave a different symptom. (same error, different variable) So... rpm --erase xen JIC there were any ghosts around. Manually removed all traces of xen from the system. Then did a ./install.sh from the xen-3.0.2-2 directory, which had a clean "make world". The results are the same. I''ve found a more generic error about a local variable being used before assignment, but I think it''s referring to dev_config. Again, this only happens on auto-boot or domU reboot, and only when there is a "pci =" line in the domU''s definition file. Any ideas how I can help debug this? :m)> > Did you upgrade your box from xen 2.0.x to xen 3.0.2? That code path is > unlikely to be followed unless you either used an SXP configuration file > (which I didn''t think you had done because "pci = [''00:0d.0'']" wouldn''t > work in an SXP file) or your Xen 3.0.2 installation didn''t completely > overwrite all of the Xen 2.0.x files. > > Ryan > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ryan
2006-May-05 14:11 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
On Thu, 2006-05-04 at 16:04 -0700, list user wrote:> Thanks Ryan, > > I tried the fix but it just gave a different symptom. (same error, > different variable)Can you post the exact error message you''re getting?> > So... rpm --erase xen JIC there were any ghosts around. Manually > removed all traces of xen from the system. Then did a ./install.sh from > the xen-3.0.2-2 directory, which had a clean "make world". > > The results are the same. > > I''ve found a more generic error about a local variable being used before > assignment, but I think it''s referring to dev_config. > > Again, this only happens on auto-boot or domU reboot, and only when > there is a "pci =" line in the domU''s definition file. > > Any ideas how I can help debug this? >Can you post the output of /var/log/xend.log? If your file is large, please don''t attach the whole thing! :) Specifically, I''m interested in any errors in the file and the debug lines that contains the words "XendDomainInfo.create" followed by some information in lots of square brackets. Also take a look at the kernel log in dom0 (type ''dmesg'') and look for any strange errors. Is the pci device appearing correctly in your domU? Do you see any strange error messages or warnings in your domU before you try and reboot it? Ryan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
list user
2006-May-05 18:08 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
Ryan wrote:> On Thu, 2006-05-04 at 16:04 -0700, list user wrote: > >>Thanks Ryan, >> >>I tried the fix but it just gave a different symptom. (same error, >>different variable) > > > Can you post the exact error message you''re getting? > > >>So... rpm --erase xen JIC there were any ghosts around. Manually >>removed all traces of xen from the system. Then did a ./install.sh from >> the xen-3.0.2-2 directory, which had a clean "make world". >> >>The results are the same. >> >>I''ve found a more generic error about a local variable being used before >>assignment, but I think it''s referring to dev_config. >> >>Again, this only happens on auto-boot or domU reboot, and only when >>there is a "pci =" line in the domU''s definition file. >> >>Any ideas how I can help debug this? >> > > > Can you post the output of /var/log/xend.log? If your file is large, > please don''t attach the whole thing! :) Specifically, I''m interested in > any errors in the file and the debug lines that contains the words > "XendDomainInfo.create" followed by some information in lots of square > brackets. Also take a look at the kernel log in dom0 (type ''dmesg'') and > look for any strange errors.Sorry for the delay in replying. Life intervened ;) The tail-end of the xend.log is attached. I''ve included a successful shutdown (#16), successfull startup (#17), failed restart (#18).> > Is the pci device appearing correctly in your domU? Do you see any > strange error messages or warnings in your domU before you try and > reboot it?PCI device works flawlessly. It is the WAN device on the router I''m using as I send this email. Following a failed reboot there is zero info in the domU''s logs indicating that a startup had begun. Thanks for your help, Mike Wright> > Ryan > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
list user
2006-May-05 19:56 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
Ryan wrote:> On Thu, 2006-05-04 at 16:04 -0700, list user wrote: > >>Thanks Ryan, >> >>I tried the fix but it just gave a different symptom. (same error, >>different variable) > > > Can you post the exact error message you''re getting? > > >>So... rpm --erase xen JIC there were any ghosts around. Manually >>removed all traces of xen from the system. Then did a ./install.sh from >> the xen-3.0.2-2 directory, which had a clean "make world". >> >>The results are the same. >> >>I''ve found a more generic error about a local variable being used before >>assignment, but I think it''s referring to dev_config. >> >>Again, this only happens on auto-boot or domU reboot, and only when >>there is a "pci =" line in the domU''s definition file. >> >>Any ideas how I can help debug this? >> > > > Can you post the output of /var/log/xend.log? If your file is large, > please don''t attach the whole thing! :) Specifically, I''m interested in > any errors in the file and the debug lines that contains the words > "XendDomainInfo.create" followed by some information in lots of square > brackets. Also take a look at the kernel log in dom0 (type ''dmesg'') and > look for any strange errors.I''ve found an area in the log that _may_ show where the problem arises. Let me give a refresher. There are 1 pci slot: 00:0d.0 2 vif''s on 2 bridges: LAN, DMZ 3 vbd''s: hda1, hda2, hda3 On a boot the following devices are created in this order: hda1, hda2, hda3, pci, LAN, DMZ On a reboot the following devices are created in this order: LAN, DMZ, hda1, hda2, hda3 Note that the pci device is _not_ recreated on a reboot. The following excerpt from xend.log shows the pci creation in a successful boot. This code never happens in a failed reboot. [2006-05-05 11:31:27 xend] DEBUG (pciif:129) pci: enabling ioport 0xd400/0x100 [2006-05-05 11:31:27 xend] DEBUG (pciif:142) pci: enabling iomem 0xcffffd00/0x100 pfn 0xcffff/0x1 [2006-05-05 11:31:27 xend] DEBUG (pciif:142) pci: enabling iomem 0xcffc0000/0x20000 pfn 0xcffc0/0x20 [2006-05-05 11:31:27 xend] DEBUG (pciif:153) pci: enabling irq 5 [2006-05-05 11:31:27 xend] DEBUG (DevController:103) DevController: writing {''state'': ''1'', ''backend-id'': ''0'', ''backend'': ''/local/domain/0/backend/pci/3/0''} to /local/domain/3/device/pci/0. [2006-05-05 11:31:27 xend] DEBUG (DevController:105) DevController: writing {''domain'': ''vm1'', ''frontend'': ''/local/domain/3/device/pci/0'', ''frontend-id'': ''3'', ''dev-0'': ''0000:00:0d.00'', ''state'': ''1'', ''num_devs'': ''1''} to /local/domain/0/backend/pci/3/0. Will keep digging....> > Is the pci device appearing correctly in your domU? Do you see any > strange error messages or warnings in your domU before you try and > reboot it? > > Ryan > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ryan
2006-May-09 13:14 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
On Fri, 2006-05-05 at 11:08 -0700, list user wrote:> Sorry for the delay in replying. Life intervened ;) > > The tail-end of the xend.log is attached. I''ve included a successful > shutdown (#16), successfull startup (#17), failed restart (#18). > > > > [2006-05-04 18:39:49 xend.XendDomainInfo] DEBUG (XendDomainInfo:284) parseConfig: config is [''vm'', [''name'', ''vm1''], [''memory'', 64], [''vcpus'', 1], [''image'', [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.16-xen''], [''ramdisk'', ''/boot/initrd-2.6.16-xen.img''], [''root'', ''/dev/hda1 ro''], [''args'', ''netloop.nloopbacks=0 4'']]], [''device'', [''vbd'', [''uname'', ''phy:vg0/vm1''], [''dev'', ''hda1''], [''mode'', ''w'']]], [''device'', [''vbd'', [''uname'', ''phy:vg0/usr''], [''dev'', ''hda2''], [''mode'', ''r'']]], [''device'', [''vbd'', [''uname'', ''phy:vg0/sw1''], [''dev'', ''hda3''], [''mode'', ''w'']]], [''device'', [''pci'', [''dev'', [''domain'', ''0x0''], [''bus'', ''0x00''], [''slot'', ''0x0d''], [''func'', ''0x0'']]]], [''device'', [''vif'', [''bridge'', ''LAN''], [''mac'', ''00:16:3e:11:11:01'']]], [''device'', [''vif'', [''bridge'', ''DMZ''], [''mac'', ''00:16:3e:22:22:01'']]]] > [2006-05-04 18:39:49 xend.XendDomainInfo] DEBUG (XendDomainInfo:380) parseConfig: result is {''ssidref'': None, ''uuid'': None, ''on_crash'': None, ''on_reboot'': None, ''image'': [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.16-xen''], [''ramdisk'', ''/boot/initrd-2.6.16-xen.img''], [''root'', ''/dev/hda1 ro''], [''args'', ''netloop.nloopbacks=0 4'']], ''on_poweroff'': None, ''cpus'': None, ''name'': ''vm1'', ''backend'': [], ''vcpus'': 1, ''cpu_weight'': None, ''vcpu_avail'': None, ''memory'': 64, ''device'': [(''vbd'', [''vbd'', [''uname'', ''phy:vg0/vm1''], [''dev'', ''hda1''], [''mode'', ''w'']]), (''vbd'', [''vbd'', [''uname'', ''phy:vg0/usr''], [''dev'', ''hda2''], [''mode'', ''r'']]), (''vbd'', [''vbd'', [''uname'', ''phy:vg0/sw1''], [''dev'', ''hda3''], [''mode'', ''w'']]), (''pci'', [''pci'', [''dev'', [''domain'', ''0x0''], [''bus'', ''0x00''], [''slot'', ''0x0d''], [''func'', ''0x0'']]]), (''vif'', [''vif'', [''bridge'', ''LAN''], [''mac'', ''00:16:3e:11:11:01'']]), (''vif'', [''vif'', [''bridge'', ''DMZ''], [''mac'', ''00:16:3e:22:22:01'']])], ''bootloader'': None, ''cpu'': None, ''maxmem'': None}<snip>> [2006-05-05 09:23:55 xend.XendDomainInfo] DEBUG (XendDomainInfo:178) XendDomainInfo.create([''domain'', [''domid'', 17], [''uuid'', ''18a8461c-3a63-6155-797a-b66ba7e271e7''], [''ssidref'', 0], [''vcpus'', 1], [''vcpu_avail'', 1], [''cpu_weight'', 1.0], [''memory'', 64], [''maxmem'', 64], [''name'', ''vm1''], [''on_poweroff'', ''destroy''], [''on_reboot'', ''restart''], [''on_crash'', ''restart''], [''image'', [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.16-xen''], [''ramdisk'', ''/boot/initrd-2.6.16-xen.img''], [''root'', ''/dev/hda1 ro''], [''args'', ''netloop.nloopbacks=0 4'']]], [''device'', [''vif'', [''backend'', 0], [''script'', ''my-vif-bridge''], [''bridge'', ''LAN''], [''mac'', ''00:16:3e:11:11:01'']]], [''device'', [''vif'', [''backend'', 0], [''script'', ''my-vif-bridge''], [''bridge'', ''DMZ''], [''mac'', ''00:16:3e:22:22:01'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda1''], [''uname'', ''phy:vg0/vm1''], [''mode'', ''w'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda2''], [''uname'', ''phy:vg0/usr''], [''mode'', ''r'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda3''], [''uname'', ''phy:vg0/sw1''], [''mode'', ''w'']]], [''device'', [''pci'', [''backend'', 0]]], [''state'', ''---s--''], [''shutdown_reason'', ''reboot''], [''cpu_time'', 360.46612260400002], [''online_vcpus'', 1], [''up_time'', ''53045.8447151''], [''start_time'', ''1146793189.71''], [''store_mfn'', 57181], [''console_mfn'', 57180]]) > [2006-05-05 09:23:55 xend.XendDomainInfo] DEBUG (XendDomainInfo:284) parseConfig: config is [''domain'', [''domid'', 17], [''uuid'', ''18a8461c-3a63-6155-797a-b66ba7e271e7''], [''ssidref'', 0], [''vcpus'', 1], [''vcpu_avail'', 1], [''cpu_weight'', 1.0], [''memory'', 64], [''maxmem'', 64], [''name'', ''vm1''], [''on_poweroff'', ''destroy''], [''on_reboot'', ''restart''], [''on_crash'', ''restart''], [''image'', [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.16-xen''], [''ramdisk'', ''/boot/initrd-2.6.16-xen.img''], [''root'', ''/dev/hda1 ro''], [''args'', ''netloop.nloopbacks=0 4'']]], [''device'', [''vif'', [''backend'', 0], [''script'', ''my-vif-bridge''], [''bridge'', ''LAN''], [''mac'', ''00:16:3e:11:11:01'']]], [''device'', [''vif'', [''backend'', 0], [''script'', ''my-vif-bridge''], [''bridge'', ''DMZ''], [''mac'', ''00:16:3e:22:22:01'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda1''], [''uname'', ''phy:vg0/vm1''], [''mode'', ''w'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda2''], [''uname'', ''phy:vg0/usr''], [''mode'', ''r'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda3''], [''uname'', ''phy:vg0/sw1''], [''mode'', ''w'']]], [''device'', [''pci'', [''backend'', 0]]], [''state'', ''---s--''], [''shutdown_reason'', ''reboot''], [''cpu_time'', 360.46612260400002], [''online_vcpus'', 1], [''up_time'', ''53045.8447151''], [''start_time'', ''1146793189.71''], [''store_mfn'', 57181], [''console_mfn'', 57180]] > [2006-05-05 09:23:55 xend.XendDomainInfo] DEBUG (XendDomainInfo:380) parseConfig: result is {''ssidref'': 0, ''uuid'': ''18a8461c-3a63-6155-797a-b66ba7e271e7'', ''on_crash'': ''restart'', ''on_reboot'': ''restart'', ''image'': [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.16-xen''], [''ramdisk'', ''/boot/initrd-2.6.16-xen.img''], [''root'', ''/dev/hda1 ro''], [''args'', ''netloop.nloopbacks=0 4'']], ''on_poweroff'': ''destroy'', ''cpus'': None, ''name'': ''vm1'', ''backend'': [], ''vcpus'': 1, ''cpu_weight'': 1.0, ''vcpu_avail'': 1, ''memory'': 64, ''device'': [(''vif'', [''vif'', [''backend'', 0], [''script'', ''my-vif-bridge''], [''bridge'', ''LAN''], [''mac'', ''00:16:3e:11:11:01'']]), (''vif'', [''vif'', [''backend'', 0], [''script'', ''my-vif-bridge''], [''bridge'', ''DMZ''], [''mac'', ''00:16:3e:22:22:01'']]), (''vbd'', [''vbd'', [''backend'', 0], [''dev'', ''hda1''], [''uname'', ''phy:vg0/vm1''], [''mode'', ''w'']]), (''vbd'', [''vbd'', [''backend'', 0], [''dev'', ''hda2''], [''uname'', ''phy:vg0/usr''], [''mode'', ''r'']]), (''vbd'', [''vbd'', [''backend'', 0], [''dev'', ''hda3''], [''uname'', ''phy:vg0/sw1''], [''mode'', ''w'']]), (''pci'', [''pci'', [''backend'', 0]])], ''bootloader'': None, ''cpu'': None, ''maxmem'': 64}I see the problem here. When you create domain 17, the pci config passed to xend is correct: [''device'', [''pci'', [''dev'', [''domain'', ''0x0''], [''bus'', ''0x00''], [''slot'', ''0x0d''], [''func'', ''0x0'']]]] but when it reboots to create 18, the pci config is not passed in correctly: [''device'', [''pci'', [''backend'', 0]]] Apparently there''s a function missing (DevController::configuration) in tools/python/xen/xend/server/pciif.py that rebuilds the configuration for situations like reboot. If time allows, I''ll add the function and submit it, but if you or someone else needs it now, it should be pretty trivial to write. Ryan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ryan
2006-May-09 13:57 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
On Tue, 2006-05-09 at 09:14 -0400, Ryan wrote:> > Apparently there''s a function missing (DevController::configuration) in > tools/python/xen/xend/server/pciif.py that rebuilds the configuration > for situations like reboot. If time allows, I''ll add the function and > submit it, but if you or someone else needs it now, it should be pretty > trivial to write. > > RyanMike, I was able to reproduce your problem on my box. The attached patch should fix the problem (at least it does for me). Can you apply it to your copy of Xen, reinstall, reboot Xen, and try restarting your domU? I''ll submit it to xen-unstable as soon as I can confirm that this fixes your issue. Ryan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
list user
2006-May-09 16:49 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
Ryan wrote:> On Tue, 2006-05-09 at 09:14 -0400, Ryan wrote: > >>Apparently there''s a function missing (DevController::configuration) in >>tools/python/xen/xend/server/pciif.py that rebuilds the configuration >>for situations like reboot. If time allows, I''ll add the function and >>submit it, but if you or someone else needs it now, it should be pretty >>trivial to write. >> >>Ryan > > > Mike, > > I was able to reproduce your problem on my box. The attached patch > should fix the problem (at least it does for me). > > Can you apply it to your copy of Xen, reinstall, reboot Xen, and try > restarting your domU?Thanks Ryan, I applied the patch and restarted xend. We''re definitely much closer. The domain creation still bombed but for other reasons. The value of [''func'',''0x1''] is being erroneously reported as [''func'',''0x0''], which explains the following error: "Failed to open & read /sys/bus/pci/devices/0000:00:0f.0/resource: No such file or directory". Here''s a snippet from xend.log from "reason=reboot" through "create". [2006-05-09 09:05:37 xend.XendDomainInfo] INFO (XendDomainInfo:836) Domain has shutdown: name=vm2 id=7 reason=reboot. [2006-05-09 09:05:37 xend.XendDomainInfo] DEBUG (XendDomainInfo:1335) XendDomainInfo.destroyDomain(7) [2006-05-09 09:05:37 xend.XendDomainInfo] DEBUG (XendDomainInfo:178) XendDomainInfo.create([''domain'', [''domid'', 7], [''uuid'', ''5b2ac02f-11f4-9e15-0846-d119b768340f''], [''ssidref'', 0], [''vcpus'', 1], [''vcpu_avail'', 1], [''cpu_weight'', 1.0], [''memory'', 64], [''maxmem'', 64], [''name'', ''vm2''], [''on_poweroff'', ''destroy''], [''on_reboot'', ''restart''], [''on_crash'', ''restart''], [''image'', [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.16-xen''], [''ramdisk'', ''/boot/initrd-2.6.16-xen.img''], [''root'', ''/dev/hda1 ro''], [''args'', ''netloop.nloopbacks=0 4'']]], [''device'', [''vif'', [''backend'', 0], [''script'', ''my-vif-bridge''], [''bridge'', ''DMZ''], [''mac'', ''00:16:3e:22:22:02'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda1''], [''uname'', ''phy:vg0/vm2''], [''mode'', ''w'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda2''], [''uname'', ''phy:vg0/usr''], [''mode'', ''r'']]], [''device'', [''vbd'', [''backend'', 0], [''dev'', ''hda3''], [''uname'', ''phy:vg0/sw2''], [''mode'', ''w'']]], [''device'', [''pci'', [''backend'', 0], [''dev'', [''domain'', ''0x0000''], [''bus'', ''0x00''], [''slot'', ''0x0f''], [''func'', ''0x0'']]]], [''state'', ''---s--''], [''shutdown_reason'', ''reboot''], [''cpu_time'', 31.049057046000001], [''online_vcpus'', 1], [''up_time'', ''95.3671748638''], [''start_time'', ''1147190641.98''], [''store_mfn'', 39253], [''console_mfn'', 39252]]) As you can see, near the end above, func is misreporting its value. Your help is really appreciated.> > I''ll submit it to xen-unstable as soon as I can confirm that this fixes > your issue. > > Ryan > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ryan
2006-May-09 18:09 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option
On Tue, 2006-05-09 at 09:49 -0700, list user wrote:> Thanks Ryan, > > I applied the patch and restarted xend. > > We''re definitely much closer. The domain creation still bombed but for > other reasons. The value of [''func'',''0x1''] is being erroneously > reported as [''func'',''0x0''], which explains the following error: > > "Failed to open & read /sys/bus/pci/devices/0000:00:0f.0/resource: No > such file or directory".I''m glad that you caught that problem. I made a mistake in my regular expression. Try the attached patch instead and let me know how it works. Ryan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
list user
2006-May-09 19:12 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option : FIXED
Ryan wrote:> On Tue, 2006-05-09 at 09:49 -0700, list user wrote: > >>Thanks Ryan, >> >>I applied the patch and restarted xend. >> >>We''re definitely much closer. The domain creation still bombed but for >>other reasons. The value of [''func'',''0x1''] is being erroneously >>reported as [''func'',''0x0''], which explains the following error: >> >> "Failed to open & read /sys/bus/pci/devices/0000:00:0f.0/resource: No >>such file or directory". > > > I''m glad that you caught that problem. I made a mistake in my regular > expression. Try the attached patch instead and let me know how it works. >Congratulations Ryan! Great job. Good news is I''ve successfully rebooted two different domains, each with an exported pci device. Bad news is xendomains fails to autostart the domains. Good news is the same regular expression error exists in python/xen/xm/create.py in preprocess_pci on line #657. Bad news is xendomains still fails. I''ll post what I find under a new thread. Thanks again, :m)> Ryan > > > ------------------------------------------------------------------------ > > diff -r 63a86863aa3f tools/python/xen/xend/server/pciif.py > --- a/tools/python/xen/xend/server/pciif.py Tue May 9 12:39:16 2006 > +++ b/tools/python/xen/xend/server/pciif.py Tue May 9 13:58:01 2006 > @@ -31,6 +31,7 @@ > > from xen.util.pci import PciDevice > import resource > +import re > > xc = xen.lowlevel.xc.xc() > > @@ -106,6 +107,30 @@ > > return (0, back, {}) > > + def configuration(self, devid): > + """@see DevController.configuration""" > + > + result = DevController.configuration(self, devid) > + > + (num_devs) = self.readBackend(devid, ''num_devs'') > + > + for i in range(int(num_devs)): > + (dev_config) = self.readBackend(devid, ''dev-%d''%(i)) > + > + pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \ > + r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \ > + r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \ > + r"(?P<func>[0-9a-fA-F]{1,2})", dev_config) > + if pci_match!=None: > + pci_dev_info = pci_match.groupdict(''0'') > + result.append( [''dev'', \ > + [''domain'', ''0x''+pci_dev_info[''domain'']], \ > + [''bus'', ''0x''+pci_dev_info[''bus'']], \ > + [''slot'', ''0x''+pci_dev_info[''slot'']], \ > + [''func'', ''0x''+pci_dev_info[''func'']]]) > + > + return result > + > def setupDevice(self, domain, bus, slot, func): > """ Attach I/O resources for device to frontend domain > """ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ryan
2006-May-09 20:04 UTC
Re: [Xen-users] BUG? domU reboot fails when using "pci =" option : FIXED
On Tue, 2006-05-09 at 12:12 -0700, list user wrote:> > Congratulations Ryan! Great job. >Good, it works! Glad I could help.> Good news is I''ve successfully rebooted two different domains, each with > an exported pci device. > > Bad news is xendomains fails to autostart the domains. > > Good news is the same regular expression error exists in > python/xen/xm/create.py in preprocess_pci on line #657.That one''s not an error. For some reason (it''s funny when you can''t even remember why you wrote your own code the way you did), I made the function take up two hex digits in XenStore. Traditionally, the function is only a single hex digit. While the change to create.py''s regular expression wouldn''t hurt anyone, it''s probably better to make people use the traditional PCI format.> > Bad news is xendomains still fails. >Good luck! :) Ryan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users