All of lore.kernel.org
 help / color / mirror / Atom feed
* VMX device models not getting created anymore?
@ 2005-06-10 21:22 Arun Sharma
  0 siblings, 0 replies; 17+ messages in thread
From: Arun Sharma @ 2005-06-10 21:22 UTC (permalink / raw)
  To: xen-devel


This changeset:

http://xen.bkbits.net:8080/xeno-unstable.bk/cset@42a47555156iGoOjUyZtvbuMFZHXkg

seems to have removed the call to creating device models.

@@ -773,43 +680,6 @@
                  ctrl.initController(reboot=True)
          else:
              self.create_configured_devices()
-        if self.is_vmx:
-            self.create_vmx_model()

I didn't see equivalent code getting added anywhere else.

	-Arun

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: VMX device models not getting created anymore?
@ 2005-06-10 21:48 Ian Pratt
  2005-06-15 14:30 ` Mike Wray
  0 siblings, 1 reply; 17+ messages in thread
From: Ian Pratt @ 2005-06-10 21:48 UTC (permalink / raw)
  To: Arun Sharma, xen-devel

 > http://xen.bkbits.net:8080/xeno-unstable.bk/cset@42a47555156iG
> oOjUyZtvbuMFZHXkg
> 
> seems to have removed the call to creating device models.
> 
> @@ -773,43 +680,6 @@
>                   ctrl.initController(reboot=True)
>           else:
>               self.create_configured_devices()
> -        if self.is_vmx:
> -            self.create_vmx_model()
> 
> I didn't see equivalent code getting added anywhere else.

Yep, I just sync'ed my VT tree up to the head to get a couple of your
fixes, and inherited this breakage as well. There's been loads of
changes to xend to move its database over to xenstore, but I don't think
its going to be hard to fix up. 

I'm not going to get a chance to look at it before Monday evening
though.

Best,
Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-10 21:48 VMX device models not getting created anymore? Ian Pratt
@ 2005-06-15 14:30 ` Mike Wray
  2005-06-15 17:09   ` Arun Sharma
  0 siblings, 1 reply; 17+ messages in thread
From: Mike Wray @ 2005-06-15 14:30 UTC (permalink / raw)
  To: Ian Pratt; +Cc: Arun Sharma, xen-devel

Ian Pratt wrote:
>  > http://xen.bkbits.net:8080/xeno-unstable.bk/cset@42a47555156iG
> 
>>oOjUyZtvbuMFZHXkg
>>
>>seems to have removed the call to creating device models.
>>
>>@@ -773,43 +680,6 @@
>>                  ctrl.initController(reboot=True)
>>          else:
>>              self.create_configured_devices()
>>-        if self.is_vmx:
>>-            self.create_vmx_model()
>>
>>I didn't see equivalent code getting added anywhere else.

The code got moved into createDeviceModel in VmxImageHandler
in image.py, but it looks like the call to createDeviceModel got
lost. It should go at the end of create_devices in XendDomainInfo:

     def create_devices(self):
         """Create the devices for a vm.

         @raise: VmError for invalid devices
         """
         if self.rebooting():
             for ctrl in self.getDeviceControllers():
                 ctrl.initController(reboot=True)
         else:
             self.create_configured_devices()
         self.image.createDeviceModel()
> 
> 
> Yep, I just sync'ed my VT tree up to the head to get a couple of your
> fixes, and inherited this breakage as well. There's been loads of
> changes to xend to move its database over to xenstore, but I don't think
> its going to be hard to fix up. 
> 
> I'm not going to get a chance to look at it before Monday evening
> though.
> 
> Best,
> Ian
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-15 14:30 ` Mike Wray
@ 2005-06-15 17:09   ` Arun Sharma
  2005-06-16  8:56     ` Mike Wray
  0 siblings, 1 reply; 17+ messages in thread
From: Arun Sharma @ 2005-06-15 17:09 UTC (permalink / raw)
  To: Mike Wray; +Cc: Ian Pratt, xen-devel

Mike Wray wrote:
>     def create_devices(self):
>         """Create the devices for a vm.
> 
>         @raise: VmError for invalid devices
>         """
>         if self.rebooting():
>             for ctrl in self.getDeviceControllers():
>                 ctrl.initController(reboot=True)
>         else:
>             self.create_configured_devices()
>         self.image.createDeviceModel()

I sent a patch: vmx-device-models-py.patch to the list to do just this, 
but the event channel numbers seem to be off by one for some reason 
(please see comments inside the patch).

	-Arun

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: VMX device models not getting created anymore?
@ 2005-06-15 17:12 Ian Pratt
  2005-06-15 18:02 ` Arun Sharma
  0 siblings, 1 reply; 17+ messages in thread
From: Ian Pratt @ 2005-06-15 17:12 UTC (permalink / raw)
  To: Arun Sharma, Mike Wray; +Cc: xen-devel

> Mike Wray wrote:
> >     def create_devices(self):
> >         """Create the devices for a vm.
> > 
> >         @raise: VmError for invalid devices
> >         """
> >         if self.rebooting():
> >             for ctrl in self.getDeviceControllers():
> >                 ctrl.initController(reboot=True)
> >         else:
> >             self.create_configured_devices()
> >         self.image.createDeviceModel()
> 
> I sent a patch: vmx-device-models-py.patch to the list to do 
> just this, but the event channel numbers seem to be off by 
> one for some reason (please see comments inside the patch).

Yep, I think its even checked in, but the out by one needs to be tracked
down urgently. I couldn't spot anything obvious.

Ian

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-15 17:12 Ian Pratt
@ 2005-06-15 18:02 ` Arun Sharma
  0 siblings, 0 replies; 17+ messages in thread
From: Arun Sharma @ 2005-06-15 18:02 UTC (permalink / raw)
  To: Ian Pratt; +Cc: Mike Wray, xen-devel

Ian Pratt wrote:
>>I sent a patch: vmx-device-models-py.patch to the list to do 
>>just this, but the event channel numbers seem to be off by 
>>one for some reason (please see comments inside the patch).
> 
> 
> Yep, I think its even checked in, but the out by one needs to be tracked
> down urgently. I couldn't spot anything obvious.
> 

I didn't find the patch in yesterday's nightly snapshot.

	-Arun

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-15 17:09   ` Arun Sharma
@ 2005-06-16  8:56     ` Mike Wray
  2005-06-16 17:35       ` Arun Sharma
  0 siblings, 1 reply; 17+ messages in thread
From: Mike Wray @ 2005-06-16  8:56 UTC (permalink / raw)
  To: Arun Sharma; +Cc: Ian Pratt, xen-devel

Arun Sharma wrote:
> Mike Wray wrote:
> 
>>     def create_devices(self):
>>         """Create the devices for a vm.
>>
>>         @raise: VmError for invalid devices
>>         """
>>         if self.rebooting():
>>             for ctrl in self.getDeviceControllers():
>>                 ctrl.initController(reboot=True)
>>         else:
>>             self.create_configured_devices()
>>         self.image.createDeviceModel()
> 
> 
> I sent a patch: vmx-device-models-py.patch to the list to do just this, 
> but the event channel numbers seem to be off by one for some reason 
> (please see comments inside the patch).

OK, I see the patch. What makes you think the event channel port
numbers are off? Is it possible that it should be using port2 instead
of port1?

Mike

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-16  8:56     ` Mike Wray
@ 2005-06-16 17:35       ` Arun Sharma
  2005-06-17 13:07         ` Mike Wray
  0 siblings, 1 reply; 17+ messages in thread
From: Arun Sharma @ 2005-06-16 17:35 UTC (permalink / raw)
  To: Mike Wray; +Cc: Ian Pratt, xen-devel

Mike Wray wrote:

>> I sent a patch: vmx-device-models-py.patch to the list to do just 
>> this, but the event channel numbers seem to be off by one for some 
>> reason (please see comments inside the patch).
> 
> 
> OK, I see the patch. What makes you think the event channel port
> numbers are off? Is it possible that it should be using port2 instead
> of port1?

If I print self.device_channel.port1 and compare it to the output of

# xm list --long

It's off by one and device models don't get any events from the VMX domain.

When I add the -1, things work ok i.e. device models do receive events 
from the VMX domain.

