From: Ian Jackson Subject: Re: [PATCH v12 10/17] libxl: set correct nic type depending on the guest Date: Thu, 26 Jul 2012 12:08:48 +0100 Message-ID: <20497.9536.100259.321408@mariner.uk.xensource.com> References: <1343215161-27546-1-git-send-email-roger.pau@citrix.com> <1343215161-27546-11-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1343215161-27546-11-git-send-email-roger.pau@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 Roger Pau Monne writes ("[PATCH v12 10/17] libxl: set correct nic type depending on the guest"): > Fix the use of nic type, which results in the following for each type > of domain: > > * HVM: let the user choose, if none specified use VIF_IOEMU. > * PV: use VIF is none provided, return error if VIF_IOEMU requested. ... > + switch (libxl__domain_type(gc, domid)) { > + case LIBXL_DOMAIN_TYPE_HVM: > + if (!nic->nictype) > + nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU; > + break; > + case LIBXL_DOMAIN_TYPE_PV: > + if (nic->nictype == LIBXL_NIC_TYPE_VIF_IOEMU) { > + LOG(ERROR, "trying to create PV guest with an emulated interface"); > + return ERROR_INVAL; > + } > + nic->nictype = LIBXL_NIC_TYPE_VIF; > + break; > + default: > + abort(); > + } You are missing + case LIBXL_DOMAIN_TYPE_INVALID: + return ERROR_FAIL; Ian.