All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: "Roger Pau Monné" <roger.pau@citrix.com>,
	"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
	"Ian Campbell" <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: calling vif hotplug scripts more than once
Date: Tue, 8 Jul 2014 17:13:29 +0200	[thread overview]
Message-ID: <20140708151329.GA5637@aepfle.de> (raw)


There is a regression in libxl in its handling of hotplug scripts. Its
not clear to me how to solve it.

If in a Windows VM the network interface is disabled and reenabled in
the "Network and Sharing Center", the backend remains in state 2 and the
vif is not reconnected to the bridge.  With xend all that was done via
udev. If run_hotplug_scripts in /etc/xen/xl.conf is set to 0 it works as
well.

Looking through libxl it appears that libxl__device_nic_add ->
libxl__wait_device_connection -> device_backend_callback ->
device_hotplug does all the work. Unfortunately, device_backend_callback
unregisters the watch, so no further events will be received. It seems
device_backend_callback should call device_hotplug, and then register
yet another watch to wait for state changes so that it eventually
catches such a disable/enable event from the guest.

Since all that is generic code, it seems this use case was not
considered. It looks like a one-shot approach to me.

I'm not sure how to fix this. Should device_backend_callback call into
libxl__wait_device_connection again to wait (forever) for the next 'state==2'?


Olaf

             reply	other threads:[~2014-07-08 15:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 15:13 Olaf Hering [this message]
2014-07-08 16:49 ` calling vif hotplug scripts more than once Ian Jackson
2014-07-08 16:52   ` Olaf Hering
2014-07-08 17:11     ` Ian Jackson
2014-07-09  7:36       ` Olaf Hering
2014-07-09  8:57         ` Ian Campbell
2014-07-09  8:59         ` Paul Durrant
2014-07-09  9:08           ` Ian Campbell
2014-07-09  9:25           ` Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140708151329.GA5637@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.