port1 = dom0 end of the event channel. That's what the device models 
listen to. port2 = hypervisor/vmx domain end of the event channel.

	-Arun

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-16 17:35       ` Arun Sharma
@ 2005-06-17 13:07         ` Mike Wray
  2005-06-17 19:28           ` Arun Sharma
  0 siblings, 1 reply; 17+ messages in thread
From: Mike Wray @ 2005-06-17 13:07 UTC (permalink / raw)
  To: Arun Sharma; +Cc: Ian Pratt, xen-devel

Arun Sharma wrote:
> Mike Wray wrote:
> 
>>> I sent a patch: vmx-device-models-py.patch to the list to do just 
>>> this, but the event channel numbers seem to be off by one for some 
>>> reason (please see comments inside the patch).
>>
>>
>>
>> OK, I see the patch. What makes you think the event channel port
>> numbers are off? Is it possible that it should be using port2 instead
>> of port1?
> 
> 
> If I print self.device_channel.port1 and compare it to the output of
> 
> # xm list --long
> 
> It's off by one and device models don't get any events from the VMX domain.

Compared to which field is it off by 1?
The VMX code creates its own event channel using  channel.eventChannel(), which will
allocate new ports. Possibly it should be reusing the existing control channel port
instead? This might account for the off-by-one as ports are allocated sequentially.

> 
> When I add the -1, things work ok i.e. device models do receive events 
> from the VMX domain.
> 
> port1 = dom0 end of the event channel. That's what the device models 
> listen to. port2 = hypervisor/vmx domain end of the event channel.

Hope this helps,

Mike

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-17 13:07         ` Mike Wray
@ 2005-06-17 19:28           ` Arun Sharma
  2005-06-17 20:17             ` Arun Sharma
  2005-06-20 10:52             ` Mike Wray
  0 siblings, 2 replies; 17+ messages in thread
From: Arun Sharma @ 2005-06-17 19:28 UTC (permalink / raw)
  To: Mike Wray; +Cc: Ian Pratt, xen-devel

Mike Wray wrote:
> Compared to which field is it off by 1?
> The VMX code creates its own event channel using  
> channel.eventChannel(), which will
> allocate new ports. Possibly it should be reusing the existing control 
> channel port
> instead? This might account for the off-by-one as ports are allocated 
> sequentially.

That seems to be the problem. If I add some logging, I see:

[2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
<EventChannel dom1:0:19 dom2:5:2>
[2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
<EventChannel dom1:0:20 dom2:5:3>

The first one is created here:

File "/usr/lib/python/xen/xend/XendDomain.py", line 276, in domain_create
     dominfo = XendDomainInfo.create(self.dbmap, config)
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 159, in create
     vm.construct(config)
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 501, in construct
     self.construct_image()
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 547, in 
construct_image
     self.create_channel()
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 680, in 
create_channel
     self.store_channel = self.eventChannel("store_channel")
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 674, in 
eventChannel
     return EventChannel.restoreFromDB(db, 0, self.id)
   File "/usr/lib/python/xen/xend/server/channel.py", line 59, in 
restoreFromDB
     evtchn = cls.interdomain(dom1, dom2, port1=port1, port2=port2)

The second is created here:

File "/usr/lib/python/xen/xend/XendDomain.py", line 276, in domain_create
     dominfo = XendDomainInfo.create(self.dbmap, config)
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 159, in create
     vm.construct(config)
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 502, in construct
     self.configure()
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 884, in configure
     self.create_devices()
   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 704, in 
create_devices
     self.image.createDeviceModel()
   File "/usr/lib/python/xen/xend/image.py", line 300, in createDeviceModel
     self.device_channel = channel.eventChannel(0, self.vm.getDomain())
   File "/usr/lib/python/xen/xend/server/channel.py", line 116, in 
eventChannel
     return EventChannel.interdomain(dom1, dom2, port1=port1, port2=port2)

Things get more interesting, because self.device_channel['port1'] for 
the second channel returns 19 instead of 20.

Are there assumptions in the code that there must be only one 
interdomain event channel between two domains?

	-Arun

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-17 19:28           ` Arun Sharma
@ 2005-06-17 20:17             ` Arun Sharma
  2005-06-17 21:54               ` cannot concatenate 'str' and 'Nonetype' object with creating domain Jurgen Stroo
  2005-06-20 11:13               ` VMX device models not getting created anymore? Mike Wray
  2005-06-20 10:52             ` Mike Wray
  1 sibling, 2 replies; 17+ messages in thread
From: Arun Sharma @ 2005-06-17 20:17 UTC (permalink / raw)
  To: Mike Wray; +Cc: Ian Pratt, xen-devel

Arun Sharma wrote:

