From: Roger Pau Monne <roger.pau@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v10 16/19] libxl: call hotplug scripts for nic devices from libxl
Date: Mon, 23 Jul 2012 10:22:48 +0100 [thread overview]
Message-ID: <500D17E8.4050101@citrix.com> (raw)
In-Reply-To: <1342800087.26734.140.camel@zakaz.uk.xensource.com>
Ian Campbell wrote:
>> + switch (nictype) {
>> + case LIBXL_NIC_TYPE_VIF_IOEMU:
>> + env[nr++] = "INTERFACE";
>> + env[nr++] = libxl__strdup(gc, libxl__device_nic_devname(gc,
>> + dev->domid, dev->devid,
>> + LIBXL_NIC_TYPE_VIF_IOEMU));
>
> Is this fall-through of the case deliberate? If so then a comment would
> be good.
>
> However I'm not sure about this. It seems like the hotplug scripts are
> only called once in the VIF_IOEMU case? I would expect one call for the
> PV VIF device and one for the TAP device? Perhaps I'm just missing the
> location of the other one? Is this "num_exec" variable involved in some
> way? But you don't propagate that to get_hotplug_env() and therefore
> include *both* sets of env vars?
Yes, we perform two calls, one for the vif device and one for the tap
device. I agree that this approach is not really clear, what might be
more suitable is to return arrays of hotplug execution items from
get_hotplug_script_info:
args =
{
{"/etc/xen/script/foo", "bar"},
{"/etc/xen/script/foo2", "bar2"},
NULL
};
And the same with env, so we keep executing items until we reach args[i]
== NULL.
> In any case something related seems to be broken for guests which use a
> stub domain and use vifname=foo. What I see in that case is the script
> called three times...
> 1. For the PV interface of the stub domain (LIBXL_NIC_TYPE_VIF),
> renames vifX+1.0 -> foo-emu (*)
> 2. For the PV interface of the real domain
> (LIBXL_NIC_TYPE_VIF_IOEMU part 1), renames vifX.0 -> foo
> 3. For the emu interface of the real domain
> (LIBXL_NIC_TYPE_VIF_IOEMU part 2) renames vifX.0 -> foo-emu
>
> The rename in #3 fails, because foo-emu already exists. But in fact this
> call to the script should never happen for a domain with a stub domain
> since the emulated device in this case is within the stub domain, not
> the driver domain.
As talked, the correct fix for this seems to detect if the guest has a
stubdom and return 0 on the second call to get_hotplug_script_info, to
prevent the execution of #3.
> (*) This is with the patch I posted earlier to rename the stub domain's
> vif with a -emu suffix. Without that then the clash is at #2 instead.
next prev parent reply other threads:[~2012-07-23 9:22 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 14:12 [PATCH v10 01/19] execute hotplug scripts from libxl v10 Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 01/19] libxl: check backend state before setting it to "closing" Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 02/19] libxl: change ao_device_remove to ao_device Roger Pau Monne
2012-07-20 16:35 ` Ian Jackson
2012-07-20 14:12 ` [PATCH v10 03/19] libxl: move device model creation prototypes Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 04/19] libxl: convert libxl_domain_destroy to an async op Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 05/19] libxl: move bootloader data strucutres and prototypes Roger Pau Monne
2012-07-20 17:21 ` Ian Jackson
2012-07-20 14:12 ` [PATCH v10 06/19] libxl: refactor disk addition to take a helper Roger Pau Monne
2012-07-20 17:24 ` Ian Jackson
2012-07-20 14:12 ` [PATCH v10 07/19] libxl: convert libxl__device_disk_local_attach to an async op Roger Pau Monne
2012-07-20 18:03 ` Ian Jackson
2012-07-23 11:32 ` Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 08/19] libxl: rename vifs to nics Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 09/19] libxl: convert libxl_device_disk_add to an async op Roger Pau Monne
2012-07-20 18:04 ` Ian Jackson
2012-07-20 14:12 ` [PATCH v10 10/19] libxl: convert libxl_device_nic_add to an async operation Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 11/19] libxl: add option to choose who executes hotplug scripts Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 12/19] libxl: rename _IOEMU nic type to VIF_IOEMU Roger Pau Monne
2012-07-20 16:34 ` Ian Campbell
2012-07-20 16:39 ` Ian Campbell
2012-07-20 14:12 ` [PATCH v10 13/19] libxl: set correct nic type depending on the guest Roger Pau Monne
2012-07-20 18:06 ` Ian Jackson
2012-07-20 14:12 ` [PATCH v10 14/19] libxl: use libxl__xs_path_cleanup on device_destroy Roger Pau Monne
2012-07-20 15:38 ` Ian Campbell
2012-07-20 14:12 ` [PATCH v10 15/19] libxl: call hotplug scripts for disk devices from libxl Roger Pau Monne
2012-07-20 15:20 ` Ian Campbell
2012-07-20 14:12 ` [PATCH v10 16/19] libxl: call hotplug scripts for nic " Roger Pau Monne
2012-07-20 16:01 ` Ian Campbell
2012-07-20 16:12 ` Ian Campbell
2012-07-20 16:36 ` Ian Campbell
2012-07-23 9:22 ` Roger Pau Monne [this message]
2012-07-20 16:03 ` Ian Campbell
2012-07-20 14:12 ` [PATCH v10 17/19] libxl: convert libxl_device_vkb_add to an async operation Roger Pau Monne
2012-07-20 18:08 ` Ian Jackson
2012-07-23 8:58 ` Roger Pau Monne
2012-07-23 9:26 ` Ian Campbell
2012-07-23 11:44 ` Ian Jackson
2012-07-20 14:12 ` [PATCH v10 18/19] libxl: convert libxl_device_vfb_add " Roger Pau Monne
2012-07-20 18:11 ` Ian Jackson
2012-07-23 11:58 ` Roger Pau Monne
2012-07-20 14:12 ` [PATCH v10 19/19] xl: main_blockdetach don't call destroy if remove succeeds Roger Pau Monne
2012-07-20 14:55 ` Ian Campbell
2012-07-23 12:17 ` [PATCH v10 01/19] execute hotplug scripts from libxl v10 Ian Campbell
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=500D17E8.4050101@citrix.com \
--to=roger.pau@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.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.