All of lore.kernel.org
 help / color / mirror / Atom feed
* Race with hotplug vif scripts
@ 2006-12-30 18:52 Jacob Gorm Hansen
  2006-12-30 19:03 ` Keir Fraser
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jacob Gorm Hansen @ 2006-12-30 18:52 UTC (permalink / raw)
  To: xen-devel

hi,

I have a domU running a custom HTTP client. As soon as the domain is
booted and the VIF running it wants to initiate a connection. However, I
seem to be having a race where the domU starts using the VIF before it
is completely functional, probably because the hotplug script has not
completed.

Currently I just set the frontend to '4', and just wait for the backend
state to also become '4' (connected), but this does not work in all
cases. How can I synchronize with the hotplug script, and what is the
correct sequence of XenBus states?

Thanks,
Jacob

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

* Re: Race with hotplug vif scripts
  2006-12-30 18:52 Race with hotplug vif scripts Jacob Gorm Hansen
@ 2006-12-30 19:03 ` Keir Fraser
  2006-12-30 19:18 ` Jacob Gorm Hansen
  2007-01-02 14:51 ` Ewan Mellor
  2 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2006-12-30 19:03 UTC (permalink / raw)
  To: Jacob Gorm Hansen, xen-devel

On 30/12/06 18:52, "Jacob Gorm Hansen" <jacobg@diku.dk> wrote:

> Currently I just set the frontend to '4', and just wait for the backend
> state to also become '4' (connected), but this does not work in all
> cases. How can I synchronize with the hotplug script, and what is the
> correct sequence of XenBus states?

Jumping straight to state 4 is fine. Unlike blkback, there is no interlock
between the hotplug scripts and netback. You could work around this by
having an interlock between your hotplug script and your domain builder. Or
we could add an interlock into netback, but this would probably have to
break compatibility between netback and net hotplug scripts.

 -- Keir

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

* Re: Race with hotplug vif scripts
  2006-12-30 18:52 Race with hotplug vif scripts Jacob Gorm Hansen
  2006-12-30 19:03 ` Keir Fraser
@ 2006-12-30 19:18 ` Jacob Gorm Hansen
  2007-01-02 14:51 ` Ewan Mellor
  2 siblings, 0 replies; 4+ messages in thread
From: Jacob Gorm Hansen @ 2006-12-30 19:18 UTC (permalink / raw)
  To: xen-devel

On Sat, 2006-12-30 at 19:52 +0100, Jacob Gorm Hansen wrote:
> hi,
> 
> I have a domU running a custom HTTP client. As soon as the domain is
> booted and the VIF running it wants to initiate a connection. However, I
> seem to be having a race where the domU starts using the VIF before it
> is completely functional, probably because the hotplug script has not
> completed.
> 
> Currently I just set the frontend to '4', and just wait for the backend
> state to also become '4' (connected), but this does not work in all
> cases. How can I synchronize with the hotplug script, and what is the
> correct sequence of XenBus states?

Ahh never mind, the issue seems to be with TCP connection setup, the
server gets confused due to the shortlived domain reusing the same
source port number over and over. A little randomness fixes the problem.

Jacob

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

* Re: Race with hotplug vif scripts
  2006-12-30 18:52 Race with hotplug vif scripts Jacob Gorm Hansen
  2006-12-30 19:03 ` Keir Fraser
  2006-12-30 19:18 ` Jacob Gorm Hansen
@ 2007-01-02 14:51 ` Ewan Mellor
  2 siblings, 0 replies; 4+ messages in thread
From: Ewan Mellor @ 2007-01-02 14:51 UTC (permalink / raw)
  To: Jacob Gorm Hansen; +Cc: xen-devel

On Sat, Dec 30, 2006 at 07:52:48PM +0100, Jacob Gorm Hansen wrote:

> hi,
> 
> I have a domU running a custom HTTP client. As soon as the domain is
> booted and the VIF running it wants to initiate a connection. However, I
> seem to be having a race where the domU starts using the VIF before it
> is completely functional, probably because the hotplug script has not
> completed.
> 
> Currently I just set the frontend to '4', and just wait for the backend
> state to also become '4' (connected), but this does not work in all
> cases. How can I synchronize with the hotplug script, and what is the
> correct sequence of XenBus states?

You can sync with the hotplug script using the store: the scripts write to
/local/domain/0/backend/<devclass>/<domid>/<devid>/hotplug-status, writing
either "error" or "connected" when they are done (see xen-hotplug-common.sh).
Xend uses this to make sure that the domain does not get unpaused until the
hotplugging is done, and your toolstack could do the same.

HTH,

Ewan.

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

end of thread, other threads:[~2007-01-02 14:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-30 18:52 Race with hotplug vif scripts Jacob Gorm Hansen
2006-12-30 19:03 ` Keir Fraser
2006-12-30 19:18 ` Jacob Gorm Hansen
2007-01-02 14:51 ` Ewan Mellor

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.