> That seems to be the problem. If I add some logging, I see:
> 
> [2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
> <EventChannel dom1:0:19 dom2:5:2>
> [2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
> <EventChannel dom1:0:20 dom2:5:3>
[..]
> 
> Things get more interesting, because self.device_channel['port1'] for 
> the second channel returns 19 instead of 20.
> 

This statement is not true. I got confused because the only the first 
event channel shows up in xm list --long.

The real issue is the hard coding in:

xen/include/public/io/ioreq.h:

#define IOPACKET_PORT   2

This was true before your changes went in. After your changes, xen 
started sending IOPACKET events on:

<EventChannel dom1:0:19 dom2:5:2>

but the user space device models were listening on:

<EventChannel dom1:0:20 dom2:5:3>

However, if I subtract -1, everything magically works :)

I think the quick fix is to redefine IOPACKET_PORT to be 3. Will send a 
patch to remove the hard coding ASAP.

	-Arun

^ permalink raw reply	[flat|nested] 17+ messages in thread

* cannot concatenate 'str' and 'Nonetype' object with creating domain
  2005-06-17 20:17             ` Arun Sharma
@ 2005-06-17 21:54               ` Jurgen Stroo
  2005-06-17 22:16                 ` Jurgen Stroo
  2005-06-20 11:13               ` VMX device models not getting created anymore? Mike Wray
  1 sibling, 1 reply; 17+ messages in thread
From: Jurgen Stroo @ 2005-06-17 21:54 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-users

Hi, I get this strange error about string and nonetype concatenating, but
I think I am not sure why it is complaining at having a Nonetype
somewhere, as if I did not define some configuration option? I use the
following command (below that, there is a dry-run
result):

FYI: I removed the loopback.o from the drivers/xen/netback/Makefile and
recompiled the whole thing. This was because Xen unstable did not work,
some strange behaviour with arp. Now it does work, the veth0 interface and
the network.

megalosaurus:/etc/xen# xm create -c xm-machine01 vmid=1
Using config file "xm-machine01".
VIRTUAL MEMORY ARRANGEMENT:
 Loaded kernel: 0xc0100000->0xc0353f04
 Init. ramdisk: 0xc0354000->0xc0354000
 Phys-Mach map: 0xc0354000->0xc0374000
 Page tables:   0xc0374000->0xc0376000
 Start info:    0xc0376000->0xc0377000
 Boot stack:    0xc0377000->0xc0378000
 TOTAL:         0xc0000000->0xc0400000
 ENTRY ADDRESS: 0xc0100000
 VCPUS:         4
Domain construction error: cannot concatenate 'str' and 'NoneType' objects
Traceback (most recent call last):
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 483, in
construct
    self.configure()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 992, in
configure
    self.create_devices()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 768, in
create_devices
    self.create_configured_devices()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 757, in
create_configured_devices
    self.createDevice(ctrl_type, dev_config, recreate=recreate)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 332, in
createDevice
    return ctrl.createDevice(devconfig, recreate=self.recreate)
  File "/usr/lib/python/xen/xend/server/controller.py", line 236, in
createDevice
    dev.attach(recreate=recreate, change=change)
  File "/usr/lib/python/xen/xend/server/blkif.py", line 221, in attach
    self.setNode(node)
  File "/usr/lib/python/xen/xend/server/blkif.py", line 247, in setNode
    mounted_mode = self.check_mounted(node)
  File "/usr/lib/python/xen/xend/server/blkif.py", line 265, in
check_mounted
    mode = blkif.mount_mode(name)
  File "/usr/lib/python/xen/util/blkif.py", line 73, in mount_mode
    exp = re.compile('^' + name + ' .*[\(,]r(?P<mode>[ow])[,\)]')
TypeError: cannot concatenate 'str' and 'NoneType' objects
op_create> Exception creating domain:
Traceback (most recent call last):
  File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 63, in
op_create
    dominfo = self.xd.domain_create(config)
  File "/usr/lib/python/xen/xend/XendDomain.py", line 282, in
domain_create
    dominfo = XendDomainInfo.vm_create(config)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 153, in
vm_create
    vm.construct(config)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 483, in
construct
    self.configure()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 992, in
configure
    self.create_devices()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 768, in
create_devices
    self.create_configured_devices()
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 757, in
create_configured_devices
    self.createDevice(ctrl_type, dev_config, recreate=recreate)
  File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 332, in
createDevice
    return ctrl.createDevice(devconfig, recreate=self.recreate)
  File "/usr/lib/python/xen/xend/server/controller.py", line 236, in
createDevice
    dev.attach(recreate=recreate, change=change)
  File "/usr/lib/python/xen/xend/server/blkif.py", line 221, in attach
    self.setNode(node)
  File "/usr/lib/python/xen/xend/server/blkif.py", line 247, in setNode
    mounted_mode = self.check_mounted(node)
  File "/usr/lib/python/xen/xend/server/blkif.py", line 265, in
check_mounted
    mode = blkif.mount_mode(name)
  File "/usr/lib/python/xen/util/blkif.py", line 73, in mount_mode
    exp = re.compile('^' + name + ' .*[\(,]r(?P<mode>[ow])[,\)]')
TypeError: cannot concatenate 'str' and 'NoneType' objects
Error: Error creating domain: cannot concatenate 'str' and 'NoneType'
objects



megalosaurus:/etc/xen# xm create -cn xm-machine01 vmid=1
Using config file "xm-machine01".
(vm
    (name machine01)
    (memory 128)
    (cpu 1)
    (image
        (linux
            (kernel /boot/vmlinuz-2.6.11-xenU)
            (root '/dev/hda1 ro')
            (vcpus 4)
        )
    )
    (device
        (vbd
            (uname file:/mnt/xenu/machine01/root_fs_machine01)
            (dev hda1)
            (mode w)
        )
    )
    (device
        (vbd
            (uname file:/mnt/xenu/machine01/swap_fs_machine01)
            (dev hda2)
            (mode w)
        )
    )
    (device (vif (mac aa:00:00:6a:60:02)))
    (memmap )
    (device_model )
    (device_config )

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: cannot concatenate 'str' and 'Nonetype' object with creating domain
  2005-06-17 21:54               ` cannot concatenate 'str' and 'Nonetype' object with creating domain Jurgen Stroo
@ 2005-06-17 22:16                 ` Jurgen Stroo
  0 siblings, 0 replies; 17+ messages in thread
From: Jurgen Stroo @ 2005-06-17 22:16 UTC (permalink / raw)
  To: xen-devel; +Cc: xen-users

Sorry, never mind, as I found out in this
/usr/lib/python/xen/util/blkif.py file, it is about the block devices.
I checked the whole thing and it couldn't find the valid block device,
this was due to a false location in my config file, that's where the
strange complain came from, as it turned out.
Not a very friendly err message, if a valid block device can't be
located. ;-)

I can proceed again :)

