Stefan Berger
2006-Sep-23 16:31 UTC
[Xen-devel] Not waiting for devices in xend when resuming a domain
Hello! I noticed that if a domain is resumed it is NOT being waited for the hotplug scripts to finish running (call to waitForDevices in xend) , like this is for example done when a domain is starting. If I put a lot of load on domain-0 by for example compiling the sources with multiple threads (make -j 16) and do a resume on a domain, this can lead to access to devices although they are not properly connected, yet. I think it''s even more critical to have immediate and guaranteed access to all devices when a domain is immediately available (resume) and if it wants to access a device instead of it the case when it might be busy spending some time booting. -- Stefan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Sep-23 16:31 UTC
Re: [Xen-devel] Not waiting for devices in xend when resuming a domain
On 23/9/06 5:31 pm, "Stefan Berger" <stefanb@us.ibm.com> wrote:> I noticed that if a domain is resumed it is NOT being waited for the hotplug > scripts to finish running (call to waitForDevices in xend) , like this is for > example done when a domain is starting. If I put a lot of load on domain-0 by > for example compiling the sources with multiple threads (make -j 16) and do a > resume on a domain, this can lead to access to devices although they are not > properly connected, yet. I think it''s even more critical to have immediate and > guaranteed access to all devices when a domain is immediately available > (resume) and if it wants to access a device instead of it the case when it > might be busy spending some time booting.They at least need to be set up enough that the restored domain can start connecting to its new backends. So the backend info directory needs to be set up by the time the domain resumes execution. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefan Berger
2006-Sep-23 20:20 UTC
Re: [Xen-devel] Not waiting for devices in xend when resuming a domain
Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote on 09/23/2006 12:31:37 PM:> > > > On 23/9/06 5:31 pm, "Stefan Berger" <stefanb@us.ibm.com> wrote:> I noticed that if a domain is resumed it is NOT being waited for the > hotplug scripts to finish running (call to waitForDevices in xend) , > like this is for example done when a domain is starting. If I put a > lot of load on domain-0 by for example compiling the sources with > multiple threads (make -j 16) and do a resume on a domain, this can > lead to access to devices although they are not properly connected, > yet. I think it''s even more critical to have immediate and > guaranteed access to all devices when a domain is immediately > available (resume) and if it wants to access a device instead of it > the case when it might be busy spending some time booting. > > They at least need to be set up enough that the restored domain can > start connecting to its new backends. So the backend info directory > needs to be set up by the time the domain resumes execution. >This one-line patch here syncs with the state of the hotplug scrtips before resuming the domain. It''s done as late as possible so in many cases no waiting for the scripts is actually necessary. diff -r c4f3f719d997 tools/python/xen/xend/XendCheckpoint.py --- a/tools/python/xen/xend/XendCheckpoint.py Sat Sep 23 13:54:58 2006 +++ b/tools/python/xen/xend/XendCheckpoint.py Sat Sep 23 15:10:17 2006 @@ -163,6 +163,7 @@ #Block until src closes connection os.read(fd, 1) + dominfo.waitForDevices() dominfo.unpause() dominfo.completeRestore(handler.store_mfn, handler.console_mfn)> -- KeirStefan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel