From: Ian Campbell Subject: Re: [PATCH v2 4/5] libxl: call hotplug scripts from libxl for vif Date: Wed, 18 Apr 2012 13:34:29 +0100 Message-ID: <1334752469.23948.236.camel@zakaz.uk.xensource.com> References: <1334677876-17704-1-git-send-email-roger.pau@citrix.com> <1334677876-17704-5-git-send-email-roger.pau@citrix.com> <1334742899.23948.180.camel@zakaz.uk.xensource.com> <518661FA-27B6-4C87-95B4-64F6EA19F896@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <518661FA-27B6-4C87-95B4-64F6EA19F896@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org > >> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c > >> index 01ff363..41230a6 100644 > >> --- a/tools/libxl/xl_cmdimpl.c > >> +++ b/tools/libxl/xl_cmdimpl.c > >> @@ -846,6 +846,19 @@ static void parse_config_data(const char > >> *configfile_filename_report, > >> nic->script = strdup(default_vifscript); > >> } > >> > >> + /* Set default nic type for PV guests correctly */ > >> + if (b_info->type == LIBXL_DOMAIN_TYPE_PV) { > >> + nic->nictype = LIBXL_NIC_TYPE_VIF; > >> + } > > > > Hrm, really the lib ought to be taking care of that for us... > > > > libxl__device_nic_setdefault has a domid so it should be able to query > > the domain type with libxl__domain_type. > > int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic) > is the prototype, and libxl_device_nic doesn't have a domid, so I'm not > sure where should I get it from. Urk, oh dear. I think it would be ok to add parameters which are necessary for setdefault to make its decision. Other wise perhaps make the default be LIBXL_NIC_TYPE_VIF unconditionally? That is the option which has a chance of working regardless of guest type, TYPE_IOEMU is a bit of an odd choice for the default. Ian.