Greetz Blurg

Although very unlikely, it seems Jurgen Stroo stated on Jun 17 that :

> Hi, I get this strange error about string and nonetype concatenating, but
> I think I am not sure why it is complaining at having a Nonetype
> somewhere, as if I did not define some configuration option? I use the
> following command (below that, there is a dry-run
> result):
>
> FYI: I removed the loopback.o from the drivers/xen/netback/Makefile and
> recompiled the whole thing. This was because Xen unstable did not work,
> some strange behaviour with arp. Now it does work, the veth0 interface and
> the network.
>
> megalosaurus:/etc/xen# xm create -c xm-machine01 vmid=1
> Using config file "xm-machine01".
> VIRTUAL MEMORY ARRANGEMENT:
>  Loaded kernel: 0xc0100000->0xc0353f04
>  Init. ramdisk: 0xc0354000->0xc0354000
>  Phys-Mach map: 0xc0354000->0xc0374000
>  Page tables:   0xc0374000->0xc0376000
>  Start info:    0xc0376000->0xc0377000
>  Boot stack:    0xc0377000->0xc0378000
>  TOTAL:         0xc0000000->0xc0400000
>  ENTRY ADDRESS: 0xc0100000
>  VCPUS:         4
> Domain construction error: cannot concatenate 'str' and 'NoneType' objects
> Traceback (most recent call last):
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 483, in
> construct
>     self.configure()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 992, in
> configure
>     self.create_devices()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 768, in
> create_devices
>     self.create_configured_devices()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 757, in
> create_configured_devices
>     self.createDevice(ctrl_type, dev_config, recreate=recreate)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 332, in
> createDevice
>     return ctrl.createDevice(devconfig, recreate=self.recreate)
>   File "/usr/lib/python/xen/xend/server/controller.py", line 236, in
> createDevice
>     dev.attach(recreate=recreate, change=change)
>   File "/usr/lib/python/xen/xend/server/blkif.py", line 221, in attach
>     self.setNode(node)
>   File "/usr/lib/python/xen/xend/server/blkif.py", line 247, in setNode
>     mounted_mode = self.check_mounted(node)
>   File "/usr/lib/python/xen/xend/server/blkif.py", line 265, in
> check_mounted
>     mode = blkif.mount_mode(name)
>   File "/usr/lib/python/xen/util/blkif.py", line 73, in mount_mode
>     exp = re.compile('^' + name + ' .*[\(,]r(?P<mode>[ow])[,\)]')
> TypeError: cannot concatenate 'str' and 'NoneType' objects
> op_create> Exception creating domain:
> Traceback (most recent call last):
>   File "/usr/lib/python/xen/xend/server/SrvDomainDir.py", line 63, in
> op_create
>     dominfo = self.xd.domain_create(config)
>   File "/usr/lib/python/xen/xend/XendDomain.py", line 282, in
> domain_create
>     dominfo = XendDomainInfo.vm_create(config)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 153, in
> vm_create
>     vm.construct(config)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 483, in
> construct
>     self.configure()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 992, in
> configure
>     self.create_devices()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 768, in
> create_devices
>     self.create_configured_devices()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 757, in
> create_configured_devices
>     self.createDevice(ctrl_type, dev_config, recreate=recreate)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 332, in
> createDevice
>     return ctrl.createDevice(devconfig, recreate=self.recreate)
>   File "/usr/lib/python/xen/xend/server/controller.py", line 236, in
> createDevice
>     dev.attach(recreate=recreate, change=change)
>   File "/usr/lib/python/xen/xend/server/blkif.py", line 221, in attach
>     self.setNode(node)
>   File "/usr/lib/python/xen/xend/server/blkif.py", line 247, in setNode
>     mounted_mode = self.check_mounted(node)
>   File "/usr/lib/python/xen/xend/server/blkif.py", line 265, in
> check_mounted
>     mode = blkif.mount_mode(name)
>   File "/usr/lib/python/xen/util/blkif.py", line 73, in mount_mode
>     exp = re.compile('^' + name + ' .*[\(,]r(?P<mode>[ow])[,\)]')
> TypeError: cannot concatenate 'str' and 'NoneType' objects
> Error: Error creating domain: cannot concatenate 'str' and 'NoneType'
> objects
>
>
>
> megalosaurus:/etc/xen# xm create -cn xm-machine01 vmid=1
> Using config file "xm-machine01".
> (vm
>     (name machine01)
>     (memory 128)
>     (cpu 1)
>     (image
>         (linux
>             (kernel /boot/vmlinuz-2.6.11-xenU)
>             (root '/dev/hda1 ro')
>             (vcpus 4)
>         )
>     )
>     (device
>         (vbd
>             (uname file:/mnt/xenu/machine01/root_fs_machine01)
>             (dev hda1)
>             (mode w)
>         )
>     )
>     (device
>         (vbd
>             (uname file:/mnt/xenu/machine01/swap_fs_machine01)
>             (dev hda2)
>             (mode w)
>         )
>     )
>     (device (vif (mac aa:00:00:6a:60:02)))
>     (memmap )
>     (device_model )
>     (device_config )
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-17 19:28           ` Arun Sharma
  2005-06-17 20:17             ` Arun Sharma
@ 2005-06-20 10:52             ` Mike Wray
  1 sibling, 0 replies; 17+ messages in thread
From: Mike Wray @ 2005-06-20 10:52 UTC (permalink / raw)
  To: Arun Sharma; +Cc: Ian Pratt, xen-devel

Arun Sharma wrote:
> Mike Wray wrote:
> 
>> Compared to which field is it off by 1?
>> The VMX code creates its own event channel using  
>> channel.eventChannel(), which will
>> allocate new ports. Possibly it should be reusing the existing control 
>> channel port
>> instead? This might account for the off-by-one as ports are allocated 
>> sequentially.
> 
> 
> That seems to be the problem. If I add some logging, I see:
> 
> [2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
> <EventChannel dom1:0:19 dom2:5:2>
> [2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
> <EventChannel dom1:0:20 dom2:5:3>
> 
> The first one is created here:
> 
> File "/usr/lib/python/xen/xend/XendDomain.py", line 276, in domain_create
>     dominfo = XendDomainInfo.create(self.dbmap, config)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 159, in create
>     vm.construct(config)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 501, in construct
>     self.construct_image()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 547, in 
> construct_image
>     self.create_channel()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 680, in 
> create_channel
>     self.store_channel = self.eventChannel("store_channel")
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 674, in 
> eventChannel
>     return EventChannel.restoreFromDB(db, 0, self.id)
>   File "/usr/lib/python/xen/xend/server/channel.py", line 59, in 
> restoreFromDB
>     evtchn = cls.interdomain(dom1, dom2, port1=port1, port2=port2)
> 
> The second is created here:
> 
> File "/usr/lib/python/xen/xend/XendDomain.py", line 276, in domain_create
>     dominfo = XendDomainInfo.create(self.dbmap, config)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 159, in create
>     vm.construct(config)
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 502, in construct
>     self.configure()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 884, in configure
>     self.create_devices()
>   File "/usr/lib/python/xen/xend/XendDomainInfo.py", line 704, in 
> create_devices
>     self.image.createDeviceModel()
>   File "/usr/lib/python/xen/xend/image.py", line 300, in createDeviceModel
>     self.device_channel = channel.eventChannel(0, self.vm.getDomain())
>   File "/usr/lib/python/xen/xend/server/channel.py", line 116, in 
> eventChannel
>     return EventChannel.interdomain(dom1, dom2, port1=port1, port2=port2)
> 
> Things get more interesting, because self.device_channel['port1'] for 
> the second channel returns 19 instead of 20.
> 
> Are there assumptions in the code that there must be only one 
> interdomain event channel between two domains?

It depends which code you are talking about.
The code using the domain control channel (i.e. the frontend and backend drivers)
gets upset if you don't use the first event channel on the domain.
Other code will use any interdomin channel, but you need to tell it the
port number somehow.

Mike

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-17 20:17             ` Arun Sharma
  2005-06-17 21:54               ` cannot concatenate 'str' and 'Nonetype' object with creating domain Jurgen Stroo
@ 2005-06-20 11:13               ` Mike Wray
  2005-06-21 21:01                 ` Arun Sharma
  1 sibling, 1 reply; 17+ messages in thread
From: Mike Wray @ 2005-06-20 11:13 UTC (permalink / raw)
  To: Arun Sharma; +Cc: Ian Pratt, xen-devel

Arun Sharma wrote:
> Arun Sharma wrote:
> 
>> That seems to be the problem. If I add some logging, I see:
>>
>> [2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
>> <EventChannel dom1:0:19 dom2:5:2>
>> [2005-06-17 12:06:07 xend] INFO (channel:32) created event channel: 
>> <EventChannel dom1:0:20 dom2:5:3>
> 
> [..]
> 
>>
>> Things get more interesting, because self.device_channel['port1'] for 
>> the second channel returns 19 instead of 20.
>>
> 
> This statement is not true. I got confused because the only the first 
> event channel shows up in xm list --long.
> 
> The real issue is the hard coding in:
> 
> xen/include/public/io/ioreq.h:
> 
> #define IOPACKET_PORT   2
> 
> This was true before your changes went in. After your changes, xen 
> started sending IOPACKET events on:
> 
> <EventChannel dom1:0:19 dom2:5:2>
> 
> but the user space device models were listening on:
> 
> <EventChannel dom1:0:20 dom2:5:3>
> 
> However, if I subtract -1, everything magically works :)

Having to add or subtract 1 to make something work is almost always
not the right way to fix a problem - because it dosen't address
the real issue.

> I think the quick fix is to redefine IOPACKET_PORT to be 3. Will send a 
> patch to remove the hard coding ASAP.

That's not the fix. That just replaces one hard-coded constant with another, when
it shouldn't be hard-coded at all. It's going to break again if any other interdomain
port is allocated.

The port to use should be passed to the domain as a parameter.
This is what is done with the domain controller port,
and the xenstore port.

The correct fix is to add the device model port as a parameter to
xc_vmx_build. In fact this already has control_evtchn as a parameter,
but ignores it - so you could use that. You could probably re-use
the start_info field for it too as vmx domains don't seem to be using
the control channel otherwise:

Set domain_controller_evtchn in xc_vmx_build from control_evtchn, and use
domain->start_info->domain_controller_evtchn intead of IOPACKET_PORT.

In xend the vmx code can simply pass the domain control evtchn like the
other build functions, since the existing control evtchn isn't being used.

Hope this helps,

Mike

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-20 11:13               ` VMX device models not getting created anymore? Mike Wray
@ 2005-06-21 21:01                 ` Arun Sharma
  2005-06-22  8:34                   ` Mike Wray
  0 siblings, 1 reply; 17+ messages in thread
From: Arun Sharma @ 2005-06-21 21:01 UTC (permalink / raw)
  To: Mike Wray; +Cc: Ian Pratt, xen-devel

Mike Wray wrote:

>> However, if I subtract -1, everything magically works :)
> 
> 
> Having to add or subtract 1 to make something work is almost always
> not the right way to fix a problem - because it dosen't address
> the real issue.
> 

