* [PATCH] xend: notify xenpv device model that console info is ready
@ 2010-02-23 7:03 Kouya Shimura
2010-02-23 15:02 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 3+ messages in thread
From: Kouya Shimura @ 2010-02-23 7:03 UTC (permalink / raw)
To: xen-devel; +Cc: Keir Fraser
[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 707 bytes --]
Sometimes PV domain with vfb doesn't boot up. /sbin/kudzu is stuck.
After investigation, I've found that the evtchn for console is not
bound at all.
Normal sequence of evtchn initialization in qemu-dm for xenpv is:
1) watch xenstore backpath (/local/domain/0/backend/console/<domid>/0)
2) read console info (/local/domain/<domid>/console/{type, ring-ref, port..})
3) bind the evtchn to the port.
But in some case, xend writes to the backpath before the console info
is prepared, and never write to the backpath again. So the qemu-dm fails
at 2) and never reach to 3).
When this happens, manually xenstore-write command on Domain-0
resumes the guest.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
[-- Attachment #2: notify_xenpv_ioemu.patch --]
[-- Type: text/x-patch, Size: 891 bytes --]
diff -r 4ba4323889b9 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Mon Feb 22 18:47:22 2010 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py Tue Feb 23 14:50:40 2010 +0900
@@ -1642,6 +1642,11 @@ class XendDomainInfo:
console_uuid = serial_consoles[0].get('uuid')
self.info.console_update(console_uuid, 'location',
self.console_port)
+ # Notify xenpv device model that console info is ready
+ if not self.info.is_hvm() and self.info.has_rfb():
+ console_ctrl = self.getDeviceController('console')
+ # The value is unchanged. Just for xenstore watcher
+ console_ctrl.writeBackend(0, 'uuid', console_uuid)
# Update VNC port if it exists and write to xenstore
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xend: notify xenpv device model that console info is ready
2010-02-23 7:03 [PATCH] xend: notify xenpv device model that console info is ready Kouya Shimura
@ 2010-02-23 15:02 ` Konrad Rzeszutek Wilk
2010-02-24 3:59 ` Kouya Shimura
0 siblings, 1 reply; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-02-23 15:02 UTC (permalink / raw)
To: Kouya Shimura; +Cc: xen-devel, Keir Fraser
On Tue, Feb 23, 2010 at 04:03:48PM +0900, Kouya Shimura wrote:
Content-Description: message body text
> Sometimes PV domain with vfb doesn't boot up. /sbin/kudzu is stuck.
> After investigation, I've found that the evtchn for console is not
> bound at all.
>
> Normal sequence of evtchn initialization in qemu-dm for xenpv is:
> 1) watch xenstore backpath (/local/domain/0/backend/console/<domid>/0)
> 2) read console info (/local/domain/<domid>/console/{type, ring-ref, port..})
> 3) bind the evtchn to the port.
>
> But in some case, xend writes to the backpath before the console info
Would it be better to fix the race condition?
> is prepared, and never write to the backpath again. So the qemu-dm fails
> at 2) and never reach to 3).
>
> When this happens, manually xenstore-write command on Domain-0
> resumes the guest.
>
> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
>
> diff -r 4ba4323889b9 tools/python/xen/xend/XendDomainInfo.py
> --- a/tools/python/xen/xend/XendDomainInfo.py Mon Feb 22 18:47:22 2010 +0000
> +++ b/tools/python/xen/xend/XendDomainInfo.py Tue Feb 23 14:50:40 2010 +0900
> @@ -1642,6 +1642,11 @@ class XendDomainInfo:
> console_uuid = serial_consoles[0].get('uuid')
> self.info.console_update(console_uuid, 'location',
> self.console_port)
> + # Notify xenpv device model that console info is ready
> + if not self.info.is_hvm() and self.info.has_rfb():
> + console_ctrl = self.getDeviceController('console')
> + # The value is unchanged. Just for xenstore watcher
> + console_ctrl.writeBackend(0, 'uuid', console_uuid)
>
>
> # Update VNC port if it exists and write to xenstore
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xend: notify xenpv device model that console info is ready
2010-02-23 15:02 ` Konrad Rzeszutek Wilk
@ 2010-02-24 3:59 ` Kouya Shimura
0 siblings, 0 replies; 3+ messages in thread
From: Kouya Shimura @ 2010-02-24 3:59 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk; +Cc: xen-devel, Keir Fraser
Hi,
I don't have the confidence to resolve the race condition quickly
since the xend is so complex.
Solutions come to my mind are:
1) XendDomainInfo.py: exchange the exec order of _createDevices() from _initDomain() and _storeDomDetails()
2) XendDomainInfo.py: don't spawn qemu-dm until _storeDomDetails()
But they both give much influences and there are many places to be fixed.
Another solution is to fix the qemu-dm. It might be better,
though, I think that the interface between qemu-dm and xend
shouldn't be changed.
So, I push this patch. It's simple and sure to fix the issue.
Thanks,
Kouya
Konrad Rzeszutek Wilk writes:
> On Tue, Feb 23, 2010 at 04:03:48PM +0900, Kouya Shimura wrote:
> Content-Description: message body text
> > Sometimes PV domain with vfb doesn't boot up. /sbin/kudzu is stuck.
> > After investigation, I've found that the evtchn for console is not
> > bound at all.
> >
> > Normal sequence of evtchn initialization in qemu-dm for xenpv is:
> > 1) watch xenstore backpath (/local/domain/0/backend/console/<domid>/0)
> > 2) read console info (/local/domain/<domid>/console/{type, ring-ref, port..})
> > 3) bind the evtchn to the port.
> >
> > But in some case, xend writes to the backpath before the console info
>
> Would it be better to fix the race condition?
>
> > is prepared, and never write to the backpath again. So the qemu-dm fails
> > at 2) and never reach to 3).
> >
> > When this happens, manually xenstore-write command on Domain-0
> > resumes the guest.
> >
> > Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
> >
>
> > diff -r 4ba4323889b9 tools/python/xen/xend/XendDomainInfo.py
> > --- a/tools/python/xen/xend/XendDomainInfo.py Mon Feb 22 18:47:22 2010 +0000
> > +++ b/tools/python/xen/xend/XendDomainInfo.py Tue Feb 23 14:50:40 2010 +0900
> > @@ -1642,6 +1642,11 @@ class XendDomainInfo:
> > console_uuid = serial_consoles[0].get('uuid')
> > self.info.console_update(console_uuid, 'location',
> > self.console_port)
> > + # Notify xenpv device model that console info is ready
> > + if not self.info.is_hvm() and self.info.has_rfb():
> > + console_ctrl = self.getDeviceController('console')
> > + # The value is unchanged. Just for xenstore watcher
> > + console_ctrl.writeBackend(0, 'uuid', console_uuid)
> >
> >
> > # Update VNC port if it exists and write to xenstore
>
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-24 3:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-23 7:03 [PATCH] xend: notify xenpv device model that console info is ready Kouya Shimura
2010-02-23 15:02 ` Konrad Rzeszutek Wilk
2010-02-24 3:59 ` Kouya Shimura
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).