You probably missed the smiley :)

>> I think the quick fix is to redefine IOPACKET_PORT to be 3. Will send 
>> a patch to remove the hard coding ASAP.
> 
> 
> That's not the fix. That just replaces one hard-coded constant with 
> another, when
> it shouldn't be hard-coded at all. It's going to break again if any 
> other interdomain
> port is allocated.
> 
> The port to use should be passed to the domain as a parameter.
> This is what is done with the domain controller port,
> and the xenstore port.
> 

Yes of course, I promised to send a patch as well. The quick fix was for 
those who couldn't wait.

> The correct fix is to add the device model port as a parameter to
> xc_vmx_build. In fact this already has control_evtchn as a parameter,
> but ignores it - so you could use that. You could probably re-use
> the start_info field for it too as vmx domains don't seem to be using
> the control channel otherwise:
> 

The problem is that:

self.construct_image()
	...
		xc_vmx_build()
self.configure()
	...
		self.image.createDeviceModel()

The event channel hasn't been created at the time of xc_vmx_build().

	-Arun

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: VMX device models not getting created anymore?
  2005-06-21 21:01                 ` Arun Sharma
@ 2005-06-22  8:34                   ` Mike Wray
  0 siblings, 0 replies; 17+ messages in thread
From: Mike Wray @ 2005-06-22  8:34 UTC (permalink / raw)
  To: Arun Sharma; +Cc: Ian Pratt, xen-devel

Arun Sharma wrote:
> Mike Wray wrote:
> 
>>> However, if I subtract -1, everything magically works :)
>>
>>
>>
>> Having to add or subtract 1 to make something work is almost always
>> not the right way to fix a problem - because it dosen't address
>> the real issue.
>>
> 
> You probably missed the smiley :)
> 
>>> I think the quick fix is to redefine IOPACKET_PORT to be 3. Will send 
>>> a patch to remove the hard coding ASAP.
>>
>>
>>
>> That's not the fix. That just replaces one hard-coded constant with 
>> another, when
>> it shouldn't be hard-coded at all. It's going to break again if any 
>> other interdomain
>> port is allocated.
>>
>> The port to use should be passed to the domain as a parameter.
>> This is what is done with the domain controller port,
>> and the xenstore port.
>>
> 
> Yes of course, I promised to send a patch as well. The quick fix was for 
> those who couldn't wait.
> 
>> The correct fix is to add the device model port as a parameter to
>> xc_vmx_build. In fact this already has control_evtchn as a parameter,
>> but ignores it - so you could use that. You could probably re-use
>> the start_info field for it too as vmx domains don't seem to be using
>> the control channel otherwise:
>>
> 
> The problem is that:
> 
> self.construct_image()
>     ...
>         xc_vmx_build()
> self.configure()
>     ...
>         self.image.createDeviceModel()
> 
> The event channel hasn't been created at the time of xc_vmx_build().

All the other build fns need the channel, so it is created before the domain image:

     def construct_image(self):
         """Construct the boot image for the domain.
         """
         self.create_channel()
         self.image.createImage()
         self.exportToDB()
         self.storeConnect()

 From the linux build image:

     def buildDomain(self):
         control_evtchn = self.vm.channel.getRemotePort()
	...
         d  = xc.linux_build(dom            = self.vm.getDomain(),
                             image          = self.kernel,
                             control_evtchn = control_evtchn,
                             store_evtchn   = store_evtchn,
                             cmdline        = self.cmdline,
                             ramdisk        = self.ramdisk,
                             flags          = self.flags,
                             vcpus          = self.vm.vcpus)
         ...

Mike

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2005-06-22  8:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-10 21:48 VMX device models not getting created anymore? Ian Pratt
2005-06-15 14:30 ` Mike Wray
2005-06-15 17:09   ` Arun Sharma
2005-06-16  8:56     ` Mike Wray
2005-06-16 17:35       ` Arun Sharma
2005-06-17 13:07         ` Mike Wray
2005-06-17 19:28           ` Arun Sharma
2005-06-17 20:17             ` Arun Sharma
2005-06-17 21:54               ` cannot concatenate 'str' and 'Nonetype' object with creating domain Jurgen Stroo
2005-06-17 22:16                 ` Jurgen Stroo
2005-06-20 11:13               ` VMX device models not getting created anymore? Mike Wray
2005-06-21 21:01                 ` Arun Sharma
2005-06-22  8:34                   ` Mike Wray
2005-06-20 10:52             ` Mike Wray
  -- strict thread matches above, loose matches on Subject: below --
2005-06-15 17:12 Ian Pratt
2005-06-15 18:02 ` Arun Sharma
2005-06-10 21:22 Arun Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.